Warning: mysqli_connect(): (HY000/1045): Access denied for user 'xableu5_tutorial'@'localhost' (using password: YES) in /home/xableu5/fusion.xable.info/tutorialAutoUpdate.php on line 14

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/xableu5/fusion.xable.info/tutorialAutoUpdate.php on line 18

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/xableu5/fusion.xable.info/tutorialAutoUpdate.php on line 20

Warning: mysqli_close() expects parameter 1 to be mysqli, boolean given in /home/xableu5/fusion.xable.info/tutorialAutoUpdate.php on line 25
Go to content

Main menu:

Moving the Level Objects - Components of a Level Editor

Last Updated: March 20th, 2016
A level editor, at its most fundamental level, can be viewed as the integration of three engine mechanics: creating a level, saving a created level, and loading a saved level. This tutorial series is broken down into three sections with each section describing one of the engine mechanics listed above. Each section will describe the concept, goal, and several ways of achieving the section’s mechanic in Multimedia Fusion 2 and Clickteam Fusion.


Concept for Moving the Level Objects
So at this point, you should be able to create objects for the level editor. When you create an object, you create it at a given position. Now you need the capability to move the objects to different positions within the level editor, allowing the user to design levels. This subsection covers a few different ways to place and move objects in a level editor. That being said, this subsection does not cover specific implementations of moving these objects. You may want to look over other tutorials to learn about specific methods objects can be moved.

Method 1 - Using the Multimedia Fusion 2 and Clickteam Fusion Frame Editor
Similar to method 1 in the “Creating the Level Objects” section, this method forgoes the idea of building extra level editor mechanics and takes advantage of the Multimedia Fusion 2 and Clickteam Fusion Frame Editor. The Frame Editor allows you to design and develop levels during edittime. This means that during edittime, you can move objects to wherever you need them. As such, use the MMFusion Frame Editor to move objects. Once again, if you have a tool that already works, why spend time and effort building another one?
Method 2 - Picking and Moving One Object (with Events and User Actions)
This methods covers a way to move objects one at a time during runtime. First, you need to know exactly which object you are going to move; which means you need to get some form of ID from the object. This means you may need to assign custom objects IDs or use the object’s fixed value. Pass this ID to the implemented movement scheme, which should look for the object that matches the ID and move this object according to said movement scheme (an example of this can be found in the Downloads section). When an new object needs to be moved, replace this “old” ID with the new ID from the new object that needs to be moved. If no objects need to be moved, you can simply erase the value the “old” ID.

For example, suppose you have Object A, Object Z, and a drag and drop movement scheme that will move an object if the object’s fixed value matches a variable within the movement scheme. When the user clicks Object A, you retrieve Object A’s ID (the object’s fixed value). This ID is then passed to the drag and drop movement scheme which should move Object A. When Object Z is clicked, you overwrite the ID of Object A and the whole process begins again.
Flow chart describing the steps required for "Method 2 - Picking and Moving One Object" in the "Moving the Level Objects - Components of a Level Editor" tutorial series.
Flow chart describing the steps required for "Method 2 - Picking and Moving One Object" in the "Moving the Level Objects - Components of a Level Editor" tutorial series. Click image to enlarge.
Method 3 - Picking and Moving Several Objects (with Events and User Actions)
This method extends the concept in method 2. Rather than storing one ID and moving the one object whose ID matches the stored ID, we can store multiple IDs and move objects whose ID matches one of the stored IDs. Naturally, you will need to adapt the movement scheme so it can handle multiple objects at once.
Rate This Tutorial
Vote: 4.0/5
If you have read this tutorial, rate it from poor (1) to average (3) to great (5)!
Back to content | Back to main menu