Lags during gameplay
Hello
Does anyone else has an issue like me? I have a game where the main actor "flies" up high. The game has 1 000 000 Y and normal X resolution (portrait). Near the main actor is the second actor "spawner" and it spawns actors in front, while actors in back are being destroyed if hero position Y is greater than 800. And after about 2 min on iPhone 4s, iPad 2, Samsung Galaxy S3 the game starts to lag, and then getting worse. I made actor counter (actor spawns increase global variable +1, when destroyed global variable -1) to check if there are unwanted actors behind background or whatever but there isn't any. I'm using 32 bit .png images. When I made them 24 bit there were white backgrounds instead of transparency (ofc). There isn't ANY complex coding included. Not even music yet.
Anyone having any thoughts?
What I did so far:
deleting actors when postion +800 < main.character position Y
switched off "preload art"
decreased the speed of animation actors (enemies)
Edited:
I'm also using around 10 actors on not scrollable layer
to display score. I've changed "contrain" self image to score
to change self image to score whenever the score has changed
Comments
I see an error in your deleting actors rule.
It should say,
When
self.position Y < main.character position Y-800, destroy
@RabidParrot
(x + 6 > y )== (x > y-6)
It's just simple math.
Anyone else has some thoughts?
@MichalCh
Read your equation wrong. My bad.
lags in previewer or on your mobile? the Gamesalad Previewer always lags
@jsorr2
On the devices ofc
up
Are you positive the actors are being destroyed? Run you game on xcode instruments and see if it's a memory issue. I wouldn't be worried trying to support a 4s. Remember Apple's adoption rate is high. But it sounds like a memory issue to me.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@The_Gamesalad_Guru
Yes, I'm. I've checked three times that every actor on the beginning has global.value = global.value +1 and BEFORE destroy behaviour (within rule) global.value = global.value -1
And it is always around 30-40 actors on the scene at every time.
I've made screenshots of Xcode instruments and sent it on the pro support ticket over two weeks ago and since a week there is no answer at all that's why I'm writing here.
Any other thoughts? No one has never lags on their games?
What was the memory usage?
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS