Ome
Ome

Reputation: 43

jump object on collision

I am trying to implement a bar that rebounds the object falling on it. however I just want the object to rebound when it falls on it from above the top edge. if the object is comming from bellow the object should pass as if the bar doesnot exsits. This is similar to what the bird does in tweetjump or doodle does in doodle jump. Any hints on how I can do this in corona ?

Upvotes: 3

Views: 185

Answers (1)

SatheeshJM
SatheeshJM

Reputation: 3633

When the object collides with the bar from below, Try giving

bar.isSensor = true

Have a read here: http://developer.anscamobile.com/reference/index/bodyissensor

One use case for setting this property is overriding a collision that is about to happen, such as the "one-sided platform" case, where a character should pass through a platform only in one direction.

Upvotes: 4

Related Questions