Improve performance for drawing lines
I managed to get things work by following Orbz's tutorials for drawing lines but performance seems to be bad. It works with mouse but once I tried it on my device it slows and always lags behind my finger.
I already tried destroying the segments after 0.1 seconds to create a short trail rather than a long path so I think it isn't about having too many segment actors in the scene. Could it be the calculation for the each segment slowing things down? Any way to improve this? Have you come across a game with smooth performance like Fruit Ninja?
Edit: I tried it on iPod touch 2G and a 3GS. I understand the 2G has some low spec but the 3GS should at least have something more decent right.
I already tried destroying the segments after 0.1 seconds to create a short trail rather than a long path so I think it isn't about having too many segment actors in the scene. Could it be the calculation for the each segment slowing things down? Any way to improve this? Have you come across a game with smooth performance like Fruit Ninja?
Edit: I tried it on iPod touch 2G and a 3GS. I understand the 2G has some low spec but the 3GS should at least have something more decent right.
Comments
Here's a link for the demo: http://gamesalad.com/game/play/79364
You could search for 'drawer orbzample' from the 'New' section in GS and look into the project file.
in your gameSalad New section search for Fruit Ninja...both Toastkitten's and Tshirtbooth's (which uses Orbz's demo) should show up...
open and play with both them... you can change things to you get the effect you want...
in TK's just replace/delete the circle image and make that actor 100W 2H white...
or maybe use constrainAttribute self.Position.X To: touch1.Positin.X (same for the Y coordinate)
or magnitude to maintain the X of line to the X of touch...
keep playing around... and you'll get it completely... and tell the rest of us how to!
MH
Anyone with iPhone 4 or with a newer gen iTouches interested in helping me to test and see if the lines are smooth or it still lags behind the finger?
I wonder why is this happening. Fruit Ninja is in 3D and it runs much much smoother than my 2D slasher. That's just weird. I even optimized my png with ImageOptim and delete unused images and actors.