public void newGame() { Level.clear(); level = Level.LoadLevel(this, LevelEnum.Start); player = new Player(); player.level = level; level.player = player; player.x = level.xSpawn; player.z = level.ySpawn; level.addEntity(player); player.rot = Math.PI + 0.4; }
public override double getWalkSpeed(Player player) { if (player.getSelectedItem() == Item.skates) return 0.05; return 1.4; }
public override double getFriction(Player player) { if (player.getSelectedItem() == Item.skates) return 0.98; return 1; }
public LoseMenu(Player player) { this.player = player; }
public virtual double getWalkSpeed(Player player) { return 1; }
public virtual double getFriction(Player player) { return 0.6; }
public void lose(Player player) { setMenu(new LoseMenu(player)); }
public void win(Player player) { setMenu(new WinMenu(player)); }
public void removeEntityImmediately(Player player) { entities.Remove(player); getBlock(player.xTileO, player.zTileO).removeEntity(player); }
public virtual void init(Game game, int w, int h, int[] pixels) { this.game = game; player = game.player; solidWall.col = Art.GetColor(wallCol); solidWall.tex = Art.GetColor(wallTex); this.width = w; this.height = h; blocks = new Block[width * height]; for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { int col = pixels[x + y * w] & 0xffffff; int id = 255 - ((pixels[x + y * w] >> 24) & 0xff); Block block = getBlock(x, y, col); block.id = id; if (block.tex == -1) block.tex = wallTex; if (block.floorTex == -1) block.floorTex = floorTex; if (block.ceilTex == -1) block.ceilTex = ceilTex; if (block.col == -1) block.col = Art.GetColor(wallCol); if (block.floorCol == -1) block.floorCol = Art.GetColor(floorCol); if (block.ceilCol == -1) block.ceilCol = Art.GetColor(ceilCol); blocks[x + y * w] = block; block.level = this; block.x = x; block.y = y; } } for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { int col = pixels[x + y * w] & 0xffffff; decorateBlock(x, y, blocks[x + y * w], col); } } }
public override double getWalkSpeed(Player player) { return 0.4; }
public WinMenu(Player player) { this.player = player; }