Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / The game (Tutorial) get stuck

Author
Message
Renegade
21
Years of Service
User Offline
Joined: 29th Jul 2003
Location: Israel
Posted: 7th Oct 2003 15:47
I have build the Monster hunt game with the tutorial
but instead of writing 'If upkey()=1...' I wrote
'If inkey$="w"'. The problem is that the game get stuck
from time to time it is like I have a gaint lag in the game
How can I fix it?

I added the source of the game.
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 7th Oct 2003 22:15
does it happen when you hold 2 direction buttons at once? that is what happens when you use inkey$() because it only detects if one key is being pressed. also maybe your computer might be a bit slow but this is unlikely


spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 7th Oct 2003 23:04
inkey$ is not ideal for moving buttons, it's ok for simple operations like toggling a map on/off for example.

Look up scancode and keystate in help.

scancode() gives you a number representing which key is currently pressed.

keystate(x) tells you if a specific key is pressed.

So, for you, keystate(17) gives you '0' if 'w' not pressed, and '1' if it is pressed

If your mansion house needs haunting, just call Rentaghost!
Renegade
21
Years of Service
User Offline
Joined: 29th Jul 2003
Location: Israel
Posted: 8th Oct 2003 17:13 Edited at: 8th Oct 2003 17:13
I tried it and it is working good
10X for the help.

Login to post a reply

Server time is: 2024-11-25 11:29:37
Your offset time is: 2024-11-25 11:29:37