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 / i cant jump in 2d game help plzzzzzzzzzzzzz

Author
Message
hwoarang
12
Years of Service
User Offline
Joined: 19th May 2012
Location:
Posted: 19th May 2012 08:54
hi, I just started learning gdk about 2 days ago. so far i can move my character forward and backwards. But i dont now how to make him jump.
here is my code for forward and backwards. plz help me out with jump. remember i just start 2 days ago so i cant understant hard code like classess, functions... etc. i want to keep it really basic. i want t use dbUpKey() function.


Eccentric Developer
12
Years of Service
User Offline
Joined: 2nd Jun 2012
Location:
Posted: 3rd Jun 2012 06:04
Quote: "i cant understant hard code like classess, functions... etc. i want to keep it really basic."

Sorry, but you WILL need to learn these things. These are the fundamentals of C++: You can't do much of anything without them. I recommend doing some reading on C++ before attempting something as relatively complex as gravitational forces. I reccomend anything from the "Sam's Teach Yourself..." line of books: I started out with them, so I highly commend them.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th Jun 2012 17:51 Edited at: 4th Jun 2012 17:52
You shouldn't be affecting the sprite's positions directly like that. It's inefficient to position, rotate, move, rotate your sprite if the same can be achieved through maths. For example, this could move the sprite left and right:



This could make him jump:



Very basic code, but I think understanding the concept is the first step before you start structuring it correctly, i.e. using an player class.

TheComet

DeadTomGC
14
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 10th Jun 2012 08:37
Quote: "Sorry, but you WILL need to learn these things."


Ha! nonsense.... I made plenty of decent games without that knowledge! OOP didn't always exist, there are ways around just about everything...


Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 11th Jun 2012 00:04 Edited at: 11th Jun 2012 00:05
I also think that you have to start with something. Even if not grasping OOP completely.


Intel Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP2, PureBasic 4.61 + DarkGDK 2.0
bkbatman
14
Years of Service
User Offline
Joined: 6th Sep 2010
Location:
Posted: 30th Jun 2012 23:55
Can someone please tell me why is my program screen just black.
After all I loaded a background but nothing seem to be showing up on it. What's the problem.




the legendary master
prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 1st Jul 2012 04:05
You've put "Init()" inside the main game loop, it will keep creating the DirectX device and trying to load an image (everything in Init() at 60fps). Put Init(); outside of the main While(LoopGDK()) section


Login to post a reply

Server time is: 2024-11-19 00:33:59
Your offset time is: 2024-11-19 00:33:59