private static bool loc(String[] words) { try { player.say($"im at {player.getLocation().X} , {player.getLocation().Y}"); return(true); } catch (Exception e) { VConsole.writeLine("Error with command: " + e); return(false); } }
private static bool clearConsole() { try { VConsole.clear(); return(true); } catch (Exception e) { VConsole.writeLine("Error with command: " + e); return(false); } }
private static bool changeRange(String[] words) { try { int newRange = Convert.ToInt32(words[1]); player.setViewRange(newRange); return(true); } catch (Exception e) { VConsole.writeLine("Error with command: " + e); return(false); } }
private static bool setCon(String[] words) { try { int newSize = Convert.ToInt32(words[1]); GameData.levelViewSize = newSize; return(true); } catch (Exception e) { VConsole.writeLine("Error with command: " + e); return(false); } }
private static bool setSpeed(String[] words) { try { float newSpeed = float.Parse(words[1]); player.setSpeed(newSpeed); return(true); } catch (Exception e) { VConsole.writeLine("Error with command: " + e); return(false); } }
private static bool teleport(String[] words) { try { int x = Convert.ToInt32(words[2]); int y = Convert.ToInt32(words[3]); Level lvl = allLevels[words[1] + ".txt"];; player.level.world[player.getLocation().X, player.getLocation().Y].topObject = null; //deletes player player.level = lvl; player.move(new Point(x, y)); //moves player to targetlocation return(true); } catch (Exception e) { VConsole.writeLine("Error with command: " + e); return(false); } }
public void say(String text) { VConsole.writeLine($"{name}: {text}"); }