Esempio n. 1
0
 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]));
 }
Esempio n. 2
0
 public override void Draw(MainGame game, int x, int y)
 {
     base.Draw(game, x, y);
 }
Esempio n. 3
0
 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);
     }
 }
Esempio n. 4
0
 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);
         }
     }
 }
Esempio n. 5
0
 static void Main(string[] args)
 {
     MainGame game = new MainGame();
     game.Run();
     Process.GetCurrentProcess().Kill();
 }
Esempio n. 6
0
 public virtual void PreLight(MainGame game, int x, int y)
 {
 }
Esempio n. 7
0
 public override void PreLight(MainGame game, int x, int y)
 {
     game.AddLight(x, y);
 }
Esempio n. 8
0
        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;
                    }
                }
            }
        }
Esempio n. 9
0
 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);
     }
 }
Esempio n. 10
0
 public void Draw(MainGame game)
 {
     if (this.Active)
     {
         game.Draw(this.Background);
     }
     game.Draw(this.TextString);
 }
Esempio n. 11
0
        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;
            }
        }
Esempio n. 12
0
 public override void Draw(MainGame game, int x, int y)
 {
     base.Draw(game, x, y);
 }
Esempio n. 13
0
 public override void PreLight(MainGame game, int x, int y)
 {
     game.AddLight(x, y);
 }
Esempio n. 14
0
 public virtual void PreLight(MainGame game, int x, int y)
 {
 }