As well, LevelEditor references other game classes which rely on Box2D. Why do you need to use Objective-C++ in the LevelEditor class? mm file extension tells the compiler that the file uses Objective-C++. Name the file LevelEditor, make its super class CCLayer, and be sure to change the file extension of the file from. Now that the design of the editor has been decided, you can get busy constructing it! Creating The LevelEditor ClassĬreate an Objective-C class under the LevelEditor group. ![]() One very common way to do this in iOS is to use a long press action to indicate that the user wants to remove the item being pressed on. Last but not least, the user needs to be able to delete objects. Drag and drop is the logical choice for this functionality. Moving objects will also be important to the user - and the user interaction for this on a touch screen is almost a no-brainer. The object will then be created automatically at the current position of the popup menu. From this popup menu, the user can choose between adding a pineapple or a rope. Instead of having a menu that is permanently visible, it would be better to have a popup menu that appears by tapping the screen. However, you already have a menu to be added to the bottom of your screen, and you’re rapidly running out of real estate. Again, the easiest way to expose this functionality would be through a menu. This means you need a mechanism that will allow them to create those new objects. Second, the user must be able to add ropes and pineapples to the level. The bottom of the screen is probably the best place for the menu, as it does not contain any dynamic game elements, as seen below: The easiest way to do this is by using a menu. With those basic requirements in place, it’s time to set out the design of the editor.įirst, the user needs a way to launch the editor. And as always, the functions in your app should be as intuitive as possible for the user. As well, it should make the best use of the screen real estate available. So what functionality should a level editor contain? At the very least it should be able to create, reposition and delete objects in the level. If you don’t have it already, download a copy of the sample project where you left it off in the previous tutorial. You’ll work through adding popup menus, dynamically positioning and sizing your objects on screen, and much more. ![]() In this second part of the tutorial, you will implement a portion of the editing capabilities of your level editor. Rest assured that you’ll not have to manually edit those level files any longer. (No, editing XML files by hand does not count as a level editor - just in case you were wondering!) In the previous tutorial, you designed the XML storage mechanism of your level files, implemented some model classes to hold your rope and pineapple data, and finished off by creating the load file functionality of your level editor.Īt this point, your project is still just a level “loader”, as opposed to a level “editor”. This is the second part of a tutorial series that shows you how to make a level editor for the Cut the Verlet game that was previously covered on this site.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |