I just discovered a weird printing issue. When I do:
print(testSprite:getPosition(), testBody:getPosition())
It will give for example: 188, 188, 489.
When I do:
print(testSprite:getPosition())
print(testBody:getPosition())
I will get as expected:
188, 489
188, 489
Why is the first Y value in the first example not printed?
Regards,
Marc
Comments
When we use a call as an expression, Lua keeps only the first result. We get all results only when the call is the last (or the only) expression in a list of expressions
Likes: OZApps
I found another issue why I've got wierd errors and values. For bodies you'll
need to use getPosition() instead of getX() and getY(). Why is that? You can
use getPosition() for sprites and bodies.
Regards,
Marc
But if you've been following Extending Gideros forum thread, then there we've been trying to create abstraction layer for box2d merging concept of sprite and body, where by controlling Sprite you also control body.