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.

DarkBASIC Professional Discussion / what Am I doing wrong here? Sprite movement problem

Author
Message
Fang
23
Years of Service
User Offline
Joined: 2nd Jul 2003
Location:
Posted: 30th Aug 2003 05:43
Hi people,

Please assit me on this one...don't know what's going on, an since I can't debug properly(bug in DBP)
The code is supposed to make a grid, load a sprite and when i us the arrow keys, move the sprite ONE square in the direction pressed, but this isn't work...it speeds all the way across the grid....

Thanks in Advance.

Fang


"I really don't know how WWIII will be fought, but WWIV will be with sticks and stones"
- Albert Einstien
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 30th Aug 2003 06:21
From the looks of things, its just that your program is running really quickly, and as you hold the key down it's moving it square by square in quick succession.

Try doing this:



That's not tested, but that should solve it. It should force the player to release the key before it will accept any more key presses.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
Fang
23
Years of Service
User Offline
Joined: 2nd Jul 2003
Location:
Posted: 30th Aug 2003 06:24
Thanks!
I should have thought about it before...using a semaphore...

Thanks!!

"I really don't know how WWIII will be fought, but WWIV will be with sticks and stones"
- Albert Einstien

Login to post a reply

Server time is: 2026-07-25 08:29:33
Your offset time is: 2026-07-25 08:29:33