GLBasic forum

Main forum => GLBasic - en => Topic started by: Millerszone on 2010-Sep-21

Title: Editor for laying out your objects?
Post by: Millerszone on 2010-Sep-21
Coming from "Game Maker" there was a editor called "Rooms" where you layout
your objects(sprites) for your game levels.

Is there some kind of simple editor that works with GLBasic where you just load a
background and some objects and it'll give you the x,y positions? I know there are
tile map editor's (which I couldn't a 800x600 background to load).

The way I do it now is set my object x,y position as close as possible to the position
I want, run the game, if it's not where I want it, I will we position and so on.

Thanks,
Novak

Title: Re: Editor for laying out your objects?
Post by: DmitryK on 2010-Sep-21
Hi KidNovak!

GLBasic hasn't its own level editor (as I know), GLBasic is a compiler (and a code editor and ...much more).

But as a Game Maker user in the past and GLB user now I can say that to make your own level editor for your concrete small (if it is) project is a very easy task.
I spent about 2 days to make such for "Hidden object" game in GM7|8.
And ~ 1 day to make such for "Match 3" game in GLB.

Another way - to use external level editor and import maps into GLB.
I see somewhere on the forum info about LE for RPG.

Best regards,
Dmitry
Title: Re: Editor for laying out your objects?
Post by: Moru on 2010-Sep-21
If you just want to make objects placed at certain positions, make a routine that displays the object on the mouse location and write the location onscreen with PRINT. This can be made into a simple level editor easily if you want.
Title: Re: Editor for laying out your objects?
Post by: Slydog on 2010-Sep-21
If your objects are going to be spaced evenly in a grid like fashion, then in your code just store the grid location of your objects, and then create a GridToPixel() function that accepts an x, y grid location and returns a point TYPE (for example) of the pixel location.

You could even then edit your level in a text editor, placing unique ascii characters that represent certain tiles ('H' for a ladder for example), then load the map, and parse the contents.  Then, use the above GridToPixel() function using the text x, y location.
Title: Re: Editor for laying out your objects?
Post by: Bursar on 2010-Sep-21
Editors that I've written in the past (not in GLB) have used a similar approach. Clicking on the map creates an object at that location, and when I save the map, I write a line that says something like: 1,0,100,245. The first number is the ID of the object I've created (1 might be a tree, 2 a rock and so-on), the second number is the rotation of the object, and then finally its X and Y position.

Loading the map is just a case of looping through the file and parsing all of the entries.
Title: Re: Editor for laying out your objects?
Post by: Millerszone on 2010-Sep-22
Thanks for the replies!
When I get more time I'll make an simple Level Editor.

For now I'll do what "Moru" posted.
"Quote: If you just want to make objects placed at certain positions, make a routine that
displays the object on the mouse location and write the location onscreen with PRINT.
This can be made into a simple level editor easily if you want."
Title: Re: Editor for laying out your objects?
Post by: Scott_AW on 2010-Sep-22
You can always figure out how to use the generic map makers out there, some include setting objects and various flags.

Otherwise if you know exactly what you need, you can just make your own format and editor.

Title: Re: Editor for laying out your objects?
Post by: matchy on 2010-Sep-22
For starting of, I use string arrays to draw a small map quickly. If I need to mock up a large map, I use Moru's mappy importer. G's SEUCK has a map edtior also.  :coke: