Performance tip when dragging object in game

Hey
I just wanted to share some bit of experience that I stumbled upon in our last game.

In the game we have a small catcher that the player will drag in horisontal movement on the screen. Because it is so small we added the drag event to the Runtime:addEventListener(“touch”, dragObject) and was experiencing really bad performance on all flying objects in the game while dragging this object with this eventlistener.

So we tried to add a dragbox around the object larger than the object itself and changed the eventlistener from Runtime to dragBox:addEventListener(“touch”, dragObject) and the result was amazing and a huge difference.

I just wanted to share this is someone else have this problem.
The game
http://www.catchemgame.com [import]uid: 22737 topic_id: 12080 reply_id: 312080[/import]

I wonder if using setFocus on the small object would have the same effect.
[import]uid: 27183 topic_id: 12080 reply_id: 44039[/import]

Hey Akviby,

Thanks for the tip. I am doing a tutorial, but my script cannot import the gameUI module (I even copied it into my project folder). The error I’m getting is as follows:

Runtime error: …-FFuZbvzvgfh2AU+++TM/-Tmp-/TemporaryItems/6/main.lua:5: module ‘gameUI’ not found:resource (gameUI.lu) does not exist in archive
no field package.preload[‘gameUI’]
no file ‘/var/folders/Jh/JhUdPEC-FFuZbvzvgfh2AU+++TM/-Tmp-/TemporaryItems/6/gameUI.lua’
no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/gameUI.lua’
no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/gameUI.blu’
stack traceback:
[C]: ?
[C]: in function ‘require’
…-FFuZbvzvgfh2AU+++TM/-Tmp-/TemporaryItems/6/main.lua:5: in main chunk

What am i missing?

Thanks. [import]uid: 52069 topic_id: 12080 reply_id: 44157[/import]

Hey lloyd5
Post your question as a new thread on the general support forum please so that more people can read and help you. [import]uid: 22737 topic_id: 12080 reply_id: 44165[/import]

Thanks, will do so next time. The project seemed to work fine when I restarted my machine. [import]uid: 52069 topic_id: 12080 reply_id: 44178[/import]