How to make a level editor for your game.

2

Stats

1,318 visits, 1,686 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

This tutorial will show you how to make a level editor for your game. First, create a new project. Then, make a game, because we need a game to make a level editor. Your game must have at least 6 ground tiles, at least 6 enemies, and at least 6 of any other stuff you need for your game. (Oh, and I almost forgot, add a player object for the player to control) Now that you have your game made, you need to make the level editor. You need to make a title screen for your game. (If you have not already.) Then make (If you have not already.) 2 spritefont objects. Have one of the spritefont objects text be "Play". Have it so if the player clicks on the spritefont object that has the text "Play", the game (Or system, as the game is called in the event options in the Construct 3 Event Sheet.) takes the player to the first level of the game. (If your game has more than 1 level, but some games have there be only 1 level. Big or small.) Later, you will make the other spritefont objects text be "Level editor", and have it so if the player clicks on the spritefont object that has the text "Level editor", the game will take them to the level editor. But before that, you need to make the level editor for your game. First, duplicate a level from your game and call it "Level editor". Then, copy every object in the levels in your game, and get rid of the copy's behaviors. Now, make all of the objects you just copied have the behavior anchor, then put 1 of all of the copied objects into the layout "Level editor". Add a instance variable to the player object in your game, and call the variable "Maker" and give the instance variable the value 0. Now, have the instance variable for the player object in your game called "Maker" be set to 1 if one of the copied objects in on screen at the start of the layout in your games levels event sheet. Make sure that the copied objects are only in the layout "Level editor". Now, have the player object for your game if one of the copied objects is on screen have its movement behavior ignored. Now, add a object that looks like a play symbol to the layout "Level editor". Have the object that looks like a play symbol on clicked by the player to have the player objects movement behavior to be not ignored, so in your games level editor the player can playtest the levels he/she made with it. But the player can't make levels if he/she can't place any objects? So give all of the objects in your games levels the behavior click and drag. Now, have it in your games levels event sheet that on start of layout, the click and drag behavior for the objects in your games levels be disabled. Now, have it so that on start of layout if one of the copied objects is on screen, make the game wait 1 second, then set the instance variable of the player object in your game called "Maker" be set to 1, and have all of the objects in your games levels click and drag behavior be enabled. Now, have it so if any of the copied objects are clicked by the player, the copied object clicked spawns the object it was copied from in your games levels. Now, have the object that looks like a play button on clicked by the player make all of the objects in your games levels click and drag behavior be disabled. Now, make a object that looks like a stop button that on clicked by the player makes all of the objects in your games levels click and drag behavior be turned on. Now you know how to make level editors for the games you make.

  • 2 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • I second the request - how would one go about sharing the levels through the game?

    So that when other players log to the game there is a section of custom levels

  • How about sharing the levels?