Ok, so with work now fully under way on AppGameKit V2 which should attract a few new users, and my feeling the need for a break from the code heavy AI of my main game, I decided to try bashing out a simple scrolling Mega Jump style platform routine, and offer it up here as a free starting point/tutorial for people. So, attached is Platform Run in it\'s first extremely basic form, but the groundwork is here. Anyone is free to take this and do as they see fit with it, however please be aware that the asset for the running sprite and the platform tiles are from Google - they should be royalty free but if you use them it\'s on your own head. The rest of the backgrounds and water are all my own work, again you\'re free to use them if you wish.
So, what does this do? Right now, it reads the level data in and runs sideways. Tapping the screen causes the sprite to jump, and the idea is not to fall out the bottom. Quick features list:
*Level is 100 blocks long, however the engine is extremely efficient and can handle unlimited lengths - could easily be adapted to create a self generating \"infinite mode\"
*Tile blocks are created and deleted in real time and only as needed, so only the barest minimum of sprites are ever being handled
*The speed of everything can be completely controlled with two variables - speed up power-ups can be added very very easily due to this
*The level has 5 data flags reserved for now - later tiles can have effects (speed up, slow mo, die etc)
*The background uses the graphics and parallax from my flappy clone - this offers 5 layers but still runs at 60fps on decent devices. I may later used the 3d perspective mode for the water and sky from flappy, will see.
*Simple design features mean that levels can be created by simply dropping new assets into numbered folders
What I intend to add:
*A simple editor mode to build levels
*Linked tile sets so that platform edges etc are automatically done
*Code to handle multiple levels
*Dieing through spikes etc - or any flagged obstacle
*Level data that uses flags so tiles can have effects( speed up, bounce high etc)
*Optional Rayman style foreground layer
*vertical overlay (the bottom row of the screen currently is reserved for GUI)
*On screen jump button
If there\'s interest I might also add vertical movement so that maps can be built that extend beyond the height of the screen. At the moment this is about 6 hours work, so it is rough and some of it is copy and pasted from another project, but I\'ll tidy it up and comment it properly over the next week or so.
As I said, feel free to do with it as you wish, and modify it as you see fit. If someone makes some decent changes, feel free to tag them into this post, the point is to give new people a starting point on how to do some basic stuff.
Enjoy.
[img]
[/img]
EDIT: I redid the code with some decent commenting now, and also made some quick optimizations to some of the code, specifically the collision detection so it should been a bit faster on slow devices now. New ZIP file uploaded.
EDIT 22/07/2014
New version uploaded today, see post below.
EDIT 27/07/2014
New version uploaded today, see bottom post.