PDA

View Full Version : How do you add gravity to a game?



NinjaNumberNine
10-15-2009, 05:55 PM
Hi, I'm in the middle of making BioTux right now and I have the levels mostly made now but Tux the penguin still floats around. Can someone tell me how to add and change gravity please?

Thanks!

:ninja: NinjaNumberNine :ninja:

sirlich
10-15-2009, 09:07 PM
Hi, I'm in the middle of making BioTux right now and I have the levels mostly made now but Tux the penguin still floats around. Can someone tell me how to add and change gravity please?

Thanks!

:ninja: NinjaNumberNine :ninja:

Check the Low-Res example plus this post
http://www.rtsoft.com/forums/showthread.php?t=2589&highlight=Gravity

Searching the Forum may produce other posts on it as well... I've done hundreds of searches is just my short time here. :sweatdrop:

Edit: this one may be useful as well.
http://www.rtsoft.com/forums/showthread.php?t=1682

NinjaNumberNine
10-15-2009, 10:40 PM
Check the Low-Res example plus this post
http://www.rtsoft.com/forums/showthread.php?t=2589&highlight=Gravity

Searching the Forum may produce other posts on it as well... I've done hundreds of searches is just my short time here. :sweatdrop:

Edit: this one may be useful as well.
http://www.rtsoft.com/forums/showthread.php?t=2589&highlight=Gravity
The two links are the same ones. Also I had already read that thread...

Where would I put the lines? I'm just not sure which file to use or if I need to create a new one. Also can you put a different color or maybe a tile background instead of the default dark blue screen behind everything? Tiling lots of images takes a lot of resources. :rolleyes:
Thanks!

sirlich
10-16-2009, 12:18 AM
---oops.. copied the wrong link... fixed. the Gravity settings are on the Map "Properties" in the Novashell editor... ("Options" -----> "Map Properties") Seth uses a Gravity of 10 on his LowRes Platformer example.
You might also note the BG Color setting there... to adjust the background color.

I haven't messed with the gravity much myself but hopefully that'll get you started anyway.

Also... read up on "Parallax"... I'm not that familiar with it but read enough about it to know that it would probably be something you're interested in for a side-scroller background.

NinjaNumberNine
10-16-2009, 01:46 AM
That's what I wanted. Right on!

By the way how many members are there in this forums? Seth replied three times and you twice to two of my posts- that must mean there aren't many posts! :crazy:
No offense meant, I guess its good to have less members in a forum; that means the administrator (Seth) can answer most of the stuff, and it also means that if there are less members, there must be very few problems. :)
Anyway thanks Sir Lich! :)

NinjaNumberNine
10-16-2009, 03:11 PM
Now when I set the gravity , Tux "floats" down very slowly and when I press up, away he sails... I have experimented with all the gravity numbers I thought plausible. How can I make him "bounce" like in LowRes Platformer? :confused:

sirlich
10-16-2009, 03:41 PM
Now when I set the gravity , Tux "floats" down very slowly and when I press up, away he sails... I have experimented with all the gravity numbers I thought plausible. How can I make him "bounce" like in LowRes Platformer? :confused:

Maybe try checking out "m_JumpPower =" in the Low res player.lua file...?
I don't think it's necessarily a "glitch", just more involved than you might suspect.

As for the forums... dunno... maybe most of the bugs are worked out and now most ppl just use the current posts (which date back quite some time from what I've seen) without loggin in to search for solutions. Seth has been pretty good about still reading and helping though.

NinjaNumberNine
10-16-2009, 04:19 PM
Maybe try checking out "m_JumpPower =" in the Low res player.lua file...?
I don't think it's necessarily a "glitch", just more involved than you might suspect.

As for the forums... dunno... maybe most of the bugs are worked out and now most ppl just use the current posts (which date back quite some time from what I've seen) without loggin in to search for solutions. Seth has been pretty good about still reading and helping though.

Yeah, Seth has been real good. And he's t he one that gave us this great product free too! :crazy:

Where would I put the "m_JumpPower =" in my player.lua? I am assuming that anywhere will do, just press enter and put an


end
after it?