Ongoing Issue, help!?!?!?

Get help using Construct 2

Post » Tue Jul 28, 2015 2:17 am

Hi guys, I have an issue with my game that no one can seem to find the solution to. I have made several posts on the forum as to my game having lag. I have altered the game more times than I can count and have even had other people look at the game and make alterations but every time I still end up with the same issue.

Now I have no idea anymore whether it is down to the coding or that Android phones struggle to operate games exported through intel XDK and CocoonJS, either way I am completely stuck as to what to do and am turning to you for guidance.

This isn't the first game it has happened to. I'll briefly explain the issue....

The game consists of a player and several enemies. Whenever the enemies collide with the player they are destroyed. When the enemies are destroyed there seems to be a lag for a moment and no one has any idea as to why. We have tried and altered everything yet the problem continues.

I would be more than happy to send a copy of the game to you to have a look at through PM. Please post below if you feel you can help. THANK YOU VERY MUCH!!!
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Tue Jul 28, 2015 10:50 am

This might be it:

When global variable Score is bigger than global variable Highscore, you are setting the webstorage "highscore" to score, but you are not changing the global variable highscore and as such this condition is true every tick and calls to the webstorage are executed every tick..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jul 28, 2015 12:10 pm

Great. Thank you for pointing that out!
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Tue Jul 28, 2015 7:44 pm

I figured it out! It was due to the size of the Score Text (being very large).

*ADVICE*
I would advice anyone who is planning to on making an android game that involves changing text e.g. a score, don't use the Text object. Instead use the SpriteFont object which will should stop lagging if anyone is suffering from the same problem. I found out that text is not well handled on Android phones where as Sprites work much better.

I used the font generator to customize my own SpriteFont and choose a font that I wanted to use. Its really straightforward. Follow the link below. Good Luck!

sprite-font-generator-v2_t86546
B
8
S
2
Posts: 146
Reputation: 1,132


Return to How do I....?

Who is online

Users browsing this forum: matriax and 6 guests

cron