Пример #1
0
        protected Spirit( IPlayScene scene, int type, Vector2 location, string movieName, string extendMovieName, float speed, int angle, HitArea hitArea, int width, int height, double destroySecond, bool isMovieRotable, bool isAreaLimited, bool isAreaEntered, double areaSecond )
        {
            if ( null == scene || string.IsNullOrEmpty ( movieName ) )
                throw new ArgumentNullException ( "scene, movieName", "scene, movieName can't be null" );

            this.destroyFrameCount = World.ToFrameCount ( destroySecond );

            this.scene = scene;
            this.world = scene.World;
            this.audioManager = scene.AudioManager;

            this.isMovieRotable = isMovieRotable;
            this.isAreaLimited = isAreaLimited;
            this.isAreaEntered = isAreaEntered;

            this.areaFrameCount = World.ToFrameCount ( areaSecond );

            this.Location = location;

            this.movie = Movie.Clone ( this.scene.Makings[movieName] as Movie );
            this.movie.Ended += this.movieEnded;

            this.movieName = movieName;

            if ( !string.IsNullOrEmpty ( extendMovieName ) )
            {
                this.extendMovie = Movie.Clone ( this.scene.Makings[extendMovieName] as Movie );
                this.extendMovieName = extendMovieName;
            }

            this.Width = width;
            this.Height = height;
            this.halfSize = new Vector2 ( width / 2, height / 2 );

            this.Type = type;

            this.Speed = speed;
            this.Angle = angle;
            this.HitArea = hitArea;

            if ( null != this.HitArea )
                this.HitArea.Locate ( this.getHitAreaLocation ( ) );
        }
Пример #2
0
        protected Scene( Vector2 location, GestureType gestureType, IList<Resource> resources, IList<Making> makings, bool isBroken, bool isBackgroundMusicLoop )
        {
            this.Location = location;
            this.GestureType = gestureType;

            this.resourceManager = new ResourceManager ( resources );
            this.audioManager = new AudioManager ( );

            if ( null != makings )
                foreach ( Making making in makings )
                    if ( null != making )
                        this.makings.Add ( making.Name, making );

            foreach ( Making making in this.makings.Values )
                making.Init ( this );

            this.IsBroken = isBroken;
            this.isBackgroundMusicLoop = isBackgroundMusicLoop;
        }