public RogueMonster(int id, RogueMonsters rogMons, int pX, int pY) { rogMonsters = rogMons; ID = id; posX = pX; posY = pY; rogMonsters.SetParameters(ID, this); }
//Public public APPRogue() : base("roguelike-v23.0.0.23-by-onionmilk") { generator = new RogueGenerator(); RogueMapParameters mapParameters = new RogueMapParameters(); mapParameters.size = new int[2] { 20, 20 }; mapParameters.roomFrequency = 0.2f; mapParameters.roomMaxSize = 3; mapParameters.chestMaxAmount = 5; generator.generate(mapParameters); world = generator.getMap(); player = new RoguePlayer(world.map); player.position = generator.getSpawn(); monsters = new RogueMonsters(world.map, player); }
public override void ReactToInputKeyboard(SHGUIinput key) { if (mapView) //Tryb podglądu mapy { if (key == SHGUIinput.up) { displayOffset[1] -= 1; } if (key == SHGUIinput.down) { displayOffset[1] += 1; } if (key == SHGUIinput.left) { displayOffset[0] -= 1; } if (key == SHGUIinput.right) { displayOffset[0] += 1; } //-- } else if (key == SHGUIinput.up || key == SHGUIinput.down || key == SHGUIinput.left || key == SHGUIinput.right ) //Czy się próbowano ruszyć { bool moved = false; if (key == SHGUIinput.up) { moved = player.moveBy(0, -1); } if (key == SHGUIinput.down) { moved = player.moveBy(0, +1); } if (key == SHGUIinput.left) { moved = player.moveBy(-1, 0); } if (key == SHGUIinput.right) { moved = player.moveBy(+1, 0); } if (moved) { updateLogic = true; } else { status.setMessage("Cannot move there!"); } for (int m = 0; m < monsters.monsterList.Count; ++m) //ruch potworów { monsters.monsterList[m].Move(); } } if (key == SHGUIinput.enter) { RogueMapParameters mapParameters = new RogueMapParameters(); mapParameters.size = new int[2] { 20, 20 }; mapParameters.roomFrequency = 0.3f; mapParameters.roomMaxSize = 5; mapParameters.chestMaxAmount = 5; generator.generate(mapParameters); world = generator.getMap(); player = new RoguePlayer(world.map); player.position = generator.getSpawn(); monsters = new RogueMonsters(world.map, player); } if (key == SHGUIinput.esc) { SHGUI.current.PopView(); } //-- }
public RogueMonster(int id, RogueMonsters rogMons) { rogMonsters = rogMons; ID = id; rogMonsters.SetParameters(ID, this); }