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 / how i get a sprite jump?

Author
Message
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 26th Sep 2004 08:41
hi
here is the code i use but read my question first!


my queation is: How do i make the sprite jump if i press the spacebar??

The Nerd

i make games, i play games... But the fun thing is that i like to make them more than play them....
Osiris
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 26th Sep 2004 09:28
all you have to do is use the spacekey in the parenthasis and put the x value so it makes the sprite go up however high you want
Osiris
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 26th Sep 2004 09:30 Edited at: 26th Sep 2004 09:46
there is an example
(just click the source button)
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 26th Sep 2004 09:51 Edited at: 26th Sep 2004 09:52
well i dont quite understand can you try make a code example

if inkey$()= "spacekey" then WHAT!!!????

how do i get him jump and then he go down again??

i make games, i play games... But the fun thing is that i like to make them more than play them....
Osiris
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 26th Sep 2004 10:34
oh sry i thought you just wanted the spacekey part do this instead

if inkey$()="spacekey" then sprite x(1) + 5 sprite y(1)
sleep 100
sprite 1 x(5) - 4

that may work lol
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 26th Sep 2004 10:53
thanks

The Nerd

i make games, i play games... But the fun thing is that i like to make them more than play them....
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 26th Sep 2004 10:56 Edited at: 26th Sep 2004 10:59
its the last line somethings wrong whit.

i make games, i play games... But the fun thing is that i like to make them more than play them....
Osiris
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 26th Sep 2004 11:43
yeah i was afaid of that let me c if i can get some gravity code working for you...but the other thing works right?
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 26th Sep 2004 14:23
sprite jump sprt#, height

"eureka" - Archimedes

Login to post a reply

Server time is: 2025-05-25 01:46:31
Your offset time is: 2025-05-25 01:46:31