Gameplay degrades on iOS

Hello there, my name is Rev and I'm a teacher. I've been working on a game for my students. It's a lot like old old megaman, meaning a running jumping shooting platformer. So far everything has worked great, except now that I'm testing on my iOS device there are stark differences between what is on my computer screen, and what is on my phone's screen.
For starters, my shoot button is set up like this:
I have a boolean attribute that is called "shoot go" which is set to 0 unless my shoot button is pressed.
The shoot button has a timer in it, and every 0 seconds it looks for touch to be pressed, when that happens it changes attribute "shoot go" to 1. Otherwise change attribute "shoot go" to 0.
My player actor then has a timer, also set to 0 seconds, in which is a rule: when attribute "shoot go" is true, spawn actor "laser" and it's set to spawn 19 (x axis) pixels away from the center of the player (so it lines up with the artwork.)
The laser actor then has two rules. First is "Move" direction is 2 (to combat gravity) speed is 1000, move type is additive. The second rule is a timer, which after 2 seconds destroys the actor (so it doesn't fly forever.)
(disclaimer: I know change attribute self motion linear x to 1000 would be better for the lasers, but then they fall because of the gravity in the scene, which is 1000. This way they arc.)
What this amounts to is when I press the shoot button on the computer my little robot produces a steady stream of laser fire. On the iOS device though something changes, and the lasers do not fire in a steady stream. When holding the button, the lasers seem to spread out and just sit an equal distances from each other. What this seems like is a frame rate issue, because the lasers are still being spawned, and they are still traveling, but they are only displaying and interacting where they are visible on screen.
Essentially, I could have my player actor standing in front of a monster, and I press the fire button, and the lasers spawn and fly, but the monster isn't destroyed (like he would have been on the computer, with the steady stream,) because the laser actors are sitting in a locked pattern. The stream, while being fired, has gaps.
I'm not sure if this is making sense. I hope it does. I am really stumped here.
For starters, my shoot button is set up like this:
I have a boolean attribute that is called "shoot go" which is set to 0 unless my shoot button is pressed.
The shoot button has a timer in it, and every 0 seconds it looks for touch to be pressed, when that happens it changes attribute "shoot go" to 1. Otherwise change attribute "shoot go" to 0.
My player actor then has a timer, also set to 0 seconds, in which is a rule: when attribute "shoot go" is true, spawn actor "laser" and it's set to spawn 19 (x axis) pixels away from the center of the player (so it lines up with the artwork.)
The laser actor then has two rules. First is "Move" direction is 2 (to combat gravity) speed is 1000, move type is additive. The second rule is a timer, which after 2 seconds destroys the actor (so it doesn't fly forever.)
(disclaimer: I know change attribute self motion linear x to 1000 would be better for the lasers, but then they fall because of the gravity in the scene, which is 1000. This way they arc.)
What this amounts to is when I press the shoot button on the computer my little robot produces a steady stream of laser fire. On the iOS device though something changes, and the lasers do not fire in a steady stream. When holding the button, the lasers seem to spread out and just sit an equal distances from each other. What this seems like is a frame rate issue, because the lasers are still being spawned, and they are still traveling, but they are only displaying and interacting where they are visible on screen.
Essentially, I could have my player actor standing in front of a monster, and I press the fire button, and the lasers spawn and fly, but the monster isn't destroyed (like he would have been on the computer, with the steady stream,) because the laser actors are sitting in a locked pattern. The stream, while being fired, has gaps.
I'm not sure if this is making sense. I hope it does. I am really stumped here.
Answers
Asymptoteell
When touch is pressed Change attribute to 1
Otherwise
Change attribute to 0
If you have many of those timer constantly running like that its gonna kill performance. you definitely should not have any issues with making that type of game so I would say you just have some major optimization to do.
Definitely Do the accel down on only the actors you need to be affected by gravity and shut scene gravity off.
Make sure your constrains cannot do with a change attribute instead.
Also make sure your art is only as big as it needs to be. If you have art files larger than needed for the actor size you may be pushing your art into a memory container higher than what is needed. Using more memory than needed is never a good thing.
Hope it works out for ya.
Cheers
Aaron
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
My player has a health bar, and I want it to have a maximum of 10 "HP." I've made it so that things that award HP only do so when the attribute game.HP < 10, but for some reason if the player does something that awards HP it doesn't add health, but makes the player immortal. Definitely no the desired result. Any ideas? Thanks again!