Azioni – Main 2

Timing image image image image image image image image
Info image image image image image image image
Game image image image image
Resources image image image

Here are some more main actions, dealing with timing, giving messages to the user, and dealing with the game as a whole.

image Set Alarm

With this action you can set one of the twelve alarm clocks for the instance. You select the number of steps and the alarm clock. After the indicated number of steps, the instance will receive the corresponding alarm event. You can also increase or decrease the value by checking the Relative box. If you set the alarm clock to a value less than or equal to 0 you switch it off, so the event is not generated.

image Sleep

Con questa azione puoi congelare la scena per un certo tempo.
Si usa normalmente all’inizio oppure alla fine di un livello oppure quando dai un messaggio al giocatore.
Specifica il numero di millisecondi di attesa.
Inoltre puoi specificare se la scena deve essere prima ridisegnata per riflettere la situazione più recente.

 



image Set Time Line

With this action you set the particular time line for an instance of an object. You indicate the time line and the starting position within the time line (0 is the beginning). Also you indicate whether the time line should start immediately and whether it should loop at the end.

image Time Line Position

With this action you can change the position in the current time line (either absolute or relative). This can be used to skip certain parts of the time line or to repeat certain parts.

image Time Line Speed

With this action you can change the speed of the time line (either absolute or relative). A speed of 1 is the normal speed. When you e.g. set it to 2 the actions will happen twice as fast and when you set it to 0.5 twice as slow. You can also set a negative speed, in which case the time line is played backwards.

image Start Time Line

This action starts the time line from its current position (if it is paused or stopped).

image Pause Time Line

This action pauses the time line. Use the start action to let it continue.

image Stop Time Line

This action stops the time line and sets the position back to 0.

 



image Display Message

With this action you can display a message in a dialog box. You simply type in the message. If you use a # symbol in the message text it will be interpreted as a new line character. (Use \# to get the # symbol itself.) If the message text starts with a quote or double quote symbol, it is interpreted as an expression. See below for more information about expressions.

image Show Info

With this action you pop up the game information window.

image Splash Text
Standard Edition

With this action you can show a text file. This can either be a .txt file or a .rtf (Rich Text Format) file (no images or embedded objects are shown though). You specify the file name. Make sure the file exists. You should either distribute it with the game or include it in the game through Include Files in the Resources menu. (Note that no scrollbar will be shown nor is there another way to scroll the text. So the text must fit the window.)

image Splash Image
Standard Edition

With this action you can show an image file. Most common image file types are supported. You specify the file name. Make sure the file exists. You should either distribute it with the game or include it in the game through Include Files in the Resources menu. You can e.g. use this to create a series of images as help for your game. Not including the images in the game itself will reduce game size and improve game loading time.

image Splash Webpage
Standard Edition

With this action you can show a webpage. You provide the url and whether it should be shown in the game window or in the default web browser. The url can be the address of a website, for example http://www.yoyogames.com) or can be the file name for a local html file. Note however that you must provide the full path for this to work (which is not the case for the other splash actions). So you best use as url something like “” + working_directory + “\index.html”. (The first two quotes are required to indicate this is an expression rather than a string.) You should either distribute the file with the game or include it in the game through Include Files in the Resources menu. You can e.g. use this to create fancy help pages for your game.

image Splash Video
Standard Edition

With this action you can show a video/movie file. You specify the file name and whether is must be looped. Make sure the video file exists. You should either distribute it with the game or include it in the game through Include Files in the Resources menu.

image Splash Settings
Standard Edition

With this action you can change certain settings for the splash screens that you display with the previous actions. You can provide the caption for the help window (only when it is shown in a separate normal window), you can indicate where the splash screens must be shown (inside the game window, in a normal window, or full screen), you can indicate whether a close button must be shown in the top right corner of the splash screen and whether pressing the escape key or clicking with a mouse in the splash screen will close the splash screen. (For web pages clicking with the mouse will not work nor will the escape key work unless the close button is shown.)

 



image Restart Game

With this action you restart the game from the beginning.

image End Game

With this action you end the game.

image Save Game

With this action you can save the current game status. You specify the filename for saving (the file is created in the working directory for the game). Later the game can be loaded with the next action. (Please realize that only the basic game status is save. Things that are for example not saved are the current sound that is playing, and advanced aspects like the contents of data structures, particles, etc.)

image Load Game

Load the game status from a file. You specify the file name. Make sure the saved game is for the same game and created with the same version of Game Maker. Otherwise an error will occur. (To be precise, the game is loaded at the end of the current step. So some actions after this one are still executed in the current game, not the loaded one!)

 



image Replace Sprite
Standard Edition

This action can be used to replace a sprite from the contents of a file. You indicate the sprite you want to replace, the filename and the number of subimages in the sprite. Many different images file formats are supported, e.g. .bmp, .jpg, .tif, and .gif. For a gif file the number of subimages is automatically decided based on the number of subimages in the gif file. Other settings for the sprite, e.g. whether it is transparent or not, are not changed. You can use this action to avoid storing all sprites in the program itself. For example, at the beginning of a level you can replace sprites by the actual character sprites you want to use. DON’T change a sprite that is at that moment being used in an instance in the room. This might give unwanted effects with collisions.

image Replace Sound
Standard Edition

With this action you can replace a sound by the contents of a file (.wav, .mid, or .mp3). You specify the sound and the filename. This avoids having to store all the sounds in the game itself. For example, you can use different pieces of background music and pick the one you want to play. DON’T change a sound while it is playing.

image Replace Background
Standard Edition

With this action you can replace a background by the contents of a file. Many different images file formats are supported, e.g. .bmp, .jpg, .tif, and .gif. You specify the background and the filename. This avoids having to store all the backgrounds in the game itself. DON’T change a background that is visible.