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.

Dark GDK / Make a sprite Jump! Help

Author
Message
Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 21st Dec 2011 11:08
I really want my sprite to jump, but i just can't i have tried all kind of methods but i just can't if someone would come up with a code that would be nice.

Beginner In the Language.
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 21st Dec 2011 16:32
well i tried one months ago that basicly was:

bool Jump = false;
int Jumph = 15;
int PlayerY = dbSpriteY(PlayerID);

Then in the loop:

If Space bar is pressed
PlayerY += Jumph;
Jump = true;


If(Jump)
{
//decrease PlayerY by Jumph with time..
}


I used this on allegro.

You can learn this from here:
http://www.youtube.com/watch?v=u-uGLB-sqEU

C++ Medium 3.5/5
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 21st Dec 2011 16:55
I can't get it to work it just stand still.


Beginner In the Language.
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 21st Dec 2011 17:47
dont use my code, is not right..

Follow the video and adapt it to darkgdk, is not hard.

C++ Medium 3.5/5
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 21st Dec 2011 18:03
I quite understand it now, but i can't find the command rectfill, do you know a command that looks like it?

Beginner In the Language.
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 21st Dec 2011 18:37
yes xD
rectfill on allegro is making a rectangle filled with a color. That's just the player in that tutorials.

So for darkgdk the rectfill function is more dbSprite xD

C++ Medium 3.5/5
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 21st Dec 2011 20:06
But the dbMoveSprite command can't fill the needs for this method what can i do

Beginner In the Language.
Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 21st Dec 2011 20:30
i finally got it to work... Thanks Vitinho444


Beginner In the Language.
Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 21st Dec 2011 22:24
Thanks Vitinho444 That did it, to all the others that came across this problem


Beginner In the Language.
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 22nd Dec 2011 10:45
Happy to hear that you got it working

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
drkylec
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: United States
Posted: 22nd Dec 2011 21:16
This was really helpful thanks to both vitinho444 and Blackout1471
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 22nd Dec 2011 22:31
np

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)

Login to post a reply

Server time is: 2024-04-26 08:13:46
Your offset time is: 2024-04-26 08:13:46