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 / Need help limiting movement

Author
Message
May0naise
16
Years of Service
User Offline
Joined: 16th Nov 2008
Location: Lost in Time
Posted: 9th Jan 2009 02:36
Well im making a pong game, im trying not to use the tutorials too much, but when it came to limiting movement I had to look. I tried changing the "z" value to something like p1pos# , and then in the if upkey()=1 and p1pos#>-10: move sprite 1,10 ...something like that, but it doesn't want to work for me =\ Can anyone help?


One other question, how can i set my background in the main menu back to the original, because ever since i loaded the paddle it changed to a picture of the paddle.

Thanks in advance.

Media is attached..

Be patient....everything takes time.

Attachments

Login to view attachments
May0naise
16
Years of Service
User Offline
Joined: 16th Nov 2008
Location: Lost in Time
Posted: 9th Jan 2009 18:36
I'd really like some help...=\

Be patient....everything takes time.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 9th Jan 2009 19:23 Edited at: 9th Jan 2009 19:28
well, there's no reason your method of limiting the z movement of the paddles shouldn't work, if done correctly; a check within the if statement is appropriate:


you didn't show this functionality attempted in the code provided, so we can't know what you might have done wrong.

and,

make sure you use the correct parameters for commands. ie, if you're using 3D coordinates, make sure you use floats.
your player 1 controls should be (assuming you still want it to move twice as fast as player 2...):

MOVE OBJECT 10,1.0
...
MOVE OBJECT 10,-1.0

plus,

i dunno where you got the...
Quote: "move sprite 1,10"

part mentioned in your post, unless that was a typo, but you've got no sprites in your app. just making sure you realize that.

as far as the background changing, as soon as you load the paddle model, it's gonna show it. look at using hide object when you're at the menu screen, then show object when in "play" mode.

by the way, your controls seem upside down. ie, W and UpKey should move their paddles up, S & DownKey = down. but, it's your game, so...

try the suggestions offered and come back if you're still having trouble. good luck!

Virtual Nomad @ California, USA
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
May0naise
16
Years of Service
User Offline
Joined: 16th Nov 2008
Location: Lost in Time
Posted: 9th Jan 2009 19:31
Alright, thanks a lot..
Yeah alot of this was when i was experimenting with all of the move speeds and stuff. I still had a lot of typos, and i i forgot to save the updated version.

Thanks again =)

Be patient....everything takes time.

Login to post a reply

Server time is: 2024-11-24 14:44:30
Your offset time is: 2024-11-24 14:44:30