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 Discussion / Car problem

Author
Message
doffer
21
Years of Service
User Offline
Joined: 21st Nov 2003
Location:
Posted: 26th May 2005 20:26
Hey.
I've got a little problem with this code.
When my car "box" reaches the top speed spd_max# = 30 then it stops.
I've made it print the speed on the screen andit says i moves by a speed of 30.
Can anyone tell my why it stops when it reaches the top speed?

Denmark Denmark Denmark.
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th May 2005 23:01 Edited at: 26th May 2005 23:03
This may help...



You want to move the car every loop, regardless of whether a key is pressed, and regardless of whether the car has reached top speed. Your code only moved the car when a key was pressed, AND the max/min speed was not reached.

BatVink
doffer
21
Years of Service
User Offline
Joined: 21st Nov 2003
Location:
Posted: 27th May 2005 00:27
Brilliant.
Thanks a lot !

Denmark Denmark Denmark.

Login to post a reply

Server time is: 2025-05-23 08:58:35
Your offset time is: 2025-05-23 08:58:35