예제 #1
0
        public Player(SpriteSheet texture, Level level, Vector2 position, Vector2 size, int health, float speed, SpriteSheetLoader loader) : base(texture, level, position, size, health, speed)
        {
            idleSpriteSheet    = texture.GetSubAt(0, 0, 1, 1, size);
            runningSpriteSheet = texture.GetSubAt(2, 0, 3, 1, size);
            jumpingSpriteSheet = texture.GetSubAt(6, 0, 1, 1, size);

            //Fire sheets
            idleFireSpriteSheet    = texture.GetSubAt(0, 1, 1, 1, size);
            runningFireSpriteSheet = texture.GetSubAt(2, 1, 3, 1, size);
            jumpingFireSpriteSheet = texture.GetSubAt(6, 1, 1, 1, size);

            this.walkSpeed = speed;
            this.runSpeed  = speed * 2;

            this.msPerFrame = 50;

            this.currentSpriteSheet = idleSpriteSheet;

            this.fireBalls = new List <FireBall>();
            this.loader    = loader;
        }
 public PowerupBlock(SpriteSheet texture, Level level, Vector2 position, Vector2 size, SpriteSheetLoader loader) : base(texture, level, position, size)
 {
     this.powerup = null;
     this.loader  = loader;
 }