Events GameMaker uses what is called an event driven approach. This works as follows. Whenever something happens in the game the instances of the objects get events (kind of messages telling that something has happened). The instances can then react to these messages by executing certain actions. For each object you must indicate to which events it responds and what actions it must perform when the event occurs. This may sound complicated but is actually very easy. First of all, for most events the object does not have to do anything. For the events where something must be done you can use a very simple drag-and-drop approach to indicate the actions. In the middle of the object property form there is a list of events to which the object must react. Initially it is empty. You can add events to it by pressing the button labeled Add Event. A form will appear with all different types of events. Here you select the event you want to add. Sometimes a menu pops up with extra choices. For example, for the keyboard event you must select the key. Below you find a complete list of the different events plus descriptions. One event in the list will be selected. This is the event we are currently changing. You can change the selected event by clicking on it. At the right there are all the actions represented by little icons. They are grouped in a number of tabbed pages. XINPUT controllers will automatically be assigned gamepad ID 0-3. To 'join a game' as a specific player, just press a button on any controller. In the next chapter you will find descriptions of all the actions and what they do. Between the events and the actions there is the action list. This list contains the actions that must be performed for the current event. To add actions to the list, drag them with your mouse from the right to the list. They will be placed below each other, with a short description. For each action you will be asked to provide a few parameters. These will also be described in the next chapter. So after adding a few actions the situation might look as follows: Now you can start adding actions to another event. Click on the correct event with the left mouse button to select it and drag actions in the list. You can change the order of the actions in the list again using drag-and-drop. If you hold the key while dragging, you make a copy of the action. You can even use drag-and-drop between action lists for different objects. When you click with the right mouse button on an action, a menu appears in which you can delete the selected action (can also be done by using the key) or copy and paste actions. (You can select multiple actions for cutting, copying, or deleting by holding the key of key. Press to select all actions.) When you hold your mouse at rest above an action, a longer description is given of the action. See the next chapter for more information on actions. To delete the currently selected event together with all its actions press the button labeled Delete. (Events without any actions will automatically be deleted when you close the form so there is no need to delete them manually.) If you want to assign the actions to a different event (for example, because you decided to use a different key for them) press the button labeled Change and pick the new event you want. (The event should not be defined already!) Using the menu that pops up when right-clicking on the event list, you can also duplicate an event, that is, add a new event with the same actions. As indicated above, to add an event, press the button Add Event. The following form pops up: Here you select the event you want to add.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2019
Categories |