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 AppGameKit Corner / Thrust and gravity on a 2d sprite

Author
Message
Boomgate
6
Years of Service
User Offline
Joined: 15th Feb 2018
Location:
Posted: 6th Dec 2018 10:26
Hi guys, I am looking for a working template where gravity and thrust are applied to a sprite. I have tried tacking together bits from the tutorial and always come unstuck in various way... I cannot make thrust and gravity look realistic..

Imagine a space ship with thrusters.... when you press the up button, it should go up.... when you stop thrusting it should slow down until it stops and then fall back down...

I think I have the hang of collisions etc, but this part is doing my head in...

Has anyone seen any templates where this is demonstrated?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 6th Dec 2018 23:22 Edited at: 6th Dec 2018 23:25
Boomgate
6
Years of Service
User Offline
Joined: 15th Feb 2018
Location:
Posted: 9th Dec 2018 06:17
Thanks Blink0k. Ill check it out.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd Feb 2019 21:27
Thrust and gravity is just mathematical it is best to use the built in commands but sometimes
theres a need to avoid that my lunar lander code is an example without physics not so sure
how well you can follow the code but here it is




dont worry about the memblock code in there as the program uses colors for collision detection just know thats what the getpixelcolor is all about
if you get stuck the thread is here https://forum.thegamecreators.com/thread/222027?page=2 with allot of other examples most are just
copy paste and run good luck I wish you well with your projects
fubar

Login to post a reply

Server time is: 2024-04-25 21:51:55
Your offset time is: 2024-04-25 21:51:55