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 / how do i change the speed of a ball by pressing a hotkey

Author
Message
Ants95
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 25th Jul 2009 05:45
i made a pong game thingy and i want it so when i push 1 it makes the ball go .10 then 2 makes the ball go .20 and so on.

Can some one please explain how i can do this? any help would be nice, thanx

-Ants95
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 25th Jul 2009 10:58
The KEYSTATE() for numbers 1 to 0 are numbers 2 to 11. You can use a FOR/NEXT loop to check for those keys since they are sequentially ordered.



KEYSTATE works for the entire keyboard so if you want to see what numbers each key uses without using SCANCODE to find the number use this graphic:

http://mysite.verizon.net/grueslayer/Keystate.png

Ants95
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 25th Jul 2009 22:07 Edited at: 25th Jul 2009 22:22
ok now that i now that how do i insert that into my code so it works with the game

this is the code so far and i need to insert that code so it will work cus is i just paste it in there it messes it up so do you know what i need to change so it matches up

[edit] in the next post

-Ants95
Ants95
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 25th Jul 2009 22:12 Edited at: 25th Jul 2009 22:28
I was wondering how do i make it so i can insert that into the game here is the code i had and i was wondering if you could tell me how to make that code work in the game



-Ants95
Ants95
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 26th Jul 2009 00:17


ok i tried that and it runs and the print ball speed works but when i push the nubers it does not actully change the speen of the ball.

-Ants95

Login to post a reply

Server time is: 2024-09-28 08:23:30
Your offset time is: 2024-09-28 08:23:30