Floating Effect - HELP!

Just try this. You’ll learn from it:

main.lua  
--------  
  
local myImage = display.newImage("image.png", 0,0)  
  
local function frameLoop(event)  
  
 myImage.x = 200+math.sin(event.time/197)\*100  
 myImage.y = 100+math.sin(event.time/117)\*50  
  
end -- frameLoop  
  
Runtime:addEventListener("enterFrame", frameLoop)  

Let me know how that works for you. Not only is this code much cleaner and simpler, but it is also a lot more flexible. Writing enterFrame events is essential to good game coding so do read up on that, I would advise. [import]uid: 70134 topic_id: 17473 reply_id: 67132[/import]