void gameTick() { int cursorX = getMouseX(this, mainWindow.area) / (TileSize * mainWindow.scale); int cursorY = getMouseY(this, mainWindow.area) / (TileSize * mainWindow.scale); if (inRange(cursorX, 0, BoardSize) && inRange(cursorY, 0, BoardSize)) { //DisplayTile(gfx,new Tile(cursorX,cursorY,0,"cursor"),mainWindow); } rightWindow.ResizeMe(newRectPoint2Point(allignPoint(this.ClientRectangle, 100 - borderSize, 0), allignPoint(this.ClientRectangle, 100, 100))); rightWindow.DrawWindow(); handleEnemies(); // Draws border fillAllignedRectPoint2Point(gfx, MainForm.brushBlack, mainWindow.area, 0, 0, 1, 100); fillAllignedRectPoint2Point(gfx, MainForm.brushBlack, mainWindow.area, 0, 0, 100, 1); fillAllignedRectPoint2Point(gfx, MainForm.brushBlack, mainWindow.area, 99, 0, 100, 100); fillAllignedRectPoint2Point(gfx, MainForm.brushBlack, mainWindow.area, 0, 99, 100, 100); if (mouseDown) { mouseDown = false; if (inRange(cursorX, 0, BoardSize - 1) && inRange(cursorY, 0, BoardSize - 1)) { if (gameBoard.board[cursorX, cursorY].state.Equals("enemy")) { mainWindow.setState("Title"); clicks = 0; // resets score } else { clicks++; } } } }
void resizeTick() { picMain.Refresh(); picMain.Size = this.Size; fillAllignedRectPoint2Point(gfx, brushBlack, this.ClientRectangle, 0, 0, borderSize, 100); fillAllignedRectPoint2Point(gfx, brushBlack, this.ClientRectangle, 100 - borderSize, 0, 100, 100); fillOJ(); mainWindow.ResizeMe(newRectPoint2Point(allignPoint(this.ClientRectangle, borderSize, 0), allignPoint(this.ClientRectangle, 100 - borderSize, 100))); leftWindow.ResizeMe(newRectPoint2Point(allignPoint(this.ClientRectangle, 0, 0), allignPoint(this.ClientRectangle, borderSize, 100))); }