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 / 2d game start to finish

Author
Message
Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 11th Mar 2011 03:42
I really need help mainly for gravity but when i just copy a code that some one has it dosent work and there are really no good gravity tutorial out there i really need some help! I want to create my own 2d platform game but you NEED gravity so i really need to figure this out. when every i ask this people just give me the formula okay thats okay but they can at least make an example and explain every thing to me like i was a 1st grader just plz help me i been looking for a really good gravity tutorial for the longest time every one has videos but nobody can teach how to do it so yea

Thank you in advanced
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 11th Mar 2011 04:17
I've noticed some people explain it using maths.

I think I've got this almost right. With your own collision checking this should work. I've explained it in almost english (fingers crossed).



Warning! May contain Nuts!
Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 11th Mar 2011 04:29 Edited at: 11th Mar 2011 04:44
I will try this but im getting tired so im might look at this tommorrow im sure i will have questions but you should check tommorrow just in case thank you

i was just looking at this right now um where it says

should it look like this

thats all the questions i got now
Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 11th Mar 2011 05:01
here i have a some what diffrent way of learning how about i give you the code that im going off and you can edit it i usally learn from looking changing it around then learning that way

here is the code

btw i learned this off of youtube but his last tutorial was kind of confusing so this would help thank you
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 11th Mar 2011 16:08
I was only writing it as I would before I do the main code. Something like I do here:

if object hits floor
stop falling

The actual code to the above would be a lot more but the reference helps you write the main code and help keep you on track.

I usually have multiple tabs open on Visual Studio Express. Sometimes I type a piece up like that, then write the actual code using that as a reference.

Before these days I'd write stuff like that on paper then code it in.

Warning! May contain Nuts!
Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 12th Mar 2011 00:16 Edited at: 12th Mar 2011 00:30
okay i figured out how to fall now but i just have to figure out how i just push the jump button once and i go up not hold.
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 12th Mar 2011 01:58 Edited at: 12th Mar 2011 01:59
Good news that you're getting there...

If you start your jumping with a positive number (ie 5) and let gravity decrease the jump value so the jump curve eventually starts to fall.

If the fire button is pressed then the jump flag is set. Pressing the fire again won't activate another jump while the jump flag is set.

Warning! May contain Nuts!
DeadTomGC
14
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 12th Mar 2011 04:22
Hey, check out my demo code right here:

http://forum.thegamecreators.com/?m=forum_view&t=182549&b=22

It is the 11th post.

I'll get a new signature someday.
Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 12th Mar 2011 17:48
I GOT IT!!!

Thank you to the both of you, you both really helped me out i cant thank you enough
Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 22nd Mar 2011 05:50
Can you please explain your collision system i dont understand it

Login to post a reply

Server time is: 2024-11-19 12:46:57
Your offset time is: 2024-11-19 12:46:57