所以我在 Lua 中为我的游戏做一个简单的矩形矩形碰撞。我有一个算法用于其他项目来处理这种类型的碰撞,但它在 C++ 中,我知道它有效。问题是它使用矩形的中心。虽然很容易计算我在保持中心时遇到问题,但在精灵移动时处于中心位置。这是我在做什么
--this moves the bounding box of the collision, BUT not the center
self.boundingBox.sprite.tween = transition.to(self.boundingBox.sprite,{ transistion = easing.outExpo, y = arg.y, x=arg.x,time = arg.time,onComplete = function() end});
精灵正在按应有的方式移动,但属性“self.boundingBox.centerY”不是,我不确定处理这种情况的最佳方法是什么。请帮助谢谢