Dim Shared WS
, GridSize
, Choice
, Matches
, Center
, Guess$
, Guess
, DisplayScreen
, score
Dim GameTurn
(10) As GameTurn_Type
Choice = 1
GameLimit = 3
GameTurn(0).GridSize = 8: GameTurn(0).Matches = 3
GameTurn(1).GridSize = 12: GameTurn(1).Matches = 3
GameTurn(2).GridSize = 12: GameTurn(2).Matches = 4
GameTurn(3).GridSize = 8: GameTurn(3).Matches = 4
renewgrid = -1
GridSize = GameTurn(GameOn).GridSize: Matches = GameTurn(GameOn).Matches
GameOn = GameOn + 1
MakeGrid
DisplayScreen = 0
renewgrid = 0
DisplayGrid
UserInput
Choice
= (Choice
+ 1) Mod GridSize
If Choice
= 0 Then Choice
= GridSize
ShowScore
renewgrid = -1
Print "YOU ARE A BIG WEENER!! YAAAYYY!!" DisplayScreen = 0
AutoScale
checkwin = -1
C = Choice - 1
Print "YOU ARE A BIG LOSER!! HAHAHAHA!!" DisplayScreen = 0
AutoScale
' If Grid(C, y) <> 0 Then
Guess = Grid(C, y)
Grid(C, y) = 0
Guess$ = ""
Guess = 0
score = score + 10 ^ Matches
DisplayGrid
' End If
DisplayScreen = 0
AutoScale
Line (0, GridSize
* 8 + 8)-Step(639, 16), -1, BF
Line ((GridSize
* 8 - PW
) \
2, GridSize
* 8 + 8)-Step(PW
, 8), &HFF000000, BF
_PrintString ((GridSize
* 8 - PW
) \
2, GridSize
* 8 + 8), Guess$
AutoScale
WS
= _NewImage(GridSize
* 8, GridSize
* 8 + 16, 32) _Font 8 'this creates a 30x32 screen
count = -1: value = -1
count
= (count
+ 1) Mod Matches
If count
= 0 Then value
= (value
+ 1) Mod Matches
Grid(y, x) = value + 1
Grid(GridSize - i, GridSize) = 0
xswap
= Int(Rnd * GridSize
) + 1: yswap
= Int(Rnd * GridSize
) + 1 If Grid
(x
, y
) <> 0 And Grid
(xswap
, yswap
) <> 0 Then Swap Grid
(xswap
, yswap
), Grid
(x
, y
) 'Shuffle the grid Guess$ = ""
Guess = 0
TH = taskbar_height
Scale = (DH - TH) / 640
DisplayScreen
= _NewImage(640 * Scale
, 640 * Scale
, 32) ScreenMove
(DW
- _Width(DisplayScreen
)) \
2, 0
BorderWidth = glutGet(506)
TitleBarHeight = glutGet(507)
_ScreenMove x
- BorderWidth
, y
- BorderWidth
- TitleBarHeight
Game now runs for multiple rounds before ending, as well as having a scoring system in it. Bplus's glitch with the autoscale not working should be fixed, and the taskbar height routine shouldn't be an issue for folks on Linux or Mac now.
At this point, the game is basically finished, unless I want to swap in some bells and whistles like music and images instead of the plain old numbers which we're using here. In a lot of ways, I kind of like just sticking with the numbers for a sort of retro-Screen 0 type feel for everything. A simple high score system would be nice to add, but it's a pain in the rump to add and deal with, while sticking to the single-input rule, and my time is limited here before Halloween. Maybe I'll take time and add that into the game after the holiday comes around and passes. LOL! :P
Anywho, test it out. Tell me what you think, and let me know if you run into any glitches or unexpected behavior with everything.