What im trying to do here is have this (grass, grass2) play (move) none stop, in another words i want to loop them together so it seems like the grass is moving, like if you where walking…
[code]require “sprite”
display.setStatusBar( display.HiddenStatusBar )
local sky = display.newImage( “images/black.png” )
local grass = display.newImage( “images/grass.png” )
grass:setReferencePoint( display.CenterLeftReferencePoint )
grass.y = 0
grass.x = 20
grass.rotation = 90
local grass2 = display.newImage( “images/grass.png” )
grass2:setReferencePoint( display.CenterLeftReferencePoint )
grass2.x = 20
grass2.y = 480
grass2.rotation = 90
local function test()
local tPrevious = system.getTimer()
local function move(event)
local xOffset = ( 0.5 * 5 )
grass.y = grass.y - xOffset
grass2.y = grass2.y - xOffset
if (grass.y + grass.contentWidth) < 0 then
–grass.y = grass.y + 100
grass:translate( 480 * 2, 0)
end
if (grass2.y + grass2.contentWidth) < 0 then
–grass.y = grass.y + 100
grass2:translate( 480 * 2, 0)
end
end
Runtime:addEventListener( “enterFrame”, move );
end
test()[/code] [import]uid: 45615 topic_id: 10079 reply_id: 310079[/import]