08.11.2012 Views

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

files are also stored here and you choose to remove them at the end of the game you<br />

might loose them alltogether! So better not store these files <strong>with</strong> the .gmk file but<br />

e.g. in a subfolder!<br />

Finally you can indicate to what folder the files are exported. There are four options here. In<br />

the default situation the files are exported in the folder where the stand-alone game is stored.<br />

This is also the working directory for the game. So the game can just use the file names to<br />

access them (no paths are required). This works well if the stand-alone is stored e.g. on the<br />

hard disk but will fail if it is stored on a read-only device, e.g. on a CD.<br />

The second possibility is to indicate that the files must be exported into the temporary folder<br />

that is created during the running of the game. If you select this option you will need to<br />

provide the path to the temporary folder when you use the file name during the game. This<br />

path can be obtained using the built-in variable temp_directory. Don't forget to add the<br />

backslash in this case. So to e.g. play a video file you might type in the following piece of<br />

code:<br />

{<br />

}<br />

splash_show_video(temp_directory+'\movie.avi',true);<br />

Realize that this temporary folder is removed once the game is finished. So you e.g. cannot<br />

store save games or special information in this case. Only choose this option when you want<br />

the game to be run from a CD or when you do not write any files from <strong>with</strong>in your game.<br />

The third option is to indicate the folder to which the file must be exported yourself. If it does<br />

not exist it will be created. E.g. you could specify C:\My<strong>Game</strong>. (Note that you need to provide<br />

a full patgh and that you should not include a dach at the end.) This is only allowed when the<br />

game does not run in secure mode.<br />

Finally, you can indicate not the export the file automatically. In this case you should use e.g.<br />

the functions export_include_file(fname) to export it yourself when required.<br />

Error options

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!