Need help with my game - CocoonJS

Discuss game development design and post your game ideas

Post » Sun Apr 06, 2014 11:18 am

Hi,

I have a problem i cannot fix :( I have some micro laggs in my game. I have identify the problem with the wall creation (i guess ).

Please test this to see it on your own: https://play.google.com/store/apps/deta ... se.levicat

Every time the cat passes the obstacle a new one will be created out of the game and the passed will be destroyed if they reach x = -100 px.
But nearly ever when a new obstacle was created i got a "micro lagg" :(

Image

I also tried these tips.
https://www.scirra.com/tutorials/298/pe ... bile-games

Still the same issue.

Some information:
  • Compiled with CocoonJS (Canvas+, 2.0.0-bate, same with 1.4.7)
  • Tested without any other objects, just the cat and the walls (same isseu)
  • FPS 60-63
  • Active objecs about 30-45

Can anybody help me? Or have anybody a better way to handle the wall creation?
Big thanks to you all looking into that :)
Image Image iTunes: Match3 | Google Play: Match3
B
100
S
35
G
30
Posts: 1,137
Reputation: 28,087

Post » Sun Apr 20, 2014 12:28 pm

Instead of destroying the one off screen and creating a new one, try just moving the off screen one instead. Of course you'll need to keep track of which one is next available for moving but an array should work for that purpose. Could remove the creation delay...

In fact, that's just inspired me to see if I can do that to my work in progress as well!
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,230
Reputation: 44,892

Post » Sun Apr 20, 2014 1:09 pm

Thanks Colludium,
That's a great idea :)
Image Image iTunes: Match3 | Google Play: Match3
B
100
S
35
G
30
Posts: 1,137
Reputation: 28,087

Post » Mon Apr 21, 2014 1:10 am

OK, I just spent ages implementing a plan B to spawn all instances at the start of the layout and - I can't tell the difference (in chrome and cocoonjs)! So, back to plan A because it's easier to manage.

It feels like there is a small spawning burden but it is only really noticeable when spawning more than one object. I try and avoid that sort of thing anyway and that's probably why I can't see an improvement (it was running pretty smoothly before). Science project over, back to actually trying to 'develop'....
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,230
Reputation: 44,892


Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: No registered users and 0 guests