public EnemyWithObject(Game game, Player player, SpriteBatch spriteBatch, NumberOfObjects numberOfObjects, AnimationStore animationStore)
            : base(game, new Animation(animationStore["EnemyRun"]), player, spriteBatch)
        {
            curGame = game;
            this.spriteBatch = spriteBatch;
            relativePlayer = player;

            this.numberOfObjects = numberOfObjects;
            this.animationStore = animationStore;

            totalTimeElapsed = TimeSpan.Zero;
            timeDelay = TimeSpan.FromSeconds(0.10);

            soundEffectPlayed = false;
        }
        public override void LoadContent()
        {
            viewport = ScreenManager.Game.GraphicsDevice.Viewport;

            //Animation store initialization
            animationStore = new AnimationStore();
            animationStore.Initialize(ScreenManager.Game.Content);

            //Ninja player initialization
            player = new Player(ScreenManager.Game, animationStore, this);
            player.Initialize();

            //Set the initial camera position to height of screen
            cameraPosition = 0;

            LoadAssets();

            pauseButton = new Button();
            pauseButton.Initialize(pauseButtonTexture, new Vector2(30, 30), 1.3f);
            pauseButton.Selected += new EventHandler(pauseButton_Selected);
            MenuButtons.Add(pauseButton);

            base.LoadContent();
        }
Exemple #3
0
        public Player(Game game, AnimationStore animationStore, GameplayScreen gameplayScreen)
        {
            curGame = (NinjaDashGame)game;
            this.animationStore = animationStore;
            this.gameplayScreen = gameplayScreen;

            ItemsCollected = new Dictionary<string, int>();

            //Add items collected in-game to ItemsCollected dictionary
            ItemsCollected.Add("NinjaStars", 0);
            ItemsCollected.Add("FlyingObjects", 0);
            ItemsCollected.Add("HorizontalEnemies", 0);
        }