The Daily Click ::. Forums ::. Klik Coding Help ::. One-Object Level Editor
 

Post Reply  Post Oekaki 
 

Posted By Message

Jarzka



Registered
  26/12/2003
Points
  270

VIP Member
9th September, 2007 at 09:53:30 -

So it is possible to make Level Editor which has only one object with a lot of frames.
Here is an example:
http://img511.imageshack.us/my.php?image=leveleditormt3.jpg

Only thing I need to do is to put the same object to the level and the game will set the animations. It would be easy to make levels that way.

 
n/a

-Nick-

Possibly Insane

Registered
  24/11/2002
Points
  2468

VIP Member
9th September, 2007 at 10:08:18 -

This could become tricky. But the basic theory behind it would be to loop through each of the squares you place down. Test each one for objects each direction away from it, and set animations correctly depending on where it is located.

 
Project: Roller Coaster is on it's way!
http://www.projectrollercoaster.co.uk/
http://www.craftsncreatures.com

Jarzka



Registered
  26/12/2003
Points
  270

VIP Member
9th September, 2007 at 10:10:19 -

I had the same idea but don't have enough skills to make it

 
n/a

Cazra

Crazy?

Registered
  24/07/2002
Points
  4472

Game of the Week WinnerVIP Member
9th September, 2007 at 11:10:19 -

I made something like this for my current project, an isometric game.

Here's basically what you do:

When the objects are loaded from the level editor file, make it check if there's an object to the left,right,above, and below sides of the object. Temporarily store this data in another object (perhaps using an alterable value for each side) and then set the current object's animation accordingly.

 
n/a

Jarzka



Registered
  26/12/2003
Points
  270

VIP Member
9th September, 2007 at 11:15:56 -

I know that is the way to do it but I have no idea how to do it MMF example would we nice.

 
n/a

Milo



Registered
  17/09/2005
Points
  223
9th September, 2007 at 17:02:17 -

Well I can tell you how to code something like that

First make an object for the squares. The script assumes this is 64x64
Then for the walls.

Then in the event editor

[Event(s)] Action(s) (Formula)

[Use clicks] Create square at 0,0. Set X Position (XMouse - (XMouse Mod 64)) Set Y position (YMouse - (YMouse Mod 64))
Create Walls at 0,0. Set X Position (XMouse - (XMouse Mod 64))* Set Y position (YMouse - (YMouse Mod 64))* Set direction to (???) Do this 4 times in the same event
*Needs modification

[Wall collision with wall] Destroy wall

There's another way, but it's much more complex (But better aestheticly)

 
I've wasted my life.
I don't plan on stopping.

-Nick-

Possibly Insane

Registered
  24/11/2002
Points
  2468

VIP Member
9th September, 2007 at 20:27:12 -

Actually, i would do something similar to that while loading. But in the creation of levels i would simply do it so you just place down a square and it doesn't create the walls.

 
Project: Roller Coaster is on it's way!
http://www.projectrollercoaster.co.uk/
http://www.craftsncreatures.com

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
10th September, 2007 at 05:18:39 -

Dude, I wrote an article on this like 2 days ago, complete with example file. Look for "Tile Based Games" in the articles section.

One question though;
I've been trying to fastloop my example (and another similar one that would be perfect here), but they don't seem to work. I'm guessing it's probably because the data can't be loaded fast enough from the array (I'm not a newbie - I understand fastloops/arrays so I'm pretty sure it's not bad coding).
Are any of the other array extensions better/faster?




Image Edited by the Author.

 
n/a

Jarzka



Registered
  26/12/2003
Points
  270

VIP Member
10th September, 2007 at 06:41:40 -

Your article seems nice. I will read it soon

 
n/a
   

Post Reply



 



Advertisement

Worth A Click