Esempio n. 1
0
 public void Setup()
 {
     Rectangle screenBound = new Rectangle();
     Player = new Player();
     Player._Position = Vector2.Zero;
     Player.Speed = 6f;
     Player.ScreenBound = screenBound;
     Player._velocity = new Vector2(0.2f, 0);
 }
Esempio n. 2
0
        public void Setup()
        {
            player = new Player();
            player.width = 50;
            player.height = 50;

            thrownObject = new ThrowObject();
            thrownObject.width = 50;
            thrownObject.height = 50;

            level = new Level();
            level.Player = (Player)player;
            level.ThrownObjects = new List<ThrowObject>();
            level.ThrownObjects.Add((ThrowObject)thrownObject);

            throwAttack = new ThrowAttack();
            throwAttack.SetLevel(level);
            thrownObject.SetLevel(level);
            player.SetLevel(level);
            throwingEnemy = new LittleEnemy();
            throwingEnemy.SetAttack(throwAttack);
        }
Esempio n. 3
0
        public void loadContent()
        {
            TextureLoader textureLoader = TextureLoader.GetInstance();

            Texture2D blockSpriteA = Content.Load<Texture2D>("blockA");
            Texture2D blockSpriteB = Content.Load<Texture2D>("blockB");
            Texture2D coin = Content.Load<Texture2D>("coin");
            Texture2D background = Content.Load<Texture2D>("b");
            Texture2D weapon_texture = Content.Load<Texture2D>("weapon");
            Texture2D ammo_texture = Content.Load<Texture2D>("ammo");

            textureLoader.addTexture("blockA", blockSpriteA);
            textureLoader.addTexture("blockB", blockSpriteB);
            textureLoader.addTexture("coin", coin);
            textureLoader.addTexture("b", background);
            textureLoader.addTexture("weapon", weapon_texture);
            textureLoader.addTexture("ammo", ammo_texture);

            font = Content.Load<SpriteFont>("Font");
            deadFont = Content.Load<SpriteFont>("DeadFont");

            Texture2D ballSprite = Content.Load<Texture2D>("ball");
            player = new Player(Vector2.Zero, 6.0f, new Rectangle(0, 0, 3900,
                1200));

            selected_level.SetPlayer(player);
            selected_level.Layers[0].addSprite(new Background(Vector2.Zero));

            ShootableWeapon w1;
            w1 = new ShootableWeapon("ak47", weapon_texture, player._Position, 0);
            player.addWeapon(w1);
            player.SetCurrentWeapon(0);

            selected_level.addEnemy(50, 5);

            selected_level.Load();
            Controller = new GameController(selected_level);
        }