Ejemplo n.º 1
0
        // ISSUE Player is not positioning at the beginning
        public Player(Game game, Level level)
        {
            this.level = level;

            Texture2D playerAnimationTexture;

            playerAnimationTexture = game.Content.Load<Texture2D>("reimu");
            animation = new Effect.AnimatedTexture(playerAnimationTexture, position, 18, 0.1);
            // Setup final animation sets
            animation.animationSets = new Dictionary<string, List<int>>()
            {
                {"Fly", playerAnimationFly},
                {"Left Accel", playerAnimationLeftAccel},
                {"Left", playerAnimationLeft},
                {"Right Accel", playerAnimationRightAccel},
                {"Right", playerAnimationRight},
            };
            animation.animationSet = "Fly";

            soundShoot = game.Content.Load<SoundEffect>("playershoot");

            bulletTexture = game.Content.Load<Texture2D>("bullet1");

            X = level.width / 2;
            Y = level.height / 2;
        }
Ejemplo n.º 2
0
        public Enemy(Game game, Level level, int x, int radius, int speedX, int speedY, int health)
        {
            this.game = game;
            this.level = level;

            this.radius = radius;

            this.health = health;

            Texture2D animationTexture;
            animationTexture = game.Content.Load<Texture2D>("enemy1fly");
            bulletTexture = game.Content.Load<Texture2D>("testbullet");

            position.X = x;
            position.Y = -animationTexture.Height;
            velocity.X = speedX;
            velocity.Y = speedY;

            animation = new Effect.AnimatedTexture(animationTexture, position, 4, 0.2);
        }