Hi,
say I have a floor in my world, so that my balls can bounce off it and off my stage (out of the side)
what happens to my sprite/body?
at the moment i have a BallActor class and this contains my sprite. the sprite also has a reference back to the actor so that i can access it during collisions
eg
[lua]obj = new BallActor()
print(obj.sprite) – will return a table reference to the sprite created in the BallActor class
obj.sprite.actor = obj – set reference back to actor
physics.addBody(obj.sprite)
local function onCollision( event )
local obj1 = event.object – ie my sprite
local actor = obj1.actor
…
end[/lua]
depending what Corona does with my sprite/body when it leaves the stage will affect what I can do with my actor (eg does my sprite reference still exist or has Corona removed it when it left the stage bounds etc)
thanks
j
[import]uid: 6645 topic_id: 3453 reply_id: 303453[/import]