예제 #1
0
파일: HitArea.cs 프로젝트: Otto404/wp-xna
        internal bool HitTest( HitArea area )
        {
            if ( !this.IsEnabled )
                return false;

            return this.hitTesting ( area );
        }
예제 #2
0
파일: Bullet.cs 프로젝트: Otto404/wp-xna
        protected Bullet( IPlayScene scene, int type, Vector2 location, string movieName, float speed, int angle, HitArea hitArea, int width, int height, int power, int life, double destroySecond, bool isMovieRotable, bool isAreaLimited, bool isAreaEntered, double areaSecond )
            : base(scene, type, location, movieName,
			null,
			speed, angle, hitArea, width, height, destroySecond, isMovieRotable, isAreaLimited, isAreaEntered, areaSecond)
        {
            this.Power = power < 0 ? 0 : power;
            this.life = life;

            this.isMoving = true;
        }
예제 #3
0
파일: Region.cs 프로젝트: Otto404/wp-xna
        protected Region( IPlayScene scene, int type, Vector2 location, string movieName, float speed, int angle, HitArea hitArea, int width, int height, double destroySecond )
            : base(scene, type, location, movieName,
			null,
			speed, angle, hitArea, width, height, destroySecond,
			true,
			false,
			false,
			0)
        {
        }
예제 #4
0
파일: NPC.cs 프로젝트: Otto404/wp-xna
        protected NPC( IPlayScene scene, int type, Vector2 location, string movieName, string extendMovieName, float speed, int angle, HitArea hitArea, int width, int height, int life, IList<NPCAction> actions, double destroySecond, bool isMovieRotable, bool isAreaLimited, bool isAreaEntered, double areaSecond )
            : base(scene, type, location, movieName, extendMovieName, speed, angle, hitArea, width, height, destroySecond, isMovieRotable, isAreaLimited, isAreaEntered, areaSecond)
        {
            this.life = life <= 0 ? 1 : life;
            this.protoLife = this.life;

            if ( null != actions )
                this.actions.AddRange ( actions );

            this.currentActionIndex = 0;
        }
예제 #5
0
        protected override bool hitTesting( HitArea area )
        {
            if ( !base.hitTesting ( area ) )
                return false;

            foreach ( Rectangle subRectangle in this.subRectangles )
                if ( area.HitTest ( subRectangle ) )
                    return true;

            return false;
        }
예제 #6
0
파일: Item.cs 프로젝트: Otto404/wp-xna
        protected Item( IPlayScene scene, int type, Vector2 location, string movieName, float speed, int angle, HitArea hitArea, int width, int height, double destroySecond, bool isAreaLimited, bool isAreaEntered, double areaSecond, bool isAutoPick )
            : base(scene, type, location, movieName,
			null,
			speed, angle, hitArea, width, height, destroySecond,
			false,
			isAreaLimited, isAreaEntered, areaSecond)
        {
            this.isAutoPick = isAutoPick;

            this.isMoving = true;
        }
예제 #7
0
파일: Spirit.cs 프로젝트: Otto404/wp-xna
        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 ( ) );
        }
예제 #8
0
 protected override bool hitTesting( HitArea area )
 {
     return area.HitTest ( this.rectangle );
 }
예제 #9
0
파일: HitArea.cs 프로젝트: Otto404/wp-xna
 protected abstract bool hitTesting( HitArea area );