Hi guys,
Pretty much what the title says. I've run it through Xcode via USB and also from the Gideros Player targeting the phone over Wi-Fi but it's very, very slow. Will try on Android next and update the thread. It's a simple 2D endless runner so wouldn't have thought it too taxing.
Oh, I almost forgot, I added: print ("memory used 1:"..collectgarbage("count"))
I don't seem to have any leaks. Using between 500 and 700... uh, MB?
Comments
It is hard to tell why it can be slow without knowing how you manage your assets. Can you tell us more ?
I'm using SceneManager and separate *.lua files for scenery animation etc... You raise a good point though, I don't have any loading classes but my textures aren't really that big. Though I do need to learn how to do loading screens at some point.
https://deluxepixel.com
You are also calling functions like GameScene:updateScore() from inside the GameScene class. Those calls should be like self:updateScore()
When you create global tables and stuff like ALL_OBJECTS you should make references to them either in the class (self.allObstacles = ALL_OBSTACLES), or create local references to them when you are going to access them. You did this in the first few lines with local player = PLAYER which IMHO is the way to do it, or at least that's how I do it heheh
Look at your different variables and see what might be better suited elsewhere. An example is LIVES. This would most likely be better as a variable inside the player class (player.lives)
I hope I have been of some help :ar!
The reason I ask is that the transition between my bare bones WelcomeScene and AboutScene is a little laggy too. Perhaps I have something in my main.lua or config.lua that's causing issues as well.
Maybe I'm also doing some weird scaling thing too with the resolution... My player character's jump looks like it has tripled on devices and the Xcode simulator. Could be my resolution settings/project settings are out of whack and everything's getting redrawn?
Stuff like this is probably trouble:
In my WelcomeScene:
I had updated Gideros to the latest version and I just tried to revert to much earlier build of my game, which was on a different branch so I set up a new test project. When I went to project settings I added the name and set up the resolution etc...
Anyway, I reverted back to the current build and noticed there was no name in the project settings and uhm... FPS set to 30... Changed it to 60 and the game is smooth as silk, on device, just as per the Gideros Player.
/facepalm
Learned a few things though, so thanks for your help guys.
(and no weird co-ord issues with jumping either...)
Likes: SinisterSoft
https://deluxepixel.com
eg, x=x+(30*step) -- step being normally 1, but can be bigger/smaller if not 60hz.
https://deluxepixel.com