New ways of interacting in wimi5
Move an element to a Script (or Level)
To move an element (by which we mean a Blackbox, a Script, or a Level) to a Script (or a Level), all you have to do is click on the element you want to move and drag it to the destination Script (or Level), and drop it.
Keep in mind that a Level can never be the child of a Script, so that action isn’t allowed; nor is moving Connectors between Scripts or Levels allowed.
In order to perform a multiple selection, all you have to do is click in an empty area in the Scene and drag.
This action will create a rectangular selection field with orange borders. Every element that ends up inside this area when we let the button go will be automatically selected.
We can perform a multiple selection on Blackboxes, Scripts, Levels, and Connectors (both input and output).
Once they’re selected, you can perform a series of actions on all of them at the same time, such as moving them or deleting them.
Move multiple elements to a Script (or Level)
Select the elements to be moved as explained in the previous section and drag them over the destination Script (or Level).
These elements will be automatically moved to the new Script (or Level) without losing the flow that existed beforehand (meaning we can consider moving between scripts to be a safe action), since the necessary links and connectors will be created to maintain the flow.
Remember that the rules that apply when we move one element to a Script or Level are also present when moving multiple items.
For example, the movement cannot be performed if one of the elements in the selection is a Connector, since Connectors cannot be moved between Scripts.
The movement of multiple elements is the perfect tool to refactor your code and encapsulate portions of your game to make it more orderly and manageable.
Precautions to keep in mind when moving one Level to another
By their very nature, a Level and all its internal elements can only be loaded when the flow reaches their “load” Connector.
If we put a Level inside another one, it’s possible that the “load” Connector from the Level being moved is never called, since it needs the “load” Connector from the destination Level to be called first, something which doesn’t always happen and which can create misunderstandings.
In the example shown in the above image, once “Level1” is moved to “Level2”, we’ll call the “load” connector from “Level1” via the new “new_load” connector created in “Level2”, but what happens is that we’ll never call the “load” connector from “Level2”, which means “Level2” will never be loaded, and therefore, neither will “Level1”, despite the fact that the logic flow has been maintained.
But, don’t panic.
When this happens, a warning message will pop up explaining to you that this case is what’s going to happen, and the reasons why, giving you the option to cancel the action or to continue ahead so you can make the best decision.
Moving one or more elements to the parent Script (or Level)
In order to move one or several elements to the parent Script (or Level), all we have to do is select the elements to be moved and start dragging them.
In that moment, an activation area will appear in the top left.
Just drag the selection to this area and the elements will be moved one Script (or Level) up, while maintaining its links.
Delete multiple elements at once
In order to delete multiple elements at once, first we have to select all the elements we want to delete, as explained previously.
Once the multiple selection has been made, right-click and select the option “Delete All”.
A message will then pop up asking us if we’re sure we want to delete those elements, since this action cannot be undone. Select “Yes” to delete.
We can delete multiple Blackboxes, Scripts, Levels, and Connectors (both input and output), except the “levelLoaded” input connectors, which come with the Levels by default.10/05/2016 / No Comments
- How to Integrate a Game into Your Website
- How to integrate a WiMi5 game in Moodle
- How to create texts from sprites using a SpriteText Blackbox
- How to clone a project
- New ways of interacting in wimi5
- How to easily adapt WiMi5 game templates to create your own games
- How to monetize your games using Virtual Goods
- How to use the CodeRunner blackbox
- How to use Game Session Storage
- How to Use Rankings
- How to publish your HTML5 game to other game platforms
- How to publish your HTML5 game on the Google Chrome Web Store
- How to set up game levels based on data from a text file: using the ParamMap.
- How to create a scoreboard for lives, time, and points
- How to Make a Scroll and a Parallax Scroll in 2D Games
- How to create collisions
- How to debug in WiMi5