★ TouchArcade needs your help. Click here to support us on Patreon.

Question About Game Physics And Falling Object

09-25-2011, 08:21 AM
#1
Joined: Sep 2011
Location: London
Posts: 27
Question About Game Physics And Falling Object

Hi

I am new to developing games and I am looking at developing with the Corona SDK. I have a quick question that I hope someone could answer for me.

I would like to develop a game similar to PaperToss where an object is thrown from the bottom of the screen to the top and then falling is simulated. If I have an object half way up the screen and its set as a physics object with a body, how could I set it so that collisions only occur when the item thrown is falling and not on the way up?

Hope that makes sense.

Thanks

Oliver
09-25-2011, 10:21 AM
#2
If I was doing a game like this I would run the physics in 3D to make it so the object bounces off things realistically when it misses etc. If it was a fairground hoopla game for example 3D physics would look infinitely better than hacking in miss animations and make it seem fairer (that is an oxymoron for fairground game though!)

The graphics don't have to be rendered in 3D though, as long as the positioning of the 2D images representing the 3D world from a fixed angle match the view projection. You will just have to manually z-sort the sprite draw order based on the depth in the physics world (so the object goes behind the basket or whatever).

Having said all that though if it's really simple and you don't care about physics realism you could probably just get away with only enabling 2D collisions when the object's movement delta in the Y-axis is positive (i.e. moving down the screen).

Apps: Lead Wars (TA Thread) | Super Grav (TA Thread)
DemonStudios Ltd | Indie Game Dev
www.demonstudios.com
Follow: Facebook | Twitter
09-25-2011, 12:30 PM
#3
Joined: Sep 2011
Location: London
Posts: 27
Thanks for the advice DemonJim, I am pretty new to game development so I think to begin with I want to keep it as simple as possible. I will look at only enabling the collisions on the Y axis as you say.

Thanks again

Oliver