Level Creation Capx

  • Ok to go with my save game Capx here's a level creator maybe for a sim type game, this is very basic but works, there maybe bugs,

    on first screen click on Goto Editor Button

    Left click to Select Road,Dirt,Water ETC

    Right Click to Place on Map

    To delete any items placed Hover mouse of object and press delete

    I know it's far from complete, and if you delete the tiles in the left window then oopss they are gone... But it's a start for someone.

    Also a snap to grid would be good for this, which i'm working on next.

    Test here

    Level Creator

    Capx Here

    Capx Download

    <img src="http://i508.photobucket.com/albums/s329/tonycrew/editor01.jpg" border="0">

  • Hi tonycrew,

    Thank you for the info. Did you incorporate a snap to grid yet?

    Regards,

    Shawn

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No sorry i didnt get round to doing this but there are someother demos and plugins that will help with this.

  • There's an easy answer, Set X position to XMouse/32*32 (basically snaps to the mouse position converting it to an integer from a float) giving it a precise snapped position rather than in between integers allowing it to freely move around. I can create an example if need be.

  • Thank you dcrew

  • I did'nt quite get it. Can you send me a capx example? :)

    Also I modified the version so there's 2 of each

    building type so it doesn't duplicate when you try to move a block.

  • <font color=black>Basically set the block's X Position to the XMouse (X Position of the Mouse) devided by 32, convert that from a float to an int (Basically round it down), then times it by 32 again. (Replace 32 with the grid size you want), It's really that easy! Believe me!

    So basically even in code:

    int gridSize = 32;

    block.Position.X = (int)Math.Floor(Cursor.X / gridSize) * gridSize;

    In Construct2 it should be farely similar:

    (Declare a integer variable called 'gridSize')

    block   | Set X position to ( floor(XMouse/gridSize)*gridSize )

    I haven't done C2 in a while but it should be something similar to that, if you still need an example please let me know!</font>

  • Or just use the % operator.

    Set X position to : Mouse.X - Mouse.X % gridSize

    Set Y position to : Mouse.Y - Mouse.Y % gridSize

  • Magistross

    Thank you so much :) This worked perfectly!

  • What's the best way to output this information to use later?

    I basically want to be able to give my editor to someone else to design levels. Then I import the info, from whatever file format it spits out, into my game.

    I'm interested, not just in the file type, but also the layout of the information itself (arrays etc)

    Thanks

  • Is there any way you can share the levels afterwards?

  • Sorry to bump an old post, guys, but I'm having some issues here.

    I got a capx together for anyone who can't figure out what you guys are talking about: https://www.mediafire.com/?82yu55mdtq2o0y5. I managed to get it working, but if you take a look at the capx, the mouse is unsynced with the spawn block. Therefor, when I remove the mouse cursor (to make it easier on the player's eyes, the player has to guess where to click to delete a misplaced block. Just look at the capx, and tell me if there's a way I can adjust the grid so the block is in the center of the mouse.

    EDIT: also, I'm still working on a way to save and load the files. I'm trying to use the dictionary object, but it's getting a bit too large for me. Anyone have a solution on that yet?

  • https://www.scirra.com/tutorials/585/ho ... vel-editor

    Here you go,wrote this tutorial last year.

  • wel done awesome work you are a genius bro i also had a plan to make a game with level editor thank you mate

  • very easy

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