Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jump object on collision

Tags:

lua

coronasdk

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 ?

like image 226
Ome Avatar asked Mar 04 '26 16:03

Ome


1 Answers

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.

like image 153
SatheeshJM Avatar answered Mar 07 '26 10:03

SatheeshJM



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!