Beispiel #1
0
 public Game_Manager(Platform current_platform, Drawvisitor drawvisitor, iInputhandler inputhandler)
 {
     this.EmptyTile = new Tile(this, new Position(-1, -1), false);
     this.drawvisitor = drawvisitor;
     this.level = new leveldata(this, Dificulty.normal);
     this.inputhandler = inputhandler;
     latestinput = inputhandler.getinput();
     this.SelectedTile = EmptyTile;
     this.selectionbuttons = new SelectionButtons(this);
     this.current_platform = current_platform;
     if (this.current_platform == Platform.windows)
     {
         SelectionButtonsEnabled = false;
     }
     else
     {
         SelectionButtonsEnabled = true;
     }
 }
Beispiel #2
0
        public void Update(float dt)
        {
            if (ClickCooldown > 0) { ClickCooldown -= dt; } else { ClickCooldown = 0; }
            if (EndingLevelCooldown > 0) { EndingLevelCooldown -= dt; } else { EndingLevelCooldown = 0; }

            latestinput = inputhandler.getinput();

            HandleInputs();
            selectionbuttons.Update(dt, latestinput);
            
            if (level != null)
            {
                level.Update(dt);

                if (EndingLevel)
                {
                    if (EndingLevelCooldown <= 0)
                    { 
                        if (level.OnBomb(3f, dt))
                        {
                            NewLevel();
                        }
                    }
                }
                else if (level.CheckIfDone())
                {
                    NewLevel();
                }
            }

            if (latestinput.navigation == NavigationType.exit)
            {
                this.Exit = true;
            }

        }