----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- display.setStatusBar( display.HiddenStatusBar ) local width = display.actualContentWidth local height = display.actualContentHeight local background = display.newRect( width \* 0.5, height \* 0.5, width, height ) local physics = require( "physics" ) physics.start() local line = display.newRect( width \* 0.5, height - 64, width, 128 ) line:setFillColor( 0.1, 0.1, 0.1 ) physics.addBody( line, "static" ) local player = display.newRect( width \* 0.5, height \* 0.5, 64, 64 ) player:setFillColor( 0.93, 0.11, 0.14 ) physics.addBody( player ) player:setLinearVelocity( -100, 0 )
Why doesn’t player move continuously? It stops after two seconds.