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 / A problem with controls

Author
Message
Edgel
18
Years of Service
User Offline
Joined: 5th Jul 2006
Location: U.S.A
Posted: 18th Aug 2006 23:32 Edited at: 18th Aug 2006 23:36
[EDIT]
Sorry I forgot to put this in the subject!! This code is DBPro
[/EDIT]

I'm making a 2d boat driving game. The objective is to go from the start line to the finish dodging obstacles. One of the main points of the game is that the controls are slow reacting and difficult to use. When you press the up arrow, the sprite is supposed to move forward, and go faster. then the sprite slowly moves backward on the screen, maintaining its speed but giving you more vision. The sprite goes a max of halfway up the screen before auto-descending. Already I'm stuck.

doesnt work. Any help would be appretiated, and I'll see if I can make the left and right controls on my own.

Thanks in advance!
Prosaic
18
Years of Service
User Offline
Joined: 5th Aug 2006
Location: Athens
Posted: 18th Aug 2006 23:40
zero your mvlmt variable after it reaches the bottom.
Edgel
18
Years of Service
User Offline
Joined: 5th Jul 2006
Location: U.S.A
Posted: 18th Aug 2006 23:46
thanks Prosaic.

But what happens is the sprite moves up the screen and doesnt stop at the halfway point. It also doesnt go back down the screen.
Prosaic
18
Years of Service
User Offline
Joined: 5th Aug 2006
Location: Athens
Posted: 18th Aug 2006 23:54
so i get that you want it to stay at the bottom after the custom animation?
Prosaic
18
Years of Service
User Offline
Joined: 5th Aug 2006
Location: Athens
Posted: 19th Aug 2006 00:00
try this
Edgel
18
Years of Service
User Offline
Joined: 5th Jul 2006
Location: U.S.A
Posted: 19th Aug 2006 00:47
i tried your code, and the sprite still moves up the screen while you hold the up arrow. It passes the halfway point and keeps going, without dropping back down. Thanks for all your help so far. I'm posting the sprite so you can try out the code to see what I'm trying to tell you.

Attachments

Login to view attachments
Zergei
19
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 19th Aug 2006 07:04
Your problem is that your moving your boat vertically wich means it moves along the "y" axis, however you're checking for it "x" axis, which is horizontal. Also, have in mind that "y" goes from the top of the screen as 0, to the bottom as the screen height().



Further on my stuff at...
Prosaic
18
Years of Service
User Offline
Joined: 5th Aug 2006
Location: Athens
Posted: 19th Aug 2006 13:19
Zergei's right ,thats my mistake.
Edgel
18
Years of Service
User Offline
Joined: 5th Jul 2006
Location: U.S.A
Posted: 19th Aug 2006 16:11
Thanks Zergei and Prosaic!

Login to post a reply

Server time is: 2024-09-25 07:38:10
Your offset time is: 2024-09-25 07:38:10