jump object on collision

两盒软妹~` 提交于 2019-12-10 19:18:13

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/10685369/jump-object-on-collision

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!