How to program a simple platformer

BlitzMax Forums/BlitzMax Beginners Area/How to program a simple platformer

Twinprogrammer(Posted 2011) [#1]
I've been trying to make a simple platformer with this program called mappy, but it saves it in a .fmb format. How would I be able to program a tile based program like this:

1111111111
1000000001
1000000001
1000000001
1111111111

where the numbers stand for different images?

Twinprogrammer


therevills(Posted 2011) [#2]
You would load your tileset as an animation image - LoadAnimImage, then use the frame count as the different image.


Jesse(Posted 2011) [#3]
@twinprogrammer
do you have an idea?
There are many different ways and your idea might be good enough for learning.
do you have a way to store the map data?
do you know how know or have an idea on how to represent the data with an image?
if you have not brainstormed it, these are some ideas to start by.


Czar Flavius(Posted 2011) [#4]
I'm not sure what you are asking. How to program the whole game, or how to load/save the data in a file?


Paul Murray(Posted 2011) [#5]
As mentioned, loading the tilemap as an AnimImage is an option and using the values of the data to display the corresponding frame of the animation.

You'd first need to create a grid that will hold your tiles, using an array for example.

Then use a For Until Next loop to cycle through each cell of the array, then use a similar loop to read the data and draw the selected frame in each cell.

I know it's vague but it's harder to explain than actually code. You might want to read this - http://blitzmax.com/Community/posts.php?topic=84117#950134

Take a look at this too (it's for BlitzBasic but the principal is pretty much exactly the same) - http://jnoodle.com/blitz/lesson1.html