Simple Level Editor Example
#21
Posted 22 December 2008 - 08:51 PM
'cause as you know it won't load the map at the one of mine.
#22
Posted 23 December 2008 - 04:59 PM
Try getting version 1.1
#23
Posted 25 December 2008 - 02:57 PM
I have no idea why, but it's for sure it isn't the examples fault.
#24
Posted 14 February 2009 - 08:50 PM
ask your dadI wouldn't call that a bad thing either...Darn Pro Edition...would've been better if it was made with a lite vesion too, so more people would download it. And I'm not kidding, either. You don't see many kids with credit cards or PayPal accounts these days...
Usually.
#25
Posted 18 February 2009 - 06:39 PM
ask your dad
[/quote]
There's absolutly no need of stealing. Seriously guys.... we're talking about 20 bucks.. that ain't so bad.
And when you buy a GameMaker license, you ALSO get a license for the previous GameMaker for FREE
#26
Posted 18 February 2009 - 09:55 PM
- You should indent your code properly otherwise it is very irritating to read.
- The way you store your level information is very inefficient in terms of space, and I shall explain why:
Firstly, you have the decimal points. that would be fixed by using file_text_write_string(real(ix)). Secondly, even if you got rid of the decimal points you're storing the data inefficiently, because in some cases you're using 3 bytes of data where you should be using one. For example, an object with an x of 20 in your system would be saved into the file as "20" and a new line character. What you should do is convert the number 20 into a single byte with Chr(20) or using file_bin_write_byte(20), and then save another byte by simply not using a new line. This may not seem like a lot, but if you ever want to become any good at programming, you need to be aware of small issues like this now. - Your method of saving levels is incredibly bad. You are scrolling through each square and checking for an object, then to the next square and the next, wasting CPU on an empty loop every time you get a square with no object. This might not seem bad but imagine a large game with no grid, you would have to check every single pixel and it would be incredibly slow. Instead you should use with (<some parent object>) {save()} Using this method also makes it easier to implement objects which you do not want to be saved.
#27
Posted 19 February 2009 - 08:21 AM
thanks. :-]
#28
Posted 24 February 2009 - 05:05 PM
#29
Posted 25 February 2009 - 08:12 AM
That's a comprehensive explanation you got there. That answered some of my questions about this level editor.
Thanks.. but I do think you could say it a bit more "soft"...
anyway thanks ^^
#30
Posted 17 October 2009 - 04:55 AM
Edited by dasqe4, 17 October 2009 - 05:10 AM.
#31
Posted 17 October 2009 - 05:09 AM
Can somebody tell me how I would add a new object? I am just blanking out right now and can not get more than 2 objects.
thanks. :-]
ok so say this is what you code looks like for LEFT PRESSED under obj_selblock2
//This is the object that, when clicked, will change this object//to the current object when the player clicks it. (The object//selection thing at the bottom of the screen)global.currentobj=YOUR OBJECT HERE;
And this is what you code looks like for DRAW under Player
//Now, since drawing anything in the draw event makes it so the sprite//is not drawn, we will draw it's sprite.draw_sprite(sprite_index,image_index,x,y);//Now we need something so that the user knows that this is the//current selected object. If it is, we will draw a 2px thick//yellow line around it.if(global.currentobj=YOUR OBJECT HERE){ draw_set_color(c_yellow); draw_rectangle(x,y,x+?,y+?,1); draw_rectangle(x+1,y+1,x+?,y+?,1);}Now all what you would have to do is duplicate the object for your player or obj_selblock1 or obj_selblock2
and change all the names and edit some codes but i will show you.
so say you are making a block 3 this is what you would have to do.
change the sprite and call the object obj_selblock3 and its the same size and every thing
now follow me change this code in the LEFT PRESSED From this:
CODE _linenums:0'><div class='codetop'>CODE
//to the current object when the player clicks it. (The object
//selection thing at the bottom of the screen)
global.currentobj=YOUR OBJECT HERE;
to this
CODE _linenums:0'><div class='codetop'>CODE
//to the current object when the player clicks it. (The object
//selection thing at the bottom of the screen)
global.currentobj=obj_block3;
then change the DRAW event from this:
//Now, since drawing anything in the draw event makes it so the sprite//is not drawn, we will draw it's sprite.draw_sprite(sprite_index,image_index,x,y);//Now we need something so that the user knows that this is the//current selected object. If it is, we will draw a 2px thick//yellow line around it.if(global.currentobj=YOUR OBJECT HERE){ draw_set_color(c_yellow); draw_rectangle(x,y,x+?,y+?,1); draw_rectangle(x+1,y+1,x+?,y+?,1);}to this:
//Now, since drawing anything in the draw event makes it so the sprite//is not drawn, we will draw it's sprite.draw_sprite(sprite_index,image_index,x,y);//Now we need something so that the user knows that this is the//current selected object. If it is, we will draw a 2px thick//yellow line around it.if(global.currentobj=obj_block3){ draw_set_color(c_yellow); draw_rectangle(x,y,x+32,y+32,1); draw_rectangle(x+1,y+1,x+31,y+31,1);}now to go on to the the object you have made: obj_block3
now go to the create event and go it has this code:
//The reason this object has no events is because it's parent is obj_block1.//Since there is something in the create event, we will need to:event_inherited();//And now to make the objects not COMPLETELY the same,obj=YOUR OBJECT HERE//This variable will be used in saving.//See STEP event in OBJ_BLOCK1.
now change that to this:
//The reason this object has no events is because it's parent is obj_block1.//Since there is something in the create event, we will need to:event_inherited();//And now to make the objects not COMPLETELY the same,obj=obj_block3//This variable will be used in saving.//See STEP event in OBJ_BLOCK1.
and then you should be done but before anything add it to your room then test it.
Hope This Has Helped











