[tutorial]tile based level editor w/ array object

This forum is currently in read-only mode.
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • heavily commented

    only 13 events

    loading/saving

    tile 'painting' leftclick-drag to draw tiles/rightclick-drag to erase

    bare bones example

    <img src="http://dl.dropbox.com/u/1013446/forumhelp/leveleditor.PNG" border="0">

    <font color="blue">download here</font>

  • Wow, I didn't know i can use an expression when spawning an object! That's a great feature, the most useful one I've learned in months. Thank you for making such a great tutorial.

    On the other hand, I think this method would lag a lot if i try to use it for making bigger tile maps.Wouldn't it be better if instead of destroying every tile every tick, and then recreating the whole map, you just change the tile that's under the mouse?

    Here's my try for that:

    dl.dropbox.com/u/52670878/MapArrayEditor.cap

    It's an edit of an old example made by Thuwe, redesigned for superspeed when making huge maps.

  • i agree also it'd be useful to have some type of behavior system, too. also more dimensions for more data about each thing, etc

    I wanted to make it as basic as possible, so people have a bare bones example they can build off of, and learn from, without any extra frills making it harder to see how it works.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 13 events? Ha! My example of a tile based level editor used to explain the array object (source) uses more events overall, because it controls a selfmade gui, but the barebones only use 8 events for a full functional editor (look in group "Array" on layout "Array") <img src="smileys/smiley17.gif" border="0" align="middle">

    Now who's next? Do I hear 5? <img src="smileys/smiley4.gif" border="0" align="middle">

  • 1

    On click, text set text to getText&mouse.x&","&mouse.y&"|"

    Course its a little different for the actual import.

    Start of layout

    ->for n = 0 to getToken(string).count-2

    -->system create object at int(tokenat(tokenat(string, loopindex("n"), "|"), 0, ","))

    int(tokenat(tokenat(string, loopindex("n"), "|"), 1, ","))

    And you add a loop for each sting..., or add another token to define a different object type, but you would have to do a for loop on a family.

    I'll probably be using this method now since FF broke Rojo's canvas plug.

    ... end rant.

    Any way its usable in both CC, and C2. In CC you can paste it as a variable, etc, or import as text. For C2 copy paste is the more obvious method, but you can import using jscript.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)