Hello...
Trying to work out my last few stickler items on a program I'm working on so here are a few questions if anyone has some insight to share I'd be appreciative
1: On the "No More Moves" screen I display a graphic that says "Press any key to continue" and in code I put the 'wait key' command. If the users presses any keyboard key the game goes to the high score screen.
However if the user presses the mouse - it does not progress.
How do I tell it to scan for either a mouse click OR a key press and then continue to the next screen?
2: When read/writing my high score it works perfectly within any one game. It often works perfectly through more than one game. But eventually for unknown reasons the high scores will become 'corrupt' if you will and show improper values.
The minimum score you can make in my game is 60 but in my current highscores.dat file I hvae scores of 2240,980, 54, 49, 50, 48 .
Everything past the 980 is an impossible score.
The code to write the file is here:
If File Exist(Filename$)
Delete File FileName$
Open To Write 1, Filename$
For N = 0 to 10
Write String 1, Str$(HighScore(N))
Next N
Close File 1
Else
Open To Write 1, Filename$
For N = 0 to 10
Write String 1, Str$(HighScore(N))
Next N
Close File 1
ENDIF
I'm writing the score in a string value according to the suggestion in TDK's tutorials so I can see what its actually putting down in this instance quite helpful. But still doesn't tell me what I'm doing wrong or why it only some times gives crazy results.
3. This last one is very difficult and honestly I may not be able to fix it. The problem is during game play while game logic is executing the player can not click ; and this is surely because of the way I programmed the game logic and display logic are very tightly intertwined. In other words - it is intended that you can not click before the previous move is done.
However when the game is DONE drawing the last move you can NOT click on anything for about 3/4 of a second afterwards.
For players that are quick this becomes a source of many perceptive 'missed' moves.
I *CAN* display an hour glass that lets the player known that its not time to move yet however when I do that .. the game gives the perception of 'playing very slowly' because the hour glass stays on a fair bit while game logic is running and moves are being drawn out.
The game play is your basic "Match 3" game so there really is no need to have the player doing another move while the current one is playing out so I'm not concerned that it be liked bejeweled 3 where you can actually start clicking while other gems are still dropping and combining. But I do want to try to fix the fact that you cant click while the game appears to be done with all its work.
One hint that *might* help is that the game appears to take 25% of my CPU no matter what I do to try to optimize. I'm concerned maybe this is due to me making some common mistake that over taxes the CPU and this could be tied into the game taking a little longer to permit the next click than it should? What are some common mistakes people do that over-tax the CPU?
Thanks in advance for any assistance!