Ejemplo n.º 1
0
        private void initializeGameworld(ContentHolder contentHolder)
        {
            playerObject = new Player(contentHolder.texturePlayer, contentHolder.texturePlayerTurret, 100, 100, Vector2.Zero, 100, 100);

            // The following should (and will, eventually) be loaded by reading a file generated by an editor,
            //  so this is temp, testing etc

            rock[0] = new Collidable(contentHolder.textureRock01, 150, 300, Vector2.Zero);
            rock[1] = new Collidable(contentHolder.textureRock02, -250, -330, Vector2.Zero);
            rock[2] = new Collidable(contentHolder.textureRock01, 500, 300, Vector2.Zero);
            rock[3] = new Collidable(contentHolder.textureRock02, -100, 250, Vector2.Zero);
        }
Ejemplo n.º 2
0
        public Controller(ContentHolder content, SoundManager soundManager, Highscores hs, string title, int width, int height)
        {
            //playerObject = new GameObject[Constants.maxNumberOfObjectsInArray];
            this.soundManager = soundManager;
            playerObject = null;
            this.content = content;
            physicsEngine = new PhysicsEngine();
            menuHandler = new MenuHandler(content, width, height, hs);
            elapsed = 0;
            randGen = new Random();
            randomTimeBetweenSpawns = randGen.Next(1, 5);

            this.hs = hs;

            soundManager.playSoundtrack();
        }
Ejemplo n.º 3
0
 public void setPlayer(Player updatedPlayerObject)
 {
     playerObject = updatedPlayerObject;
 }
Ejemplo n.º 4
0
        private void initializeGameworld(ContentHolder contentHolder)
        {
            playerObject = new Player(  contentHolder.texturePlayer,
                                        contentHolder.texturePlayerTurret,
                                        contentHolder.texturePlayerBullet,
                                        contentHolder.texturePlayerSpecal01,
                                      0, 0, Vector2.Zero, 5000);

            gravityWell = new GameObject(contentHolder.textureGravityWell,
                                         playerObject.Position.X,
                                         playerObject.Position.Y,
                                         Vector2.Zero,
                                         0);

            levelBounds = createBounds();
            background01 = new Background(contentHolder.bg_variant0, playerObject.Velocity, levelBounds, 0, 0, 0.4f);
            background02 = new Background(contentHolder.bg_variant1, playerObject.Velocity, levelBounds, 0, 0, 0.2f);

            // The following should (and will, eventually) be loaded by reading a file generated by an editor,
            //  so this is temp, testing etc
            particleSystem.newEmitter(contentHolder.particle_smoke, getPlayer().Position, 0, 200, 12, false, getPlayer().Velocity);

            rocks.Add(new Collidable(contentHolder.textureRock01,  150,  300, Vector2.Zero, true, 600));
            rocks.Add(new Collidable(contentHolder.textureRock02, -250, -330, Vector2.Zero, true, 400));
            rocks.Add(new Collidable(contentHolder.textureRock01, 500, 300, Vector2.Zero, true, 100));
            rocks.Add(new Collidable(contentHolder.textureRock02, -100, 250, Vector2.Zero, true, 250));

            rocks.Add(new Collidable(contentHolder.textureRock01, 0, -250, new Vector2(0, -2), true, 200));

            //for (int i = 0; i < 20; i++)
            //{

            //    enemies.Add(new Enemy(contentHolder.textureEnemy01, contentHolder.texturePlayerTurret, contentHolder.texturePlayerBullet, i * 20 + 200, i * 20 + 200, Vector2.Zero, 1000));
            //}
        }
Ejemplo n.º 5
0
 //Copies the entire Gamestate
 public void getModelFromGameworld(Gameworld gameWorld)
 {
     playerObject = gameWorld.getPlayer();
 }
Ejemplo n.º 6
0
 public Controller()
 {
     //playerObject = new GameObject[Constants.maxNumberOfObjectsInArray];
     playerObject = null;
 }