コード例 #1
0
 public void loadNextLevel() {
   getObjects().clear();
   if (Map.isLastLevel()) {
     Game.setScene(new WinScene(Player.score));
   } else {
     Map.nextLevel();
     Map.getCurrentLevel().loadObjects(this);
   }
 }
コード例 #2
0
 public GameScene() {
   super();
   Map.player = null; // dont keep the player if the game is restarted
   Map.load();
   loadLevel(0);
   background = new Animation(AssetManager.getTexture("background"));
   background.setSize(20, 10);
   // addObject(new Projectile(new Vector2(0, 0), (float)Math.PI/2, (float)Math.PI/2, 1, new
   // Killable(new Vector2(0, 0), new Animation(AssetManager.getTexture("projectile"))), new
   // Animation(AssetManager.getTexture("projectile"))));
   // addObject(new Projectile(new Vector2(0, 0), (float)Math.PI/2, (float)Math.PI/2, 1,
   // Killable.Type.PLAYER, new Animation(AssetManager.getTexture("projectile"))));
   // addObject(new Cultist(new Vector2(1, 4), 5));
   // addObject(new BasicEnemy(new Vector2(1, 4), 32, 5, 7, 3, 100, new Vector2(2, 2), new
   // Animation(new Sprite(AssetManager.getTexture("tank")), 0.5f, 0, 0, false), new
   // Animation(AssetManager.getTexture("tank"))));
 }
コード例 #3
0
 public void draw(SpriteBatch batch) {
   background.draw(batch);
   Map.draw(batch);
   super.draw(batch);
 }
コード例 #4
0
 public void loadLevel(int level) {
   getObjects().clear();
   Map.setLevel(level);
   Map.getCurrentLevel().loadObjects(this);
 }