public override void Draw(MainGame game, int x, int y, int light) { if (this.BasicSprite != null) { this.BasicSprite.Position = new Vector2(x, y); game.Draw(this.BasicSprite); } game.Draw(Shape.Rectangle(new Vector2(x, y), new Vector2(x + MainGame.TileSize, y + MainGame.TileSize), lightLevels[light])); }
public override void Draw(MainGame game, int x, int y) { base.Draw(game, x, y); }
public virtual void PreLight(MainGame game, int x, int y) { foreach (Item item in this.TopItem) { item.PreLight(game, x, y); } foreach (Item item in this.EngieLayer) { item.PreLight(game, x, y); } }
public virtual void Draw(MainGame game, int x, int y, int light) { foreach (Item item in this.EngieLayer) { item.Draw(game, x, y); } if (TopItem.Count > 0) { TopItem.Peek().Draw(game, x, y); } else { if (this.BaseTile != null) { this.BaseTile.Draw(game, x, y, light); } } }
static void Main(string[] args) { MainGame game = new MainGame(); game.Run(); Process.GetCurrentProcess().Kill(); }
public virtual void PreLight(MainGame game, int x, int y) { }
public override void PreLight(MainGame game, int x, int y) { game.AddLight(x, y); }
public void KeyPressed(MainGame game, KeyCode code, char keyChar) { if (code == KeyCode.F12) { this.Active = !this.Active; } if (this.Active) { if (code == KeyCode.Return) { this.DoString(this.TextString.Text, game); this.TextString.Text = ""; } else if (code == KeyCode.Back) { string str = this.TextString.Text; if (str.Length > 0) { str = str.Substring(0, str.Length - 1); this.TextString.Text = str; } } else if (code == KeyCode.F12) { return; } else { if (TextString.Text.Length < 20) { TextString.Text += keyChar; } } } }
public virtual void Draw(MainGame game, int x, int y) { if (this.BasicSprite != null) { this.BasicSprite.Position = new Vector2(x, y); game.Draw(this.BasicSprite); } }
public void Draw(MainGame game) { if (this.Active) { game.Draw(this.Background); } game.Draw(this.TextString); }
public void DoString(string str, MainGame game) { this.Print("> " + str); string[] tokens = str.Split(' '); switch (tokens[0]) { case "exit": game.Running = false; break; case "torch": this.Print("Adding Torch"); game.GetPlayerTile().AddItemToTop(new Light()); game.NeedsLight = true; break; case "door": this.Print("Adding Door"); game.GetPlayerTile().AddItemToTop(new Door()); game.NeedsLight = true; break; case "noclip": game.NoClip = !game.NoClip; this.Print("Noclip: " + game.NoClip.ToString()); break; case "alllight": game.AllLight = !game.AllLight; this.Print("AllLight: " + game.AllLight.ToString()); break; case "engie": break; case "help": this.Print(@" exit: exit the game torch: place a torch door: place a door noclip: disable colision alllight: disable lighting cleartop: remove all top items from the thing you are standing on clearengie: remove all engie layer items from the thing you are standing on engie: show the engering layer help: print this message; "); break; default: this.Print("Command does not exist"); break; } }