well… i have turtle that is a movieclip
[code]
myAnim = movieclip.newAnim( { “tartaruga_1.png”, “tartaruga_2.png”, “tartaruga_3.png”, “tartaruga_4.png”, “tartaruga_5.png”}, 67,43 )
myAnim.x, myAnim.y = 50, 30
myAnim.type = “tartaruga2”
myAnim.isFixedRotation = true
myAnim.angularVelocity = 0
gameGroup:insert( myAnim )
local tartarugaShape = { -25,-18, 30,-18, 30,18, -25,18 }
physics.addBody ( myAnim, {density = 1.0 , friction = -100 , bounce = 0.2, shape = tartarugaShape } )
myAnim:play()
local temporizador_tartaruga
local acao_tartaruga
local colideMove
local acao_tartaruga = function(e)
if jogoAtivado == true then
myAnim:setLinearVelocity( 100, 0 )
end
end
temporizador_tartaruga = timer.performWithDelay( 200, acao_tartaruga, 0 ) [/code]
and i have a fill problens with gravity or rotation when her moves… i have add a little square to check if the turtle are with the backs down or not:
http://imageshack.us/photo/my-images/846/capturadetela20110627s1.png/
but… i dont have sucess:
http://imageshack.us/photo/my-images/221/capturadetela20110627s1.png/
http://imageshack.us/photo/my-images/192/capturadetela20110627s1.png/
this is my code for square:
[code] local sensorTop = display.newRect( 45, 8, 10, 10 )
gameGroup:insert( sensorTop )
physics.addBody( sensorTop, { isSensor = true } )
mexeSensorTop = function()
sensorTop.x = myAnim.x
sensorTop.y = myAnim.y - 18
sensorTop.rotation = myAnim.rotate
end
Runtime:addEventListener( “enterFrame”, mexeSensorTop ) [/code]
dont know how can I just freeze the square in there position… in Top of turtle’s backs [import]uid: 23063 topic_id: 11737 reply_id: 311737[/import]