Page 1 of 1

Level maker (idea or example)

Posted: Mon Apr 11, 2005 6:49 am
by pepe
How to
- edit (put model or picture)
- save (what format)
- Load to display

Posted: Mon Apr 11, 2005 12:55 pm
by Alex001
you could use the stl to save and resore data, but a little knowledge of stl and good programming knowledge is required
f.e. you could use the file stream classes to save and restore game data.
is this what you intend to do ?

Posted: Tue Apr 12, 2005 6:11 am
by SARIN
ill show idea
well, u could simply write to a file for each little thing. for an editor, it could just be a couple vectors and lists(position, rotations, paths)
for something like 2d, u could just get all the stored pixels and store them in arrays, with a total of 2 vars and an array, like
int x=image size along x axis in pixels
int y=image size along y in pixels
SColor pixel[x*y];
for(int ysize=0;ysize<y;++y) {
for(int xsize=0;xsize<x;++x) {
pixel[(ysize*x)+x]=getCurrentPixel();
}
}

or something. or, just have the array and x and y vars, then assign the working scolor array to the current array
just change the current array along for the pixel, like if a pencil draw function is on
int x=image size along x axis in pixels
int y=image size along y in pixels
SColor pixel[x*y];
position2d<s32> mousepos=devicer->getGUIEnvironment()->getMousePosition();
mousepos=position2d(mousepos.X-(size of ur side bar or toolbars),mousepos.Y-(size of ur headerbars or toolbars));
pixel[(mousepos.Y*x)+x]->setColor(draw color);
do something like this in the app. if there r toolbars, then the mouse position must be moved according to their size

for 3d, i reccomend that (because im assuming ur new to file formats, tho im new myself) you, in the editor, specify a file to load. then, in ur loader in ur game, just read a simple file made by ur editor (as said above about a couple vectors and lists) the file names in c8 strings, and just load them in ur game or app or wahtever like
smgr->getMesh(c8string); real simple like that