Level maker (idea or example)

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
pepe
Posts: 9
Joined: Mon Mar 07, 2005 7:29 am
Location: thailand
Contact:

Level maker (idea or example)

Post by pepe »

How to
- edit (put model or picture)
- save (what format)
- Load to display
chaiyo chaiyo
Alex001
Posts: 25
Joined: Tue Dec 02, 2003 8:20 pm
Location: Germany, Munich

Post 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 ?
Any fool can make things bigger, more complex, and more violent. It takes a touch of genius-and a lot of courage-to move in the opposite direction.
(Albert Einstein)
SARIN
Posts: 139
Joined: Fri Oct 29, 2004 3:53 am

Post 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
Post Reply