Пример #1
0
        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;
        }
Пример #2
0
 public override double getWalkSpeed(Player player)
 {
     if (player.getSelectedItem() == Item.skates) return 0.05;
     return 1.4;
 }
Пример #3
0
 public override double getFriction(Player player)
 {
     if (player.getSelectedItem() == Item.skates) return 0.98;
     return 1;
 }
Пример #4
0
 public LoseMenu(Player player)
 {
     this.player = player;
 }
Пример #5
0
 public virtual double getWalkSpeed(Player player)
 {
     return 1;
 }
Пример #6
0
 public virtual double getFriction(Player player)
 {
     return 0.6;
 }
Пример #7
0
 public void lose(Player player)
 {
     setMenu(new LoseMenu(player));
 }
Пример #8
0
 public void win(Player player)
 {
     setMenu(new WinMenu(player));
 }
Пример #9
0
 public void removeEntityImmediately(Player player)
 {
     entities.Remove(player);
     getBlock(player.xTileO, player.zTileO).removeEntity(player);
 }
Пример #10
0
        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);
                }
            }
        }
Пример #11
0
 public override double getWalkSpeed(Player player)
 {
     return 0.4;
 }
Пример #12
0
 public WinMenu(Player player)
 {
     this.player = player;
 }