I’m sure if I knew lua just a little better I could figure this out myself. Basically I’m at the optimizing stage of my game and currently I have a ton of functions to accomplish this simple task. The task being for every 400 increase in ship.y to display a new image and then for every 400 decrease in ship.y to remove that image. If it helps I’m trying to have a background behind the spaceship flying up and of course a 1440 x 36000 png is to large to keep in memory. [import]uid: 11465 topic_id: 6640 reply_id: 306640[/import]
Sorry for not just editing, that doesnt appear to be working. I have a bonus question lets say I have a variable points = math.ceil(ship.y/10) Now when the ships y begins to decrease so will the points but, I want the points to stay the same and then when yo go back up they begin increasing. [import]uid: 11465 topic_id: 6640 reply_id: 23131[/import]
Figured out bonus [import]uid: 11465 topic_id: 6640 reply_id: 23143[/import]
look at tileEngine.lua in here
http://developer.anscamobile.com/code/joystick
[import]uid: 6645 topic_id: 6640 reply_id: 23149[/import]