Note~DEC Stuff is Dan Cook, the user who originally wrote this article.



1:Ever wanted to make a game, and make a level editor for it? The idea popped in my head today. It's simpler than you think.

You will need MMF to make it...
You game will have to have it's levels in grid mode, but it is possible to load levels they will have to be in grid mode.

It's somewhat simple, Once you get the hang of it.

First you make a tile selection system. Then divide your level up into a certain amount of squares. In this example we will say X is 15 and Y is 10. Now make a tile placing system(I usually use the keyboard. Make a flashing block or something to indicate where the tile will be placed...and add the following events so your block indicator will move to a selected place in the grid.

Upon pushing Down...move Flashing block placing indicator Down from it's current position+15(or whatever the size of your grid blocks is.
Do this with all directions-
Make it so when you push enter an active of your backround is created and a backround picture is placed, then the active is destroyed.

Here comes the tricky part.... Create an array and set it to the exact dimensions of your level(the size of the grid~X,Y)

When the user pushes DOWN...in the array the current position of Y is changed to Y's current position +1.

When the user pushed Right...in the array the current position of X is changed to X's current position +1.

Do the same thing with Up, and Left(except negatives)

Now...write this down. Assign each tile with a number.

When ENTER is pressed the number of the selected tile is placed in the grid.

Finally add a save button...and make it so you can save the Array...

LOADING THE ARRAY...

When a user loads the array...make it so that in the first few seconds an active is created in all the gridspots with numbers purtaining to that tile. Then make them create backround obstacles, and your level is loaded! (You may want to try to use the fastloop object for this part...but your on your own for that)

Making all the tiles load can be tricky. You might try the following.

Make an Active, and create all your tiles as animations within it.

Put in the following actions...
-ALWAYS>Place tilemaker at Tilemakers position +15(or the Height of your tiles), And Add one to Y dimension of array.
*when tile maker is visible


Now you need to make an action for each tile you have.

Read value from array...
*If Value =1 Set animation of Tilesetter to TILE 1.

Then place this action.
Every 00:02(or something similar) Place a backround picture of Tile Setter as an obstacle...



THERE YOUR DONE>....Hope it's not terribly confusing(by the way...I thought this hole thing up in about 3 seconds....literally---not joking)


Image


http://www.freewebs.com/decstuff