Look at the flight simulator code, they have it so when a plane lands down a certain air strip, it disappears.
You could change that so when you character moves across a certain part in the screen, you turn your propeller.
have a look at this code for making something spin, like a propeller.
[code]
– WINDMILL
local physics = require(“physics”)
physics.start()
physics.setDrawMode( “hybrid” ) – normal, hybrid, debug
local anchor = display.newCircle( 0,0,5 )
anchor.alpha = .1
physics.addBody( anchor, “static”, { friction=0, bounce=0, density=0 } )
local hub = display.newCircle( display.contentCenterX, display.contentCenterY, 40 )
physics.addBody( hub, “dynamic”, { friction=1, bounce=.1, density=3, radius=40 } )
hub.fixture = physics.newJoint( “pivot”, anchor, hub, hub.x, hub.y )
local tap = function( event )
local ball = display.newCircle( event.x, event.y, 20 )
physics.addBody( ball, “dynamic”, { friction=1, bounce=.1, density=1, radius=20 } )
function ball:timer( event )
if (ball.y > 1500) then
timer.cancel( ball.t )
ball.t = nil
ball:removeSelf()
end
end
ball.t = timer.performWithDelay( 10000, ball, 3 )
end
local addarm = function( hub, rot )
local arm = display.newRect( 0, 0, 20, 100 )
arm.x, arm.y = display.contentCenterX, display.contentCenterY - 80
physics.addBody( arm, “dynamic”, { friction=1, bounce=.1, density=1 } )
arm.connect = physics.newJoint( “weld”, hub, arm, hub.x, hub.y )
hub.rotation = hub.rotation + rot
end
for i=1, 4 do
addarm( hub, 90 )
end
hub.fixture.isMotorEnabled = true
hub.fixture.motorSpeed = 20
hub.fixture.maxMotorTorque = 40
Runtime:addEventListener( “tap”, tap )
[/code] [import]uid: 68741 topic_id: 13872 reply_id: 50969[/import]