Huge cleanups and added open gl window

This commit is contained in:
2022-01-15 01:52:55 +01:00
parent a477581f6f
commit ffd4c821ef
525 changed files with 1320 additions and 35862 deletions

View File

@ -1,131 +1,148 @@
QT = core gui widgets multimedia QT += \
core \
gui \
widgets \
multimedia \
opengl
CONFIG += c++latest CONFIG += c++latest
QMAKE_CXXFLAGS += \ QMAKE_CXXFLAGS += \
-std=c++23 \ -std=c++23 \
-Wno-missing-field-initializers \ -Wno-missing-field-initializers \
-Wno-sign-compare -Wno-unused-variable \
-Wall \
-Wpedantic \
-Werror
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000
HEADERS += \ INCLUDEPATH += \
dialogs/deletemomentsdialog.h \ $$PWD/src \
models/actionscontainermodel.h \ $$PWD/src/editor
widgets/actionscontainerwidget.h \
widgets/codeeditorwidget.h \
models/constantsmodel.h \
dialogs/addeventdialog.h \
dialogs/codeactiondialog.h \
dialogs/codeeditordialog.h \
dialogs/createspritedialog.h \
dialogs/fontpropertiesdialog.h \
dialogs/imageeditordialog.h \
dialogs/includedfilesdialog.h \
dialogs/installextensiondialog.h \
dialogs/maskpropertiesdialog.h \
dialogs/objectinformationdialog.h \
dialogs/objectpropertiesdialog.h \
dialogs/pathpropertiesdialog.h \
dialogs/roompropertiesdialog.h \
dialogs/scriptpropertiesdialog.h \
dialogs/timelinepropertiesdialog.h \
dialogs/triggerconditiondialog.h \
dialogs/triggersdialog.h \
dialogs/userdefinedconstantsdialog.h \
widgets/drawingcanvaswidget.h \
futurecpp.h \
models/includedfilesmodel.h \
jshighlighter.h \
mainwindow.h \
models/objecteventsmodel.h \
models/pathpointsmodel.h \
widgets/pathpointswidget.h \
projectcontainer.h \
models/projecttreemodel.h \
dialogs/backgroundpropertiesdialog.h \
dialogs/editspritedialog.h \
dialogs/extensionpackagesdialog.h \
dialogs/gameinformationdialog.h \
dialogs/globalgamesettingsdialog.h \
dialogs/preferencesdialog.h \
dialogs/soundpropertiesdialog.h \
dialogs/spritepropertiesdialog.h \
models/spritesmodel.h \
models/timelinemomentsmodel.h \
models/triggersmodel.h
SOURCES += main.cpp \ HEADERS += \
dialogs/deletemomentsdialog.cpp \ src/closeeventfilter.h \
models/actionscontainermodel.cpp \ src/futurecpp.h \
widgets/actionscontainerwidget.cpp \ src/projectcontainer.h \
widgets/codeeditorwidget.cpp \ src/editor/jshighlighter.h \
models/constantsmodel.cpp \ src/editor/mainwindow.h \
dialogs/addeventdialog.cpp \ src/editor/dialogs/addeventdialog.h \
dialogs/codeactiondialog.cpp \ src/editor/dialogs/backgroundpropertiesdialog.h \
dialogs/codeeditordialog.cpp \ src/editor/dialogs/codeactiondialog.h \
dialogs/createspritedialog.cpp \ src/editor/dialogs/codeeditordialog.h \
dialogs/fontpropertiesdialog.cpp \ src/editor/dialogs/createspritedialog.h \
dialogs/imageeditordialog.cpp \ src/editor/dialogs/deletemomentsdialog.h \
dialogs/includedfilesdialog.cpp \ src/editor/dialogs/editspritedialog.h \
dialogs/installextensiondialog.cpp \ src/editor/dialogs/extensionpackagesdialog.h \
dialogs/maskpropertiesdialog.cpp \ src/editor/dialogs/fontpropertiesdialog.h \
dialogs/objectinformationdialog.cpp \ src/editor/dialogs/gameinformationdialog.h \
dialogs/objectpropertiesdialog.cpp \ src/editor/dialogs/globalgamesettingsdialog.h \
dialogs/pathpropertiesdialog.cpp \ src/editor/dialogs/imageeditordialog.h \
dialogs/roompropertiesdialog.cpp \ src/editor/dialogs/includedfilesdialog.h \
dialogs/scriptpropertiesdialog.cpp \ src/editor/dialogs/installextensiondialog.h \
dialogs/timelinepropertiesdialog.cpp \ src/editor/dialogs/maskpropertiesdialog.h \
dialogs/triggerconditiondialog.cpp \ src/editor/dialogs/objectinformationdialog.h \
dialogs/triggersdialog.cpp \ src/editor/dialogs/objectpropertiesdialog.h \
dialogs/userdefinedconstantsdialog.cpp \ src/editor/dialogs/pathpropertiesdialog.h \
widgets/drawingcanvaswidget.cpp \ src/editor/dialogs/preferencesdialog.h \
models/includedfilesmodel.cpp \ src/editor/dialogs/roompropertiesdialog.h \
jshighlighter.cpp \ src/editor/dialogs/scriptpropertiesdialog.h \
mainwindow.cpp \ src/editor/dialogs/soundpropertiesdialog.h \
models/objecteventsmodel.cpp \ src/editor/dialogs/spritepropertiesdialog.h \
models/pathpointsmodel.cpp \ src/editor/dialogs/timelinepropertiesdialog.h \
widgets/pathpointswidget.cpp \ src/editor/dialogs/triggerconditiondialog.h \
projectcontainer.cpp \ src/editor/dialogs/triggersdialog.h \
models/projecttreemodel.cpp \ src/editor/dialogs/userdefinedconstantsdialog.h \
dialogs/backgroundpropertiesdialog.cpp \ src/editor/models/actionscontainermodel.h \
dialogs/editspritedialog.cpp \ src/editor/models/constantsmodel.h \
dialogs/extensionpackagesdialog.cpp \ src/editor/models/includedfilesmodel.h \
dialogs/gameinformationdialog.cpp \ src/editor/models/objecteventsmodel.h \
dialogs/globalgamesettingsdialog.cpp \ src/editor/models/pathpointsmodel.h \
dialogs/preferencesdialog.cpp \ src/editor/models/projecttreemodel.h \
dialogs/soundpropertiesdialog.cpp \ src/editor/models/spritesmodel.h \
dialogs/spritepropertiesdialog.cpp \ src/editor/models/timelinemomentsmodel.h \
models/spritesmodel.cpp \ src/editor/models/triggersmodel.h \
models/timelinemomentsmodel.cpp \ src/editor/widgets/actionscontainerwidget.h \
models/triggersmodel.cpp src/editor/widgets/codeeditorwidget.h \
src/editor/widgets/drawingcanvaswidget.h \
src/editor/widgets/pathpointswidget.h \
src/engine/gamewindow.h
SOURCES += \
src/closeeventfilter.cpp \
src/main.cpp \
src/projectcontainer.cpp \
src/editor/jshighlighter.cpp \
src/editor/mainwindow.cpp \
src/editor/dialogs/addeventdialog.cpp \
src/editor/dialogs/backgroundpropertiesdialog.cpp \
src/editor/dialogs/codeactiondialog.cpp \
src/editor/dialogs/codeeditordialog.cpp \
src/editor/dialogs/createspritedialog.cpp \
src/editor/dialogs/deletemomentsdialog.cpp \
src/editor/dialogs/editspritedialog.cpp \
src/editor/dialogs/extensionpackagesdialog.cpp \
src/editor/dialogs/fontpropertiesdialog.cpp \
src/editor/dialogs/gameinformationdialog.cpp \
src/editor/dialogs/globalgamesettingsdialog.cpp \
src/editor/dialogs/imageeditordialog.cpp \
src/editor/dialogs/includedfilesdialog.cpp \
src/editor/dialogs/installextensiondialog.cpp \
src/editor/dialogs/maskpropertiesdialog.cpp \
src/editor/dialogs/objectinformationdialog.cpp \
src/editor/dialogs/objectpropertiesdialog.cpp \
src/editor/dialogs/pathpropertiesdialog.cpp \
src/editor/dialogs/preferencesdialog.cpp \
src/editor/dialogs/roompropertiesdialog.cpp \
src/editor/dialogs/scriptpropertiesdialog.cpp \
src/editor/dialogs/soundpropertiesdialog.cpp \
src/editor/dialogs/spritepropertiesdialog.cpp \
src/editor/dialogs/timelinepropertiesdialog.cpp \
src/editor/dialogs/triggerconditiondialog.cpp \
src/editor/dialogs/triggersdialog.cpp \
src/editor/dialogs/userdefinedconstantsdialog.cpp \
src/editor/models/actionscontainermodel.cpp \
src/editor/models/constantsmodel.cpp \
src/editor/models/includedfilesmodel.cpp \
src/editor/models/objecteventsmodel.cpp \
src/editor/models/pathpointsmodel.cpp \
src/editor/models/projecttreemodel.cpp \
src/editor/models/spritesmodel.cpp \
src/editor/models/timelinemomentsmodel.cpp \
src/editor/models/triggersmodel.cpp \
src/editor/widgets/actionscontainerwidget.cpp \
src/editor/widgets/codeeditorwidget.cpp \
src/editor/widgets/drawingcanvaswidget.cpp \
src/editor/widgets/pathpointswidget.cpp \
src/engine/gamewindow.cpp
FORMS += \ FORMS += \
dialogs/addeventdialog.ui \ src/editor/mainwindow.ui \
dialogs/codeeditordialog.ui \ src/editor/dialogs/addeventdialog.ui \
dialogs/createspritedialog.ui \ src/editor/dialogs/backgroundpropertiesdialog.ui \
dialogs/deletemomentsdialog.ui \ src/editor/dialogs/codeeditordialog.ui \
dialogs/fontpropertiesdialog.ui \ src/editor/dialogs/createspritedialog.ui \
dialogs/imageeditordialog.ui \ src/editor/dialogs/deletemomentsdialog.ui \
dialogs/includedfilesdialog.ui \ src/editor/dialogs/editspritedialog.ui \
dialogs/installextensiondialog.ui \ src/editor/dialogs/extensionpackagesdialog.ui \
dialogs/maskpropertiesdialog.ui \ src/editor/dialogs/fontpropertiesdialog.ui \
dialogs/objectinformationdialog.ui \ src/editor/dialogs/gameinformationdialog.ui \
dialogs/objectpropertiesdialog.ui \ src/editor/dialogs/globalgamesettingsdialog.ui \
dialogs/pathpropertiesdialog.ui \ src/editor/dialogs/imageeditordialog.ui \
dialogs/roompropertiesdialog.ui \ src/editor/dialogs/includedfilesdialog.ui \
dialogs/timelinepropertiesdialog.ui \ src/editor/dialogs/installextensiondialog.ui \
dialogs/triggersdialog.ui \ src/editor/dialogs/maskpropertiesdialog.ui \
dialogs/userdefinedconstantsdialog.ui \ src/editor/dialogs/objectinformationdialog.ui \
mainwindow.ui \ src/editor/dialogs/objectpropertiesdialog.ui \
dialogs/backgroundpropertiesdialog.ui \ src/editor/dialogs/pathpropertiesdialog.ui \
dialogs/editspritedialog.ui \ src/editor/dialogs/preferencesdialog.ui \
dialogs/extensionpackagesdialog.ui \ src/editor/dialogs/roompropertiesdialog.ui \
dialogs/gameinformationdialog.ui \ src/editor/dialogs/soundpropertiesdialog.ui \
dialogs/globalgamesettingsdialog.ui \ src/editor/dialogs/spritepropertiesdialog.ui \
dialogs/preferencesdialog.ui \ src/editor/dialogs/timelinepropertiesdialog.ui \
dialogs/soundpropertiesdialog.ui \ src/editor/dialogs/triggersdialog.ui \
dialogs/spritepropertiesdialog.ui \ src/editor/dialogs/userdefinedconstantsdialog.ui \
widgets/actionscontainerwidget.ui src/editor/widgets/actionscontainerwidget.ui
RESOURCES += \ RESOURCES += \
resources.qrc resources.qrc

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,46 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Using Game Maker</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Using Game Maker</h1>
<I>Game Maker</I> is an easy to use program for creating your own computer games.
This section of the help file gives you all the information you need for creating your
first games. Later sections will discuss more advanced topics,
how to polish and distribute your game, and the built-in programming language GML
that considerably extends the possibilities.
<!--HELPONLY-->
<P>
Information on the basic use of <I>Game Maker</I> can be found in the
following pages:
<P>
<blockquote>
<a href="101_00_introduction.html">Introduction</a><br>
<a href="102_00_installation.html">Installation</a><br>
<a href="103_00_pro.html">Upgrading to the Pro Edition</a><br>
<a href="104_00_idea.html">Getting Started</a><br>
<a href="106_00_interface.html">The Global User Interface</a><br>
<a href="107_00_sprites.html">Defining Sprites</a><br>
<a href="108_00_sounds.html">Sounds and Music</a><br>
<a href="109_00_backgrounds.html">Backgrounds</a><br>
<a href="110_00_objects.html">Defining Objects</a><br>
<a href="111_00_events.html">Events</a><br>
<a href="112_00_actions.html">Actions</a><br>
<a href="113_00_rooms.html">Creating Rooms</a><br>
<a href="114_00_distributing.html">Distributing your Game</a><br>
</blockquote>
<!--ENDHELPONLY-->
<!--END-->
</body>
</html>

View File

@ -1,96 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>So you want to create your own computer games</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>So you want to create your own computer games</h1>
<p>
Playing computer games is fun. But it is actually more fun to design your own computer
games and let other people play them. In the past, creating computer games was not easy.
Commercial computer games you buy nowadays typically take one or two years of
development with teams of anywhere between 10 and 50 people. Budgets easily reach
millions of dollars. And all these people are highly experienced: programmers,
art designers, sound technicians, etc.
</p>
<p>
But <i>Game Maker</i> has changed this. With <i>Game Maker</i> you can
create your own computer games quickly without the need to learn a
programming language.
Of course you should not expect to create your
own <i>Halo 4</i> or <i>Virtua Tennis</i> within a few weeks. But that is
also not necessary. The joy of playing a game is not related to its complexity.
Simpler games, like <i>Tetris</i>, <i>Bejeweled</i>,
<i>Space Invaders</i>, etc. are a lot of fun to play and a lot easier to create.
</p>
<p>
<i>Game Maker</i> offers an intuitive and easy to use drag-and-drop interface
that allows you to create
your own games very quickly. You can import and create images, sprites
(animated images) and sounds and use them. <i>Game Maker</i> is bundled with
a considerable collection of such resources to get you started.
You can easily define the objects
in your game and indicate their behavior, and you can define appealing
rooms (levels) in which the game takes place. And if
you want full control there is actually an easy-to-use programming language
built into <i>Game Maker</i> that gives you full control over what is happening in your game.
</p>
<p>
<i>Game Maker</i> focuses on two-dimensional games. So it is not
meant to create 3D worlds like <i>Quake</i>, even though there is some
limited functionality for 3D graphics.
But don<6F>t let this put you down. Many great games use two-dimensional
sprite technology, even though they look very 3-dimensional. And designing
two-dimensional games is a lot easier and faster.
</p>
<p>
<i>Game Maker</i> comes in two editions, the Lite Edition and the Pro Edition.
The Lite Edition can be used free of charge but it is limited in its functionality
and will display popup messages. You can though freely distribute
the games you create with it; you can even sell them if you like.
See the enclosed license agreement for more details.
You are strongly encouraged to upgrade your copy of <i>Game Maker</i> to the Pro Edition.
It will considerably extend the functionality of <i>Game Maker</i>
and it will remove the logo when running games.
This will also support the further development of <i>Game Maker</i>.
For more information on upgrading see the <A HREF="103_00_pro.html">Pro Edition</A> page.
</p>
<p>
This help file will tell you the most important things you need to know about <i>Game Maker</i>
and how you can create your own games with it. Please realize that,
even with a program like <i>Game Maker</i>, designing computer games
is not completely effortless. There are too many aspects that are important:
game play, graphics, sounds, user interaction, etc. Start with easy
examples and you will realize that creating games is great fun.
Also check the web site
</p>
<p>
<a href="http://www.yoyogames.com/" target="_blank">http://www.yoyogames.com/</a>
</p>
<p>
for lots of examples, tutorials, ideas, and links to other sites and forums.
And soon you will become a master game maker yourself. Enjoy.
</p>
<!--END-->
</body>
</html>
<!-- KEYWORDS
introduction
creating games
website
-->

View File

@ -1,80 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Installation</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Installation</h1>
<p>
You probably already did this but if not, here is how to install <i>Game Maker</i>.
Simply run the program <tt>gmaker80.exe</tt>. Follow the on-screen instructions.
You can install the program anywhere you like but it is best to follow the default
suggestions given. Once installation is completed, in the Start menu you will
find a new program group where you can start <i>Game Maker</i>
and read the help file.
</p>
<p>
<i>Game Maker</i> also installs a considerable number of images, sprites (animated images)
and sound effects on your computer, which can be used free of charge in your games. Also
some example games are installed. All these can be found in folders within the
location where you installed <i>Game Maker</i>.
</p>
<p>
The first time you run <i>Game Maker</i> you are asked whether you
want to run the program in <b>Simple</b> or <b>Advanced</b> mode.
If you have not used a game creation program before and you are not an
experienced programmer, you had better use simple mode (so select <b>No</b>).
In simple mode fewer options are shown. You can easily switch to
advanced mode later using the appropriate item in the <b>File</b> menu.
</p>
<p>
You will also be shown a tutorial at the right of the window. The tutorial
will teach you how to quickly create your first game. It will guide you through
the basic steps in using <i>Game Maker</i>. If you have not used <i>Game Maker</i>
before you are strongly advised to work your way through the tutorial. You can
always try the tutorial later through the <b>Help</b> menu.
</p>
<h4>Requirements</h4>
<p>
Any computer that is less than five years old should be able to run <i>Game Maker</i> without any problems.
</p>
<p>
To be more precise, <i>Game Maker</i> requires a resonably modern PC running Windows 2000, XP, Vista, 7, or later.
A DirectX 8 (or later) compatible graphics card with at least 32MB of memory is required for most created games.
It requires a screen resolution of at least 800x600 and 65000 (16-bit) colors (preferably full color).
Also a DirectX 8 compatible sound card is required. Make sure you have the most recent drivers installed.
<i>Game Maker</i> requires DirectX version 8.0 or later to be installed on your computer.
(You can download the newest version of DirectX from the Microsoft website at:
<a href="http://www.microsoft.com/windows/directx/" target="_blank">http://www.microsoft.com/windows/directx/</a>.)
When designing and testing games, the memory requirements are pretty high
(at least 128 MB and preferably more, also depending on the operating system). When just running games, the memory
requirements are less severe and depend a lot on the type of game.
</p>
<!--END-->
</body>
</html>
<!-- KEYWORDS
installation
system requirements
folders
examples
tutorial
DirectX
simple mode
advanced mode
mode, simple
mode, advanced
-->

View File

@ -1,123 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Upgrading to the Pro Edition</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Upgrading to the Pro Edition</h1>
<i>Game Maker</i> comes in two editions, the Lite Edition and the Pro Edition.
<p>
The <b>Lite Edition</b> is meant for those that take their first steps on the
path of developing games. It can be used for free but is limited in its
functionality. Also it shows a popup logo when running games and will regularly
remind you of upgrading the program. When you are using <i>Game Maker</i> regularly
you are strongly recommended to upgrade it to the Pro Edition.
<p>
The <b>Pro Edition</b> contains considerably more functionality and does not display any
logos or popup messages. More precisely, the Pro Edition has the following
additional functionality:
<ul>
<li>No <i>Game Maker</i> logo is shown when running a game.</li>
<li>No regular popups remind you of upgrading.</li>
<li>You can use rotated, color blended and translucent sprites.</li>
<li>There are additional options in the sprite and image editors.</li>
<li>There are additional actions for e.g. CD music, rotated text, and colorized shapes.</li>
<li>You can use special sound effects and positional sound.</li>
<li>You can create splash screens with movies, images, webpages, texts, etc.</li>
<li>There is a particle system to create explosions, fireworks, flames, rain, and other effects.</li>
<li>A number of advanced drawing functions are available, for example colorized text and textured polygons.</li>
<li>It is possible to create 3D games using functions for 3D graphics.</li>
<li>It is possible to create multiplayer games that can be played over a network.</li>
<li>You can define your own room transitions.</li>
<li>You can use functions to create, load, and modify resources (sprites, backgrounds, etc.)
while the game is running.</li>
<li>There is a collection of functions to create and use data structures.</li>
<li>There are functions for motion planning.</li>
<li>You get the possibility to include additional files in the game executables
that can be used when the game is run.</li>
<li>The Pro Edition can easily be extended using extension package. These can be made by
everybody and will in general be provided free of charge.</li>
<li>Three such extension packages are included adding many room transitions, windows
dialogs, and printing facilities.</li>
<li>You can define your own trigger events.</li>
<li>You can export and import resources, which makes it easier to collaborate on games.</li>
</ul>
<p>
<p>
Upgrading the Lite Edition to the Pro Edition costs only 20 Euro or US $25
(subject to change). This is a one-time fee that will at least be valid
for all versions 8.x of <i>Game Maker</i>.
</p>
<p>
When you are running the Lite Edition, whenever you start <i>Game Maker</i> the following
form will be shown:
</p>
<p>
<img src="images/form_upgrade.jpg">
<p>
You can use this
form to upgrade to the Pro Edition. There are a number of ways to do this.
</p>
<p>
The easiest way is to purchase the upgrade online. To this end press the button <b>Purchase Pro Edition Online</b>.
You will be brought to a webpage where you can make you payment either by credit card or through PayPal.
The payment will be handled by the company SoftWrap that is our authorized payment processor.
Once you made the payment the software will immediately be upgraded to the Pro Edition without
any further action from your side. Carefully save (and print) the confirmation you receive
as it contains your purchase reference that you might need later if you want to reinstall the software.
(When you are running the program, you can also upgrade online by choosing <b>Upgrade to Pro Edition</b>
in the <b>Help</b> menu.)
</p>
<p>
If you purchased <i>Game Maker</i> before (and hence, have an activation code or a previous purchase reference)
press the button <b>Enter Activation Code</b>. You will be brought to a webpage where you can either enter
your activation code or your purchase reference from your previous payment. Here you can also retrieve your
license if you lost it. After you filled in the correct information <i>Game Maker</i> will be upgraded to
the Pro Edition. Note that you must have an Internet connection for activation.
(When you are running the program, you can also upgrade on line by choosing <b>Enter Activation Code</b>
in the <b>Help</b> menu.)
</p>
<p>
If you don't want to upgrade to the Pro Edition at this stage, press the button
<b>Continue Using the Lite Edition</b>.
</p>
<!--END-->
</body>
</html>
<!-- KEYWORDS
lite edition
pro edition
upgrade
activation code
purchase online
extra features
additional features
splash screen, removing
registration
PayPal
credit card payment
cash payment
bank transfer
fee, registration
price
payment
SoftWrap
-->

View File

@ -1,127 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Getting Started</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Getting started</h1>
<p>
Creating your first game is always a challenge. But if you are willing to
put a little bit of effort in it, it will actually be rather easy. You can
have it running within an hour.
</p>
<p>
Even though it is really easy to make games with <i>Game Maker</i> you will
need to understand some of the basic concepts. To this end you are strongly
recommended to follow the tutorial that is shown when <i>Game Maker</i> is started.
If you did remove the tutorial from view, you can always make it visible again
by choosing <b>Tutorial</b> in the <b>Help</b> menu.
</p>
<h3>The Global idea</h3>
<p>
Before delving into the possibilities of <i>Game Maker</i> it is good to
get a feeling for the global idea behind the program. Games created
with <i>Game Maker</i> take place in one or more <i>rooms</i>. (Rooms are
flat, not 3D, but they can contain 3D-looking graphics.) In these rooms
you place <i>objects</i>, which you can define in the program. Typical
objects are the walls, moving balls, the main character, monsters, etc.
Some objects, like walls, just sit there and don<6F>t do anything. Other
objects, like the main character, will move around and react to input
from the player (keyboard, mouse, and joystick) and to each other. For
example, when the main character meets a monster he might die. Objects
are the most important ingredients of games made with <i>Game Maker</i>,
so let us talk a bit more about them.
</p>
<p>
First of all, most objects need some image to make them visible on the
screen. Such images are called <i>sprites</i>. A sprite is often not a
single image but a set of images that are shown one after the other to
create an animation. In this way it looks like the character walks, a
ball rotates, a spaceship explodes, etc. During the game, the sprite for a
particular object can change. (So the character can look different when
it walks to the left or to the right.) You can create you own sprites in
<i>Game Maker</i> or load them from files (e.g. PNG files or animated GIF<49>s).
Many sprites come bundled with <i>Game Maker</i> that you can use free
of charge in your games.
</p>
<p>
Certain things will happen to objects. Such happenings are called <i>
events</i>. Objects can take certain <i>actions</i> when events happen.
There are a large number of different events that can take place and a
large number of different actions that you can let your objects take. For
example, there is a <i>creation event</i> when the object gets created.
(To be more precise, when an instance of an object gets created; there
can be multiple instances of the same object.) For example, when a ball
object gets created you can give it some motion action so that it
starts moving. When two objects meet, you get a <i>collision event</i>. In
such a case you can make the ball stop or reverse direction. You can also
play a sound effect. To this end <i>Game Maker</i> lets you define <i>
sounds</i>. When the player presses a key on the keyboard there is a <i>
keyboard event</i>, and the object can take an appropriate action, like
moving in the direction indicated. We hope you get the idea. For each
object you design, you can indicate actions for various events; in this
way defining the behavior of the object.
</p>
<p>
Once you have defined your objects it is time to define the <i>rooms</i>
in which they will live. Rooms can be used for levels in your game or to
check out different places. There are actions to move from one room to
another. Rooms, first of all, have a <i>background</i>. This can be a
simple color or an image. Such background images can be created in <i>
Game Maker</i> or you can load them from files. (The background can do a
lot of things but for the time being, just consider it as something that
makes the rooms look nice.) Next, you can place the objects in the room.
You can place multiple instances of the same object in a room. So, for
example, you need to define just one wall object and can use it at many
places. Also you can have multiple instances of the same monster objects,
as long as they have the same behavior.
</p>
<p>
Now you are ready to run the game. The first room will be shown and
objects will come to life because of the actions in their creation
events. They will start reacting to each other due to actions in
collision events and they can react to the player using the actions in
keyboard or mouse events.
</p>
<p>
So in summary, the following things (often called resources) play a
crucial role:
</p>
<ul>
<li><i>objects</i>: which are the true entities in the game</li>
<li><i>rooms</i>: the places (levels) in which the objects live</li>
<li><i>sprites</i>: (animated) images that are used to represent the objects</li>
<li><i>sounds</i>: these can be used in games, either as background music or as effects</li>
<li><i>backgrounds</i>: the images used as background for the rooms</li>
</ul>
<p>
There are actually a number of other types of resources: paths, scripts,
fonts, and time lines. These are only important for more complicated
games. You will only see them when you run <i>Game Maker</i> in advanced
mode. They will be treated in the advanced chapters later in this
document.
</p>
<!--END-->
</body>
</html>
<!-- KEYWORDS
global idea
resources
tutorial
-->

View File

@ -1,212 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>The global user interface</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>The global user interface</h1>
When you start <i>Game Maker</i> the following form is shown. Note that the
form might in reality also show some <i>Game Maker</i> news and the tutorial
might be visible at the right side.
<p>
<img src="images/form_main.jpg">
<p>
(Actually, this is what you see when you run <i>Game Maker</i> in simple
mode. In advanced mode a number of additional items are shown.) At the
left, you see the different resources mentioned above: Sprites, Sounds,
Backgrounds, Objects, Rooms and two more: Game Information and Global Game
Settings. At the top there is the familiar menu and toolbar. In this
chapter we will describe briefly the various menu items, buttons, etc. In
the later chapters we discuss a number of them in detail. Note that many
things can be achieved in different ways: by choosing a command from the
menu, by clicking a button, or by right clicking on a resource.
<h3>File menu</h3>
In the file menu you can find some of the usual commands to load and save
files, plus a few special ones:
<ul>
<li><b>New</b>. Choose this command to start creating a new game. If
the current game was changed you are asked whether you want to save it.
There is also a toolbar button for this.</li>
<li><b>Open</b>. Opens a game file. <i>Game Maker</i> files have the
extension .gmk. You can also open old .gm6 files. (If you want to open .gmd files
created with version 5 of <i>Game Maker</i> you must select the appropriate
file type at the bottom of the dialog. These might though not
work correctly in the new version.) There is a toolbar button for this command. You can also
open a game by dragging the file into the <i>Game Maker</i> window.</li>
<li><b>Recent Files</b>. Use this submenu to reopen game files you
recently opened.</li>
<li><b>Save</b>. Saves the game design file under its current name. If
no name was specified before, you are asked for a new name. You can only
use this command when the file was changed. Again, there is a toolbar
button for this.</li>
<li><b>Save As</b>. Saves the game design file under a different name.
You are asked for a new name. </li>
<li><b>Create Executable</b>. Once your game is ready you will probably want
to give it to others to play. Using this command you can create a stand-
alone version of your game. This is simply an executable that you can
give to other people to run.</li>
<li><b>Advanced Mode</b>. When clicking on this command <i>Game Maker
</i> will switch between simple and advanced mode. In advanced mode
additional commands and resources are available.</li>
<li><b>Exit</b>. Probably obvious. Press this to exit <i>Game Maker
</i>. If you changed the current game you will be asked whether you want
to save it.</li>
</ul>
<h3>Edit menu</h3>
The edit menu contains a number of commands that relate to the currently
selected resource (object, sprite, sound, etc.). Depending on the type of
resource some of the commands may not be visible.
<ul>
<li><b>Insert resource</b>. Inserts a new instance of the currently
selected type of resource before the current one. A form will open in
which you can change the properties of the resource. This will be treated
in detail in the following chapters.</li>
<li><b>Duplicate</b>. Makes a copy of the current resource and adds it.
A form is opened in which you can change the resource.</li>
<li><b>Delete</b>. Deletes the currently selected resource (or group of
resources). Be careful. This cannot be undone. You will, though, be warned.</li>
<li><b>Rename</b>. Gives the resource a new name. This can also be done
in the property form for the resource. Also, you can select the resource
and then click on the name.</li>
<li><b>Properties</b>. Use this command to bring up the form to edit
the properties. Note that all the property forms appear within the main
form. You can edit many of them at the same time. You can also edit the
properties by double clicking on the resource.</li>
</ul>
Note that all these commands can also be given in a different way. Right-
click on a resource or resource group, and the appropriate pop-up menu
will appear.
<h3>Resources menu</h3>
In this menu, you can create new resources of each of the different types.
Note that for each of them there is also a button on the toolbar and a
keyboard shortcut. Also you can change the game information and the global
game settings.
<h3>Run menu</h3>
This menu is used to run the game. There are two ways to run a game.
<ul>
<li><b>Run normally</b>. Runs the game as it would normally run.
The game is run in the most efficient way and will look and act as in an executable game.</li>
<li><b>Run in Debug mode</b>. Runs the game in debug mode. In this mode
you can check certain aspects of the game and you can pause and step
through it. This is useful when something goes wrong but is a bit
advanced.</li>
</ul>
Once your game is finished, you can create a stand-alone executable of
the game using the command in the file menu.
<h3>Window menu</h3>
In this menu you find some of the usual commands to manage the different
property windows in the main form:
<ul>
<li><b>Cascade</b>. Cascade all the windows such that each of them is
partially visible.</li>
<li><b>Arrange Icons</b>. Arrange all the iconified property windows.
(Useful in particular when resizing the main form.)</li>
<li><b>Close All</b>. Close all the property windows, asking the user
whether or not to save the changes made.</li>
</ul>
<h3>Help menu</h3>
Here you find some commands to help you:
<ul>
<li><b>Contents</b>. Use this command to show this help file.</li>
<li><b>Tutorials</b>. Use this submenu to show the different tutorials that are provided with <i>Game Maker</i>
to teach you how to make your first games.</li>
<li><b>Upgrade to Pro Edition</b>. You can use this command to upgrade the Lite Edition
of <i>Game Maker</i> to the Pro Edition Online. The Pro Edition has
many aditional features.</li>
<li><b>Enter Activation Code</b>. If you purchased <i>Game Maker</i> before (and hence, have an
activation code or a previous purchase reference) you can use this command to enter your code.
You will be brought to a webpage where you can either enter
your activation code or your purchase reference from your previous payment.</li>
<li><b>News</b>. Here you can see the most recent news about <i>Game Maker</i>.</li>
<li><b>Book</b>. This command will bring you to
a location on the website where you can find information about the <i>Game Maker</i> book.</li>
<li><b>More Tutorials</b>. This command will bring you to
a location on the website where you can download some more tutorials.</li>
<li><b>Website</b>. Connects you to the <i>Game Maker</i> website
where you can find information about the most recent version of <i>Game
Maker</i> and collections of games and resources for <i>Game Maker</i>.</li>
<li><b>Forum</b>. This command will bring you to the forum where users
help each other with many aspects of <i>Game Maker</i>.</li>
<li><b>Wiki</b>. This command will bring you to the <i>Game Maker</i> wiki where
you can find plenty of information about the use of <i>Game Maker</i>.</li>
<li><b>About <i>Game Maker</i></b>. Gives some short information about
this version of <i>Game Maker</i>.</li>
</ul>
<h3>The resource explorer</h3>
At the left of the main form you find the resource explorer. Here you
will see a tree-like view of all resources in your game. It works in the
same way as the Windows Explorer, and you are most likely familiar with
it. If an item has a + sign in front of it you can click on the sign to
see the resources inside it. By clicking on the - sign these disappear
again. You can change the name of a resource (except the top level ones) by
selecting it (with a single click) and then clicking on the name. Double
click on a resource to edit its properties. Use the right mouse button to
access the same commands as in the Edit menu.
<p>
You can change the order of the resources by clicking on them with the
mouse and holding the mouse button pressed. Now you can drag the resource
to the appropriate place. (Of course the place must be correct. You
cannot drag a sound into the list of sprites.)
<!--END-->
</body>
</html>
<!-- KEYWORDS
interface
resources
main interface
menus
loading games
saving games
create executable
stand-alone game
advanced mode
simple mode
mode,simple
mode,advanced
adding resources
creating resources
rename
duplicate
running games
debug mode
windows
recent files
-->

View File

@ -1,99 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Defining sprites</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Defining sprites</h1>
Sprites are the visual representations of all the objects in the game. A
sprite is either a single image, drawn with any drawing program you like,
or a set of images that, when played one after another, looks like an
animated motion. For example, the following four images form a sprite for
a character moving to the right.
<p>
<img src="images/sprite.jpg">
<p>
When you make a game you normally start by collecting a set of nice
sprites for the objects in your game. A considerable number of useful sprites is
bundled with <i>Game Maker</i>. Other collections of interesting
sprites can be found on the <i>Game Maker</i> website. Many more
sprites can be found on the web, normally in the form of png or animated gif
files.
<p>
To create a sprite, choose the item <b>Create</b> Sprite from the <b>Resources</b>
menu, or use the corresponding button on the toolbar. The following form
will pop up.
<p>
<img src="images/form_sprite.jpg">
<p>
At the top-left you can indicate the name of the sprite. All sprites (and all
other resources) have a name. It's best to give each sprite a descriptive
name. Make sure all resources get different names. Even though this is
not strictly required, you are strongly advised to use only letters and
digits and the underscore symbol (_) in a name of a sprite (and any other
resource) and to let it start with a letter. In particular don't use the
space character. This will become important once you start using code.
<p>
To load a sprite, click on the button <b>Load Sprite</b>. A special file
dialog opens in which you can choose the sprite:
<p>
<img src="images/sprite_dialog.jpg">
<p>
The left part looks like the standard file selector in which you can select the
sprite that you want. At the right you get a preview of the animated sprite and
some information about it. Here you can also indicate that you want to make the
sprite opaque (that is, remove any transparent parts), whether
to remove the background, making it transparent (default), and whether to smooth the
edges of the sprite, which can improve its appearance. When you are happy with
the result press <b>Open</b> to load the sprite.
<p>
<i>Game Maker</i> can
load many different graphics files. When you load an animated gif, the
different subimages form the sprite images.
When the file name ends with _stripXX, with XX a number, it
is considered to contain a strip of XX subimages next to each other (not for
gif files). For example, a image file with name ball_strip4.png is assumed to
contain 4 subimages.
<p>
Once the sprite is loaded
the first subimage is shown on the right. When there are multiple sub-
images, you can cycle through them using the arrow buttons.
<p>
With the button <b>Edit Sprite</b> you can edit the sprite, or even
create a completely new sprite. <i>Game Maker</i> has an extensive built-in sprite
and image editor. For more information see the sections on
<a href="202_01_editing.html">Editing your sprites</a> and on
<a href="202_03_individual.html">Editing individual subimages</a>.
<!--END-->
</body>
</html>
<!-- KEYWORDS
adding sprites
creating sprites
sprites
images
loading sprites
transparent sprites
editing sprites
sprites, subimages
GIF files
PNG files
strips
animated sprites
-->

View File

@ -1,52 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Sound and music</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Sounds and music</h1>
Most games have certain sound effects and some background music. Many useful
sound effects can be found on the <i>Game Maker</i> website. Many more can be
found on other places on the web.
<p>
To create a sound resource in your game, use the item <b>Create Sound</b> in
the <b>Resources</b> menu or use the corresponding button on the toolbar.
The following form will pop up.
<p>
<img src="images/form_sound.jpg">
<p>
To load a sound, press the button labeled <b>Load Sound</b>.
A file selector dialog pops up in which you can select the sound file.
There are two types of sound files, wave files and midi files.
Wave files are used for short sound effects. They use a lot of memory
but play instantaneously. Use these for all the sound effects in your game.
Midi files describe music in a different way. As a result they use a lot
less memory, but they are limited to instrumental background music.
Also, default only one midi sound can play at any time.
<p>
Once you load a music file you can listen
to the sound using the play button. There is also a button <b>Save Sound</b>
to save the current sound to a file. This button is not really required
but you might need it if you lost the original sound.
<!--END-->
</body>
</html>
<!-- KEYWORDS
adding sounds
creating sounds
sounds
music
midi files
wave files
saving sounds
-->

View File

@ -1,65 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Backgrounds</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Backgrounds</h1>
The third type of basic resource is backgrounds. Backgrounds are usually large images
that are used as backgrounds (or foregrounds) for the rooms in which the game takes place.
Often background images are made in such a way that they can tile an area without visual
cracks. In this way you can fill the background with some pattern. A number of such
useful backgrounds are bundled with <i>Game Maker</i>. Others can be found on the
<i>Game Maker</i> website. Many more can be found at other places on the web.
<p>
To create a background resource in your game, use the item <b>Create Background</b>
in the <b>Resources</b> menu or use the corresponding button on the toolbar.
The following form will pop up.
<p>
<img src="images/form_background.jpg">
<p>
At the top-left you can indicate the name of the background.
You are strongly recommended to give every background (and other resource)
a descriptive name.
<p>
Press the button <b>Load Background</b> to load a background image. A file
selector is shown in which you can select the background you want. At the
right of the dialog you can indicate whether you want to make the
background opaque (that is, remove any transparent parts), whether
to remove the background, making it transparent (default not), and whether to smooth the
edges of the background, which can improve its appearance when it is partially transparent.
When you are happy with the result press <b>Open</b> to load the background.
<i>Game Maker</i> supports many image formats. Background images cannot
be animated!
<p>
You can change the background or create a new one using the button
<b>Edit Background</b>. This will open an extensive image editor. For
information on how to use the image editor see the section on
<a href="202_03_individual.html">Editing images</a>.
<p>
Be careful with large backgrounds. Some old graphics cards cannot handle images that are larger
than the screen. So preferably keep your background images smaller than 1024x1024. </p>
<!--END-->
</body>
</html>
<!-- KEYWORDS
adding backgrounds
creating resources
backgrounds
background images
transparent backgrounds
editing backgrounds
-->

View File

@ -1,87 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Defining objects</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Defining objects</h1>
With the resources you have seen so far you can add some nice images and
sounds to the game, but they don't do anything. We now come to the most
important resource of <i>Game Maker</i>, the objects. Objects are
entities in the game that do things. Most of the time they have a sprite
as a graphical representation so that you see them. They have behavior
because they can react to certain events. All things you see in the game
(except for the background) are objects. (Or to be more precise, they are
instances of objects.) The characters, the monsters, the balls, the
walls, etc. are all objects. There might also be certain objects that you
don't see but which control certain aspects of the game play.
<p>
Please realize the difference between sprites and objects. Sprites are
just (animated) images that don't have any behavior. Objects normally
have a sprite to represent them but objects have behavior. Without
objects there is no game!
<p>
Also realize the difference between objects and instances. An object
describes a certain entity, e.g. a monster. There can be multiple
instances of this object in the game. When we talk about an instance we
mean one particular instance of the object. When we talk about an object
we mean all the instances of this object.
<p>
To create an object in your game, choose <b>Create Object</b> from the <b>Resources</b>
menu. The following form will appear:
<p>
<img src="images/form_object.jpg">
<p>
This is rather complex. At the left there is some general information
about the object. In the middle there is the list of events that can
happen to the object. At the right there are the different actions the
object can perform. Events and actions will be discussed in the coming
chapters.
<p>
As always, you can (and should) give your object a name. Next you can
choose the sprite for the object. To this end, click with the left
mouse button on the sprite box or the menu button next to it. A menu will
pop-up with all the available sprites. Select the one you want to use for
the object.
If you do not have a sprite yet, you can click the button <B>New</B> to
create a new sprite resource and change it. Also, when you select a resource
there will be a button <B>Edit</B> here that you can use to change the
sprite. This is faster than first finding the resource in the list of
resources and then indicating you want to edit it.
<P>
Below this there are two check boxes. <b>Visible</b> indicates whether
instances of this object are visible. Clearly, most objects are visible,
but sometimes it is useful to have invisible objects. For example, you
can use them for waypoints for a moving monster. Invisible objects will
react to events and other instances do collide with them. The box labeled
<b>Solid</b> indicates whether this is a solid object (like a wall).
Collisions with solid objects are treated differently from collisions
with non-solid objects. You are strongly advised to use <b>Solid</b> only
for object that are not moving.
<!--END-->
</body>
</html>
<!-- KEYWORDS
adding objects
creating objects
objects
instances
object properties
object sprite
solid
visible
-->

View File

@ -1,302 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Events</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Events</h1>
<i>Game Maker</i> 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.
<p>
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 <b>Add Event</b>. 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. 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:
<p>
<img src="images/form_event_panel.jpg">
<p>
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.
<p>
You can change the order of the actions in the list again using drag-and-drop. If you
hold the &lt;Alt&gt; 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 &lt;Del&gt; key) or copy and paste actions. (You can
select multiple actions for cutting, copying, or deleting by holding the
&lt;Shift&gt; key of &lt;Ctrl&gt; key. Press &lt;Ctrl&gt;&lt;A&gt; 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.
<p>
To delete the currently selected event together with all its actions press the button
labeled <b>Delete</b>. (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 <b>Change</b> 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.
<p>
As indicated above, to add an event, press the button <b>Add Event</b>. The following
form pops up:
<p>
<img src="images/form_event_selector.jpg">
<p>
Here you select the event you want to add. Sometimes a menu pops up with extra
choices. Here is a description of the various events. (Again remember that you
normally use only a few of them.)
<p>
<b><img src="images/event_create.bmp"> Create event</b><br>
This event happens when an instance of the object is created. It is normally used to
set the instance in motion and/or to set certain variables for the instance.
<p>
<b><img src="images/event_destroy.bmp"> Destroy event</b><br>
This event happens when the instance is destroyed. To be precise, it happens just
before it is destroyed, so the instance does still exist when the event is executed!
Most of the time this event is not used but you can for example use it to change the score or
to create some other object.
<p>
<b><img src="images/event_timer.bmp"> Alarm events</b><br>
Each instance has 12 alarm clocks.
You can set these alarm clocks using certain actions
(see next chapter). The alarm clock then ticks down until it reaches 0 at which moment
the alarm event is generated. To indicate the actions for a given alarm clock, you
first need to select it in the menu. Alarm clocks are very useful. You can use them to
let certain things happen from time to time. For example a monster can change its
direction of motion every 20 steps. (In such cases one of the actions in the event
must set the alarm clock again.)
<p>
<b><img src="images/event_step.bmp"> Step events</b><br>
The step event happens every step of the game. Here you can put actions that need to
be executed continuously. For example, if one object should follow another, here you
can adapt the direction of motion towards the object we are following. Be careful with
this event though. Don't put many complicated actions in the step event of objects of
which there are many instances. This might slow the game down. To be more precise,
there are three different step events. Normally you only need the default one. But
using the menu you can also select the begin step event and the end step event. The
begin step event is executed at the beginning of each step, before any other events
take place. The normal step event is executed just before the instances are put in
their new positions. The end step event is executed at the end of the step, just
before the drawing. This is typically used to change the sprite depending on
the current direction. </p>
<p>
<b><img src="images/event_collision.bmp"> Collision events</b><br>
Whenever two instances collide (that is, their sprites overlap) a collision event
appears. Well, to be precise two collision event occur; one for each instance. The
instance can react to this collision event. To this end, from the menu select the
object with which you want to define the collision event. Next you place the actions
here.
<p>
There is a difference in what happens when the instance collides with a solid object
or a non-solid object. First of all, when there are no actions in the collision event,
nothing happens. The current instance simply keeps on moving; even when the other
object is solid. When the collision event contains actions the following happens:
<p>
When the other object is solid, the instance is placed back at its previous place
(before the collision occurs). Then the event is executed. Finally, the instance is
moved to its new position. So if the event e.g. reverses the direction of motion, the
instance bounces against the wall without stopping. If there is still a collision, the
instance is kept at its previous place. So it effectively stops moving.
<p>
When the other object is not solid, the instance is not put back. The event is simply
executed with the instance at its current position. Also, there is no second check for
a collision. If you think about it, this is the logical thing that should happen.
Because the object is not solid, we can simply move over it. The event notifies us
that this is happening.
<p>
There are many uses for the collision event. Instances can use it to bounce against
walls. You can use it to destroy objects when, for example, they are hit by a bullet.
<p>
<b><img src="images/event_keyboard.bmp"> Keyboard events</b><br>
When the player presses a key, a keyboard event happens for all instances of all
objects. There is a different event for each key. In the menu you can pick the key for
which you want to define the keyboard event and next drag actions there. Clearly, only
a few objects need events for only a few keys. You get an event in every step as long
as the player keeps the key depressed. There are two special keyboard events. One is called
&lt;No key&gt;. This event happens in each step when no key is pressed. The second one
is called &lt;Any key&gt; and happens whatever key is pressed. When the player
presses multiple keys, the events for all the keys pressed happen. Note that the keys
on the numeric keypad only produce the corresponding events when &lt;NumLock&gt; is
pressed.
<p>
<b><img src="images/event_mouse.bmp"> Mouse events</b><br>
A mouse event happens for an instance whenever the mouse cursor lies inside the sprite
representing the instance. Depending on which mouse buttons are pressed you get the no
button, left button, right button, or middle button event. The mouse button events are
generated in each step as long as the player keeps the mouse button pressed. The press
events are only generated once when the button is pressed. The release events are only
generated when the button is released. Note that these events only occur when the
mouse is above the instance. If you want to react to mouse press or release events at
an arbitrary place, use the global mouse events that can be found in a submenu. There are
two special mouse events. The mouse enter event happens when the mouse enters the
instance. The mouse leave event happens when the mouse leaves the instance. These
events are typically used to change the image or play some sound.
Mouse wheel up and mouse wheel down events happen when the user moves the mouse wheel.
Finally there are a
number of events related to the joystick. You can indicate actions for the four main
directions of the joystick (in a diagonal direction both events happen). Also you can
define actions for up to 8 joystick buttons. You can do this both for the primary
joystick and the secondary joystick.
<p>
<b><img src="images/event_other.bmp"> Other events</b><br>
There are a number of other events that can be useful in certain games. They are found
in this menu. The following events can be found here:
<ul>
<li><b>Outside room</b>: This event happens when the instance lies completely outside the
room. This is typically a good moment to destroy it.</li>
<li><b>Intersect boundary</b>: This event happens when the instance intersects the boundary of
the room, that is, it lies (at least) partially outside the room.</li>
<li><b>Views</b>: Here you find a number of events that are useful when you use
views in your rooms. These events test whether the instance lies completely outside
a particular view or interesects the view boundary.</li>
<li><b>Game start</b>: This event happens for all instances in the first room when
the game starts. It happens before the room start event (see below) but after the
creation events for the instances in the room. This event is typically defined in only
one &quot;controller&quot; object and is used to start some background music and to
initialize some variables, or load some data.</li>
<li><b>Game end</b>: The event happens to all instances when the game ends. Again
typically just one object defines this event. It is for example used to store certain
data in a file.</li>
<li><b>Room start</b>: This event happens for all instances initially in a room when
the room starts. It happens after the creation events.</li>
<li><b>Room end</b>: This event happens to all existing instances when the room ends.</li>
<li><b>No more lives</b>: <i>Game Maker</i> has a built-in lives system. There is an
action to set and change the number of lives. Whenever the number of lives becomes
less than or equal to 0, this event happens. It is typically used to end or restart
the game.</li>
<li><b>No more health</b>: <i>Game Maker</i> has a built-in health system. There is
an action to set and change the health. Whenever the health becomes less than or equal
to 0, this event happens. It is typically used to reduce the number of lives or to
restart the game.</li>
<li><b>Animation end</b>: As indicated above, an animation consists of a number
of images that are shown one after the other. After the last one is shown we start
again with the first one. The event happens at precisely that moment. As an example,
this can be used to change the animation, or destroy the instance.</li>
<li><b>End of path</b>: This event happens when the instance follows a path and the
end of the path is reached.</li>
<li><b>Close button</b>: This event happens when the user clicks on the close button
of the window. This only happens when disabling in the game settings the option to have
the close button behave as the Escape key.</li>
<li><b>User defined</b>: There are 16 of these events. They normally never happen
unless you yourself call them from a piece of code.</li>
</ul>
<p>
<b><img src="images/event_draw.bmp"> Draw event</b><br>
Instances, when visible, draw their sprite in each step on the screen. When you
specify actions in the drawing event, the sprite is not drawn, but these actions are
executed instead. This can be used to draw something other than the sprite, or first
make some changes to sprite parameters. There are a number of drawing actions that are
especially meant for use in the drawing event. Note that the drawing event is only
executed when the object is visible. Also note that, independent of what you draw,
collision events are based on the sprite that is associated with the instance.
<p>
<b><img src="images/event_keypress.bmp"> Key Press events</b><br>
This event is similar to the keyboard event but it happens only once when the key
is pressed, rather than continuously. This is useful when you want an action to
happen only once.
<p>
<b><img src="images/event_keyrelease.bmp"> Key Release events</b><br>
This event is similar to the keyboard event but it happens only once
when the key is released, rather than continuously.
<p>
In some situation it is important to understand the order in which
<i>Game Maker</i> processes the events. This is as follows:
<ul>
<li>Begin step events</li>
<li>Alarm events</li>
<li>Keyboard, Key press, and Key release events</li>
<li>Mouse events</li>
<li>Normal step events</li>
<li>(now all instances are set to their new positions)</li>
<li>Collision events</li>
<li>End step events</li>
<li>Draw events</li>
</ul>
<p>
The create, destroy, and other events are performed when the corresponding things
happen.
<!--END-->
</body>
</html>
<!-- KEYWORDS
events
adding events
deleting events
changing events
create event
destroy event
alarm event
step event
collision event
keyboard event
key press event
key release event
mouse event
joystick event
other events
drawing event
outside event
boundary event
room start event
room end event
game start event
game end event
no more lives event
no more health event
end of animation event
user defined events
event order
order of events
-->

View File

@ -1,87 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Actions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Actions</h1>
Actions indicate the things that happen in a game created with <i>Game Maker</i>.
Actions are placed in events of objects. Whenever the event takes place these
actions are performed, resulting in certain behavior for the instances of the object.
There are a large number of different actions available and it is important
that you understand what they do. In this chapter we describe the actions
available in simple mode. Note that a number of these actions are only available
in the Pro Edition of <i>Game Maker</i>. This will be indicated.
<p>
All the actions are found in the tabbed pages at the right of the object property form.
There are six sets of actions. You select the set you want by clicking on the correct tab.
When you hold you mouse above one of the actions, a short description is
shown to remind you of its function.
<p>
Let us briefly repeat: To put an action in an event, just drag it from the
tabbed pages to the action list. You can change the order in the list, again
using dragging. Holding the &lt;Alt&gt; key while dragging makes a copy of
the action. (You can drag and copy actions between the lists in
different object property forms.) Use the right mouse button and select the
correct menu item to remove actions
(or use the &lt;Del&gt; key) and to copy and paste selected actions.
<p>
When you drop an action in the action list, a window will pop-up most
of the time, in which you can fill in certain parameters for the action.
The parameters will be described below when describing the actions.
Two types of parameters appear in many actions so we will describe these here.
At the top you can indicate to which instance the action applies. The default
is <tt>self</tt>, which is the instance for which the action is performed.
Most of the time, this is what you want. In the case of a collision event,
you can also specify to apply the action to the other instance
involved in the collision. For instance, in this way you can destroy the
other instance. Finally, you can choose to apply the action to all
instances of a particular object. In this way you could change all
red balls into blue balls. The second type of parameter is the
box labeled <b>Relative</b>. By checking this box, the values you
type in are relative to the current values. For example, in this way
you can add something to the current score, rather than changing
the current score to the new value. The other parameters will be
described below. You can later change the parameters by double
clicking on the action.
<!--HELPONLY-->
<P>
Information on the different actions can be found in the
following pages:
<P>
<blockquote>
<a href="112_01_move.html">Move Actions</a><br>
<a href="112_02_main1.html">Main Actions, Set 1</a><br>
<a href="112_03_main2.html">Main Actions, Set 2</a><br>
<a href="112_04_control.html">Control Actions</a><br>
<a href="112_05_score.html">Score Actions</a><br>
<a href="112_06_draw.html">Draw Actions</a><br>
<a href="112_07_variables.html">Using Variables and Expressions</a><br>
</blockquote>
<!--ENDHELPONLY-->
<!--END-->
</body>
</html>
<!-- KEYWORDS
actions
adding actions
copying actions
relative
-->

View File

@ -1,161 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Move actions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Move actions</h3>
The first set of actions consists of those related to movement of objects.
The following actions exist:
<p>
<b><img src="images/action_move1.bmp"> Move Fixed</b><br>
Use this action to start the instance moving in a particular direction.
You can indicate the direction using the buttons with the arrows on it.
Use the middle button to stop the motion. Also you need to specify
the speed of the motion. This speed is given in pixels per step.
Preferably don't use negative speeds.
You can specify multiple directions. In this case a random choice is made.
In this way you can let a monster start moving either left or right.
<p>
<b><img src="images/action_move2.bmp"> Move Free</b><br>
This is the second way to specify a motion. Here you can indicate a precise direction.
This is an angle between 0 and 360 degrees. 0 means to the right.
The direction is counter-clockwise. So for example 90 indicates an
upward direction. If you want an arbitrary direction, you can type
<tt>random(360)</tt>. As you will see below the function <tt>random</tt> gives
a random number smaller than the indicated value. As you might have noticed there
is a checkbox labeled <b>Relative</b>. If you check this, the new motion is added
to the previous one. For example, if the instance is moving upwards and you
add some motion to the left, the new motion will be upwards to the left.
<p>
<b><img src="images/action_movepoint.bmp"> Move Towards</b><br>
This action gives a third way to specify a motion. You indicate a position and
a speed and the instance starts moving with the speed towards the position.
(It won't stop at the position!) For example, if you want a bullet to fly
towards the position of the spaceship you can use as position <tt>spaceship.x, spaceship.y</tt>.
(You will learn more about the use of variables like these below.)
If you check the <b>Relative</b> box, you specify the position relative
to the current position of the instance. (The speed is not taken relatively!)
<p>
<b><img src="images/action_hspeed.bmp"> Speed Horizontal</b><br>
The speed of an instance consists of a horizontal part and a vertical part.
With this action you can change the horizontal speed. A positive horizontal
speed means a motion to the right. A negative one means a motion to the left.
The vertical speed will remain the same. Use relative to increase the horizontal speed
(or decrease it by providing a negative number).
<p>
<b><img src="images/action_vspeed.bmp"> Speed Vertical</b><br>
In a similar way, with this action you can change the vertical speed of the instance.
<p>
<b><img src="images/action_gravity.bmp"> Set Gravity</b><br>
With this action you can create gravity for this particular object.
You specify a direction (angle between 0 and 360 degrees) and a speed,
and in each step this amount of speed in the given direction is added
to the current motion of the object instance. Normally you need a very
small speed increment (like 0.01). Typically you want a downward direction
(270 degrees). If you check the <b>Relative</b> box you increase the
gravity speed and direction. Note that, contrary to real life,
different object can have different gravity directions.
<p>
<b><img src="images/action_hreverse.bmp"> Reverse Horizontal</b><br>
With this action you reverse the horizontal motion of the instance.
This can for example be used when the object collides with a vertical wall.
<p>
<b><img src="images/action_vreverse.bmp"> Reverse Vertical</b><br>
With this action you reverse the vertical motion of the instance.
This can for example be used when the object collides with a horizontal wall.
<p>
<b><img src="images/action_friction.bmp"> Set Friction</b><br>
Friction slows down the instances when they move. You specify the amount
of friction. In each step this amount is subtracted from the speed
until the speed becomes 0. Normally you want a very small number here (like 0.01).
<p>
<b><img src="images/action_jumpposition.bmp"> Jump to Position</b><br>
Using this action you can place the instance in a particular position.
You simply specify the x- and y-coordinate, and the instance is placed
with its reference point on that position. If you check the <b>Relative</b> box,
the position is relative to the current position of the instance.
This action is often used to continuously move an instance.
In each step we increment the position a bit.
<p>
<b><img src="images/action_jumpstart.bmp"> Jump to Start</b><br>
This action places the instance back at the position where it was created.
<p>
<b><img src="images/action_jumprandom.bmp"> Jump to Random</b><br>
This action moves the instance to a random position in the room.
Only positions are chosen where the instance does not intersect any
solid instance. You can specify the snapping used. If you specify
positive values, the coordinates chosen with be integer multiples of
the indicated values. This could for example be used to keep the instance
aligned with the cells in your game (if any). You can specify a separate
horizontal snapping and vertical snapping.
<p>
<b><img src="images/action_grid.bmp"> Align to Grid</b><br>
With this action you can round the position of the instance to a grid.
You can indicate both the horizontal and vertical snapping value (that is,
the size of the cells of the grid). This can be very useful to make sure
that instances stay on a grid.
<p>
<b><img src="images/action_wrap.bmp"> Wrap Screen</b><br>
With this action you can let an instance wrap around, that is, when
it leaves on one side of the room it reappears at the other side. This
action is normally used in the <b>Outside</b> event. Note that the
instance must have a speed for wrapping to work, cause the direction
of wrapping is based on the direction of the motion. You can indicate
whether to wrap only horizontal, only vertical, or in both directions.
<p>
<b><img src="images/action_contact.bmp"> Move to Contact</b><br>
With this action you can move the instance in a given direction until a
contact position with an object is reached. If there already is a collision
at the current position the instance is not moved. Otherwise, the instance
is placed just before a collision occurs. You can specify the direction but
also a maximal distance to move. For example, when the instance is falling
you can move a maximal distance down until an object is encountered. You can
also indicate whether to consider solid object only or all objects. You typically
put this action in the collision event to make sure that the instance stops
in contact with the other instance involved in the collision.
<p>
<b><img src="images/action_bounce.bmp"> Bounce</b><br>
When you put this action in the collision event with some object, the instance
bounces back from this object in a natural way. If you set the parameter precise
to false, only horizontal and vertical walls are treated correctly. When you set
precise to true also slanted (and even curved) walls are treated correctly.
This is though slower. Also you can indicate whether to bounce only against solid
objects or against all objects. Please realize that the bounce is not completely
accurate because this depends on many properties. But in many situations the
effect is good enough.
<!--END-->
</body>
</html>
<!-- KEYWORDS
moving actions
bouncing
gravity
friction
wrap
align to grid
-->

View File

@ -1,167 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Main actions, set 1</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Main actions, set 1</h3>
The following set of actions deals with creating, changing, and destroying instances of
objects, with sounds, and with rooms.
<p>
<b><img src="images/action_create.bmp"> Create Instance</b><br>
With this action you can create an instance of an object. You specify which
object to create and the position for the new instance. If you check the <b>Relative</b> box,
the position is relative to the position of the current instance. Creating
instances during the game is extremely useful. A space ship can create bullets;
a bomb can create an explosion, etc. In many games you will have some controller
object that from time to time creates monsters or other objects. For the newly
created instance the creation event is executed.
<p>
<b><img src="images/action_createspeed.bmp"> Create Moving</b><br>
This action works the same as the action above but with two additional fields.
You can now also specify the speed and direction of the newly created instance.
Note that if you check the <B>Relative</B> box, only the position is relative,
not the speed and direction. For example, to make a bullet move in the direction
of the person shooting you have to use a little trick. As position use
0,0 and check <B>Relative</B>. As direction we need the current direction
of the instance. This can be obtained by typing in the word <tt>direction</tt>.
(This actually is a variable that always indicates the current direction
in which the instance is moving.)
<p>
<b><img src="images/action_createrandom.bmp"> Create Random</b><br>
This action lets you create an instance of one out of four objects. You specify
the four objects and the position. An instance of one of these four objects
is created at the given position. If you check the <b>Relative</b> box,
the position is relative to the position of the current instance. If you need
a choice out of less than four objects you can use No Object for some of them.
This is for example useful to generate a random enemy at a location.
<p>
<b><img src="images/action_change.bmp"> Change Instance</b><br>
With this action you can change the current instance into an instance of
another object. So for example, you can change an instance of a bomb into
an explosion. All settings, such as the motion and the value of variables,
will stay the same. You can indicate whether or not to perform the destroy
event for the current object and the creation event for the new object.
<p>
<b><img src="images/action_destroy.bmp"> Destroy Instance</b><br>
With this action you destroy the current instance. The destroy event
for the instance is executed.
<p>
<b><img src="images/action_killposition.bmp"> Destroy at Position</b><br>
With this action you destroy all instances whose bounding box contains a
given position. This is useful, for example, when you use an exploding bomb.
When you check the <b>Relative</b> box the position is taken relative to
the position of the current instance.
<p>
<b><img src="images/action_sprite.bmp"> Change Sprite</b><br>
Use this action to change the sprite for the instance. You indicate which new sprite.
You can also indicate with subimage must be shown. Normally you would use 0 for
this (the first subimage) unless you want to see a particular subimage. Use -1 if
you do not want to change the current subimage shown. Finally
you change the speed of the animation of the subimages. If you only want to see
a particular subimage, set the speed to 0. If the speed is larger than one
subimages will be skipped. If it is smaller than 1 subimages will be shown
multiple times. Don't use a negative speed. Changing sprites is an important feature.
For example, often you want to change the sprite of a character depending on
the direction in which it walks. This can be achieved by making different sprites
for each of the (four) directions. Within the keyboard events for the arrow keys
you set the direction of motion and the sprite.
<p>
<b><img src="images/action_spritetransform.bmp"> Transform Sprite</b><br>
Use this action to change the size and orientation of the sprite for the instance.
Use the scale factors to make it larger or smaller. The angle gives the counter-clockwise
orientation of the sprite. For example, to make the sprite oriented in the direction of
motion use as a value <tt>direction</tt>. For example, this is useful for a car. You can also
indicate whether the sprite should be mirrored horizontally and/or flipped vertically.
<b><i>This action is only available in the Pro Edition.</i></b>
<p>
<b><img src="images/action_spritecolor.bmp"> Color Sprite</b><br>
Normally the sprite is drawn as it is defined. Using this action you can change the
color of the sprite. This color is blended with the sprite, that is, it is combined
with the colors of the sprite. If you want to draw a sprite in different colors you
better define the sprite in black and white and use the blend color to set the
actual color. You can also indicate an alpha transparency. With a value of 1 the
sprite is opaque. With a value of 0 it is completely transparent. With a value in
between you will partially see the background shine through it. This is great for
making explosions.
<b><i>This action is only available in the Pro Edition.</i></b>
<p>
<b><img src="images/action_sound.bmp"> Play Sound</b><br>
With this action you play one of the sound resources you added to your game.
You can select the sound you want to play and choose whether it should play only once
(the default) or loop continuously. Multiple wave sounds can play at once but
only one midi sound can play at a time. So if you start a midi sound, the current midi
sound is stopped.
<p>
<b><img src="images/action_soundend.bmp"> Stop Sound</b><br>
This action stops the indicated sound. If multiple instances of this sound
are playing all are stopped.
<p>
<b><img src="images/action_ifsound.bmp"> Check Sound</b><br>
If the indicated sound is playing the next action is performed. Otherwise
it is skipped. You can select <b>Not</b> to indicate that the next action
should be performed if the indicated sound is not playing. For example,
you can check whether some background music is playing and, if not, start
some new background music.
Note that this action returns true when the sound actually plays through the speakers. After you call the
action to play a sound it does not immediately reach the speakers so the action
might still return false for a while. Similar, when the sound is stopped you still hear
it for a while (e.g. because of echo) and the action will still return true.
<p>
<b><img src="images/action_roomprevious.bmp"> Previous Room</b><br>
Move to the previous room. You can indicate the type of transition effect
between the rooms. You should experiment to see what works best for you. When the rooms do
not have the same size you better do not use transitions.
If you are in the first room you get an error.
<p>
<b><img src="images/action_roomnext.bmp"> Next Room</b><br>
Move to the next room. You can indicate the transition.
<p>
<b><img src="images/action_roomcurrent.bmp"> Restart Room</b><br>
The current room is restarted. You indicate the transition effect.
<p>
<b><img src="images/action_roomother.bmp"> Different Room</b><br>
With this action you can go to a particular room. You indicate the room and the
transition effect.
<p>
<b><img src="images/action_ifroomprevious.bmp"> Check Previous</b><br>
This action tests whether the previous room exists. If so, the next action
is executed. You normally need this test before moving to the previous room.
<p>
<b><img src="images/action_ifroomnext.bmp"> Check Next</b><br>
This action tests whether the next room exists. If so, the next action
is executed. You normally need this test before moving to the next room.
<!--END-->
</body>
</html>
<!-- KEYWORDS
creating objects
object actions
room actions
-->

View File

@ -1,81 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Main actions, set 2</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Main actions, set 2</h3>
Here are some more main actions, dealing with timing, giving messages to the user,
and dealing with the game as a whole.
<p>
<b><img src="images/action_alarm.bmp"> Set Alarm</b><br>
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 <b>Relative</b> 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.
<p>
<b><img src="images/action_sleep.bmp"> Sleep</b><br>
With this action you can freeze the scene for a particular time.
This is typically used at the beginning or end of a level or when
you give the player some message. You specify the number of milliseconds to sleep.
Also you can indicate whether the screen should first be redrawn to
reflect the most recent situation.
<p>
<b><img src="images/action_info.bmp"> Display Message</b><br>
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.
<p>
<b><img src="images/action_help.bmp"> Show Info</b><br>
With this action you pop up the game information window.
<p>
<b><img src="images/action_gamerestart.bmp"> Restart Game</b><br>
With this action you restart the game from the beginning.
<p>
<b><img src="images/action_gameend.bmp"> End Game</b><br>
With this action you end the game.
<p>
<b><img src="images/action_gamesave.bmp"> Save Game</b><br>
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.)
<p>
<b><img src="images/action_gameload.bmp"> Load Game</b><br>
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 <i>Game Maker</i>. 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!)
<!--END-->
</body>
</html>
<!-- KEYWORDS
sound actions
game actions
alarm clocks
timing
-->

View File

@ -1,198 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Control actions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Control actions</h3>
There are a number of actions with which you can control which other actions are performed.
Most of these actions ask a question, for example whether a position is empty.
When the answer is yes (true) the next action is executed, otherwise it is skipped.
If you want multiple actions to be executed or skipped based on the outcome you
can put them in a block by putting start block and end block actions
around them. There can also be an else part which is executed when the
answer is no. So a question typically looks as follows:
<p>
<img src="images/form_control_actions.jpg">
<p>
Here the question is asked whether a position for the current
instance is collision free. If so, the instance starts moving in a given direction.
If not, the instance jumps to a given position. Note that the blocks are indented.
This gives a better overview of the actions. (In particular when you use blocks inside blocks.)
Also it is easier to detect when you forgot a start block or end block action.
<p>
For all questions there is a field labeled <b>NOT</b>. If you check this field,
the result of the question is reversed. That is, if the result was true it becomes
false and if it was false, it becomes true. This allows you to perform certain
actions when a question is not true.
<p>
For many questions you can indicate that they should apply to all instances
of a particular object. In this case the result is true only if it is true
for all instances of the object. For example, you can check whether for all
balls the position slightly to the right is collision free.
<p>
The following questions and related actions are available. (Note that they all have
a differently shaped icon and a different background color so that they can
more easily be distinguished from other actions.)
<p>
<b><img src="images/action_iffree.bmp"> Check Empty</b><br>
This question returns true if the current instance, placed at the indicated
position does not generate a collision with an object. You can specify the
position as either absolute or relative. You can also indicate whether only solid,
or all objects, should be taken into account.
This action is typically used to check whether the instance can move to a
particular position.
<p>
<b><img src="images/action_ifcollision.bmp"> Check Collision</b><br>
This is the reverse of the previous action. It returns true if there is a collision
when the current instance is placed at the given position (again, either only with
solid objects or with all objects).
<p>
<b><img src="images/action_ifobject.bmp"> Check Object</b><br>
This question returns true if the instance placed at the indicate position meets
an instance of the indicated object.
<p>
<b><img src="images/action_ifnumber.bmp"> Test Instance Count</b><br>
You specify an object and a number. If the current number of instances of the
object is equal to the number the question returns true. Otherwise it returns
false. You can also indicate that the check should be whether the number of
instances is smaller than the given value or larger than the given value. This
is typically used to check whether all instances of a particular type are gone.
This is often the moment to end a level or a game.
<p>
<b><img src="images/action_ifdice.bmp"> Test Chance</b><br>
You specify the number of sides of a dice which is then thrown. Then if the dice lands on one,
the result is true and the next action is performed. This can be used to put
an element of randomness in your game. For example, in each step you can
generate with a particular chance a bomb or a change of direction. The larger the
number of sides of the dice, the smaller the chance. You can actually use
real numbers. For example if you set the number of sides to 1.5 the next
action is performed two out of three times. Using a number smaller than 1 makes no sense.
<p>
<b><img src="images/action_ifquestion.bmp"> Check Question</b><br>
You specify a question. A dialog is shown to the player with a yes and a no
button. The result is true is the player answers yes.
<p>
<b><img src="images/action_if.bmp"> Test Expression</b><br>
This is the most general question action. You can enter an arbitrary expression.
If the expression evaluates to true (that is, a number larger or equal to 0.5)
the next action is performed. See below for more information on expressions.
<p>
<b><img src="images/action_ifmouse.bmp"> Check Mouse</b><br>
Returns true if the indicated mouse button is pressed. A standard use is in
the step event. You can check whether a mouse button is pressed and, if so,
for example move to that position (use the jump to a point action with
values <tt>mouse_x</tt> and <tt>mouse_y</tt>).
<p>
<b><img src="images/action_ifgrid.bmp"> Check Grid</b><br>
Returns true if the position of the instance lies on a grid. You
specify the horizontal and vertical spacing of the grid. This is
very useful when certain actions, like making a turn, are only a
llowed when the instance is on a grid position.
<p>
<b><img src="images/action_begin.bmp"> Start Block</b><br>
Indicates the start of a block of actions.
<p>
<b><img src="images/action_end.bmp"> End Block</b><br>
Indicates the end of a block of actions.
<p>
<b><img src="images/action_else.bmp"> Else</b><br>
Behind this action the else part follows, that is executed when
the result of the question is false.
<p>
<b><img src="images/action_repeat.bmp"> Repeat</b><br>
This action is used to repeat the next action (or block of actions)
a number of times. You simply indicate the number.
<p>
<b><img src="images/action_exit.bmp"> Exit Event</b><br>
When this action is encountered no further actions in this event are
executed. This is typically used after a question. For example, when
a position is free nothing needs to be done so we exit the event. In
this example, the following actions are only executed when there is
a collision.
<p>
If you want more control over what is happening in the game you can use the
built-in programming language that is described in <A HREF="400_index.html">Part 4</A> of the documentation.
If gives you much more flexibility than using the actions. There are also actions
to define and test variables. They are simpler to use than code and can be very useful for your games.
The following actions deal with this.
<p>
<b><img src="images/action_code.bmp"> Execute Code</b><br>
When you add this action, a form shows in which you can type a piece of code
which must be execute. This can contain simple function calls or more complex
code. Use the code action preferably only for small pieces of code.
For longer pieces you are strongly advised to use scripts which are described
in <A HREF="200_index.html">Part 2</A> of the documentation.
<p>
<b><img src="images/action_comment.bmp"> Comment</b><br>
Use this action to add a line of comment to the action list.
The line is shown in italic font. Adding comments helps you remember
what your events are doing.
The action does not do anything. But realize that it still is an action.
So when you place it after a conditional action it is the action that is executed
if the condition is true (even though it does not do anything).
<p>
<b><img src="images/action_variable.bmp"> Set Variable</b><br>
There are many built-in variables in the game. With this action you can change these.
Also you can create your own variables and assign values to them. You specify the
name of the variable and the new value. When you check the <b>Relative</b> box,
the value is added to the current value of the variable. Please note that this
can only be done if the variable already has a value assigned to it! See below
for more information about variables.
<p>
<b><img src="images/action_ifvariable.bmp"> Test Variable</b><br>
With this action you can check what the value of a particular variable is.
If the value of the variable is equal to the number provided, the question
returns true. Otherwise it returns false. You can also indicate that the
check should be whether the value is smaller than the given value or larger
than the given value. See below for more information about variables.
Actually, you can use this action also to compare two expressions.
<p>
<b><img src="images/action_drawvariable.bmp"> Draw Variable</b><br>
With this action you can draw the value of a variable at a
particular position on the screen. Note that this can only be used
in the draw event of an object.
<!--END-->
</body>
</html>
<!-- KEYWORDS
control actions
if actions
questions
code action
variable actions
-->

View File

@ -1,117 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Score actions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Score actions</h3>
In most games the player will have a certain score. Also many games give the player
a number of lives. Finally, often the player has a certain health. The following
actions make it easy to deal with the score, lives, and health of the player.
<p>
<b><img src="images/action_score.bmp"> Set Score</b><br>
<i>Game Maker</i> has a built-in score mechanism. The score is normally
displayed in the window caption. You can use this action to change the score.
You simply provide the new value for the score. Often you want to add something
to the score. In this case don't forget the check the <b>Relative</b> box.
<p>
<b><img src="images/action_ifscore.bmp"> Test Score</b><br>
With this question action you can check whether the score has reached a particular
value. You indicate the value and whether the score should be equal to that value,
be smaller than the value or be larger than the value.
<p>
<b><img src="images/action_drawscore.bmp"> Draw Score</b><br>
With this action you can draw the value of the score at a particular position on
the screen. You provide the positions and the caption that must be placed in front
of the score. The score is drawn in the current font. This action can only be used
in the drawing event of an object.
<p>
<b><img src="images/action_highscore.bmp"> Show Highscore</b><br>
For each game the top ten scores are maintained. This action displays the highscore
list. If the current score is among the top ten, the new score is inserted and the
player can type his or her name.
You can indicate what background image to use, whether the window
should have a border, what the color for the new entry and the other entries must be,
and which font to use.
<p>
<b><img src="images/action_highscoreclear.bmp"> Clear Highscore</b><br>
This action clears the highscore table.
<p>
<b><img src="images/action_lives.bmp"> Set Lives</b><br>
<i>Game Maker</i> also has a built-in lives system. With this action you can
change the number of lives left. Normally you set it to some value like 3 at
the beginning of the game and then decrease or increase the number depending
on what happens. Don't forget to check the <b>Relative</b> box if you want to
add or subtract from the number of lives. At the moment the number of lives
becomes 0 (or smaller than 0) a &quot;no more lives&quot; event is generated.
<p>
<b><img src="images/action_iflives.bmp"> Test Lives</b><br>
With this question action you can check whether the number of lives has reached
a particular value. You indicate the value and whether the number of lives should
be equal to that value, be smaller than the value or be larger than the value.
<p>
<b><img src="images/action_drawlives.bmp"> Draw Lives</b><br>
With this action you can draw the number of lives at a particular position on
the screen. You provide the positions and the caption that must be placed in
front of the number of lives. The number of lives is drawn in the current font.
This action can only be used in the drawing event of an object.
<p>
<b><img src="images/action_drawlivesimage.bmp"> Draw Life Images</b><br>
Rather than drawing the number of lives left as a number, it is often nicer to
use a number of small images for this. This action does precisely that. You
specify the position and the image and at the indicated position the number of
lives is drawn as images. This action can only be used in the drawing event of an object.
<p>
<b><img src="images/action_health.bmp"> Set Health</b><br>
<i>Game Maker</i> has a built-in health mechanism. You can use this action to
change the health. A value of 100 is considered full health and 0 is no health
at all. You simply provide the new value for the health. Often you want to
subtract something from the health. In this case don't forget the check the
<b>Relative</b> box. When the health becomes smaller or equal to 0 an out
of health event is generated.
<p>
<b><img src="images/action_ifhealth.bmp"> Test Health</b><br>
With this question action you can check whether the health has reached a
particular value. You indicate the value and whether the health should be
equal to that value, be smaller than the value or be larger than the value.
<p>
<b><img src="images/action_drawhealth.bmp"> Draw Health</b><br>
With this action you can draw the health in the form of a health bar. When
the health is 100 the full bar is drawn. When it is 0 the bar is empty. You
indicate the position and size of the health bar and the color of the bar
and the background.
<p>
<b><img src="images/action_caption.bmp"> Score Caption</b><br>
Normally in the window caption the name of the room and the score is displayed.
With this action you can change this. You can indicate whether or not to show
the score, lives, and/or health and what the caption for each of these must be.
<!--END-->
</body>
</html>
<!-- KEYWORDS
score
life
health
-->

View File

@ -1,130 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Draw actions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Draw actions</h3>
Normally in each step of the game, for each instance, its sprite is drawn in the room.
You can change this by putting actions in the draw event. (Note that these are only
executed when the instance is visible!) The following drawing actions are available.
These actions only make sense in the drawing event. At other places they are
basically ignored.
<p>
<b><img src="images/action_drawsprite.bmp"> Draw Sprite</b><br>
You specify the sprite, the position (either absolute or relative
to the current instance position) and the subimage of the sprite.
(The subimages are numbered from 0 upwards.) If you want to
draw the current subimage, use number -1.
<p>
<b><img src="images/action_drawbackground.bmp"> Draw Background</b><br>
You indicate the background image, the position (absolute or relative) and
whether the image should be tiled all over the room or not.
<p>
<b><img src="images/action_drawtext.bmp"> Draw Text</b><br>
You specify the text and the position. A # symbol in the text is interpreted
as going to a new line. (Use \# to get the # symbol itself.) So you can
create multi-line texts. If the text starts with a quote or a double quote,
it is interpreted as an expression. For example, you can use
<pre>
'X: ' + string(x)
</pre>
<p>
to display the value of the x-coordinate of the instance.
(The variable x stores the current x-coordinate. The function <tt>string()</tt> turns
this number into a string. + concatenates the two strings.)
<p>
<b><img src="images/action_drawtextext.bmp"> Draw Scaled Text</b><br>
This action is similar to the previous action but this time you can also
specify a horizontal and vertical scaling factor to change the size of the
text and you can specify an angle to rotate it.
<b><i>This action is only available in the Pro Edition.</i></b>
<p>
<b><img src="images/action_drawrectangle.bmp"> Draw Rectangle</b><br>
You specify the coordinates of the two opposite corners of the rectangle;
either absolute or relative to the current instance position.
<p>
<b><img src="images/action_drawhorgradient.bmp"> Horizontal Gradient</b><br>
This action also draws a rectangle but this time using a gradient color that
changes from left to right. You specify the rectangle and the two colors to use.
<b><i>This action is only available in the Pro Edition.</i></b>
<p>
<b><img src="images/action_drawvertgradient.bmp"> Vertical Gradient</b><br>
This action also draws a rectangle but this time using a gradient color that
changes from top to bottom. You specify the rectangle and the two colors to use.
<b><i>This action is only available in the Pro Edition.</i></b>
<p>
<b><img src="images/action_drawellipse.bmp"> Draw Ellipse</b><br>
This action draws an ellipse.
You specify the coordinates of the two opposite corners of the surrounding
rectangle; either absolute or relative to the current instance position.
<p>
<b><img src="images/action_drawellipsegradient.bmp"> Gradient Ellipse</b><br>
Again an ellipse is drawn but this time you specify a color for the center and
the boundary.
<b><i>This action is only available in the Pro Edition.</i></b>
<p>
<b><img src="images/action_drawline.bmp"> Draw Line</b><br>
You specify the coordinates of the two endpoints of the line; either
absolute or relative to the current instance position.
<p>
<b><img src="images/action_drawarrow.bmp"> Draw Arrow</b><br>
Draws an arrow. You specify the coordinates of the two endpoints of the line
and the size of the arrow tip.
<p>
<b><img src="images/action_color.bmp"> Set Color</b><br>
Lets you set the color used for drawing shapes, lines, and text.
(It does not influence the way sprites and backgrounds are drawn.)
<p>
<b><img src="images/action_fullscreen.bmp"> Set Full Screen</b><br>
With this action you can change the screen mode from windowed to fullscreen
and back. You can indicate whether to toggle the mode or whether to go to
windowed or fullscreen mode.
<p>
<b><img src="images/action_snapshot.bmp"> Take Snapshot</b><br>
With this action you can take a snapshot image of the game and store
it in a .png file. You specify the filename to store the image in.
<b><i>This action is only available in the Pro Edition.</i></b>
<p>
<b><img src="images/action_explosion.bmp"> Create Effect</b><br>
With this action you can create all sorts of effects in a very simple way. You
specify the type of effect, e.g. an explosion or smoke, its position, its size and its color and
whether it should be shown below the objects or on top of them. For the
rest it works automatic. (For rain and snow the position is irrelevant
as it always falls down from the top of the screen. To get continuous
rain you should create it in each step.) Please note that below actually means
at a depth of 100000 and above means at a depth of -100000.
<b><i>This action is only available in the Pro Edition.</i></b>
<!--END-->
</body>
</html>
<!-- KEYWORDS
drawing actions
drawing shapes
-->

View File

@ -1,74 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Using expressions and variables</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Using expressions and variables</h3>
In many actions you need to provide values for parameters. Rather than just
typing a number, you can also type a formula, e.g. 32*12. But you can actually
type much more complicated expressions. For example, if you want to double the
horizontal speed, you could set it to <tt>2*hspeed</tt>. Here <tt>hspeed</tt> is a
variable indicating the current horizontal speed of the instance.
There are a large number of other variables that you can use.
Some of the most important ones are:
<p>
<blockquote>
<b>x</b> the x-coordinate of the instance<br>
<b>y</b> the y-coordinate of the instance<br>
<b>hspeed</b> the horizontal speed (in pixels per step)<br>
<b>vspeed</b> the vertical speed (in pixels per step)<br>
<b>direction</b> the current direction of motion in degrees (0-360)<br>
<b>speed</b> the current speed in this direction<br>
<b>visible</b> whether the object is visible (1) or invisible (0)<br>
<b>image_index</b> this variable indicate which subimage in the current sprite is currently shown.
If you change it and set the speed to 0 (see below) you can display a fixed subimage.<br>
<b>image_speed</b> this variable indicates the speed with which the subimages are shown.
The default value is 1. If you make this value larger than 1 some subimages
are skipped to make the animation faster. If you make it
smaller than 1 the animation becomes slower by repeating subimages.<br>
<b>score</b> the current value of the score<br>
<b>lives</b> the current number of lives<br>
<b>health</b> the current health (0-100)<br>
<b>mouse_x</b> x-position of the mouse<br>
<b>mouse_y</b> y-position of the mouse<br>
</blockquote>
You can change most of these variables using the set variable action.
You can also define your own variables by setting them to a value.
(Don't use relative, because they don't exist yet.) Then you can use these
variables in expressions. Variables you create are local to the current
instance. That is, each object has its own copy of them. To create a global
variable, put the word global and a dot in front of it.
<p>
You can also refer to the values of variables for other objects
by putting the object name and a dot in front of them. So for example,
if you want a ball to move to the place where the coin is you can
set the position to (<tt>coin.x</tt> , <tt>coin.y</tt>). In the
case of a collision event you can refer to the x-coordinate of the
other object as <tt>other.x</tt>. In conditional expressions you
can use comparisons like &lt; (smaller than), &gt;, etc.
<p>
In your expressions you can also use functions. For example, the function
<tt>random(10)</tt> gives a random integer number below 10. So you can
set for example the speed or direction of motion to a random value.
Many more functions exist. They are described in <A HREF="400_index.html">Part 4</A> of the
documentation.
<!--END-->
</body>
</html>
<!-- KEYWORDS
expressions
variables
mouse position
-->

View File

@ -1,169 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Creating rooms</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Creating rooms</h1>
Now that you have defined the objects with their behavior in the form of events and
actions, it is time to create the rooms or levels in which the game takes place. Any
game will need at least one room. In these rooms we place instances of the objects.
Once the game starts the first room is shown and the instances in it come to life
because of the actions in their creation events.
<p>
There are a large number of possibilities when creating rooms. Besides setting a
number of properties and adding the instances of the objects you can add backgrounds,
define views, and add tiles. Most of these options are discussed later.
In this chapter we will only discuss some basic settings, the addition of instances of
objects, and the setting of background images.
<p>
To create a room, choose <b>Create Room</b> from the <b>Resources</b> menu. The following form
will appear:
<p>
<img src="images/form_room.jpg">
<p>
At the top of the form there is a tool bar. On this you can indicate the size of the
grid cells used for aligning objects. Also you can indicate whether or not to show the
grid lines and whether or not to show the backgrounds, etc. It is
sometimes useful to temporarily hide certain aspects of the room. Realize though that
when you are adding instances of objects, these will always be shown, independent of
the view setting.) There are also buttons to clear all instances from the room and to
shift all instances over a number of pixels. Use negative numbers to shift them left
or up. This is useful when for instance you decided to enlarge the room. (You can also use
this to place instances outside the room, which is sometimes useful.). Finally there
is the <b>Undo</b> button to undo the last change to the room and the <b>OK</b> button
to save the changes. (Click on the cross at the top right to close the form without
saving the changes.)
<p>
At the left you will see three tab pages (five in advanced mode). The <b>objects</b>
tab is where you add instances of objects to the room. In the <b>settings</b> tab you
can indicate a number of settings for the room. In the <b>backgrounds</b> tab you can
set background images for the room.
<h3>Adding instances</h3>
At the right in the room design form you see the room. At the start it is empty, with
a gray background.
<p>
<img src="images/form_room_objects.jpg">
<p>
To add instances to the room, first select the <b>objects</b> tab if this one is not
already visible. Next select the object you want to add by clicking on the button with
the menu icon (or by clicking in the image area at the left). The image of the object
appears at the left. (Note that when you changed the origin of the sprite
there is a cross in the image. This indicates how the
instances will be aligned with the grid.) Now click with your left mouse button in the
room area at the right. An instance of the object appears. It will snap to the
indicated grid. If you hold the &lt;Alt&gt; key while placing the instance it is not
aligned to the grid. If you hold down the mouse button while dragging it over the
room, you move the instance to the correct place. If you hold the &lt;Shift&gt; key
while pressing and moving the mouse multiple instances are added. With the right mouse
button you can remove instances. In this way you define the contents of the room.
<p>
As you will notice, if you place an instance on top of another one, the original
instance disappears. Normally this is what you want, but not always. This can be
avoided by unchecking the box labeled <b>Delete underlying</b> at the left.
<p>
If you want to change the position of an instance, hold the &lt;Ctrl&gt; key and click
with the left mouse button on the instance and hold down the button. You can now drag
it to a new position. (Use &lt;Alt&gt; for precise positioning.)
<p>
If you hold the &lt;Ctrl&gt; key while clicking with the right mouse button on an
instance, a menu appears. Here you can delete the object, type in a precise position
for the instance, or move the bottommost instance at the position to the top or send
the topmost instance to the bottom.
<h3>Room setting</h3>
Each room has a number of settings that you can change by clicking on the <b>settings</b> tab.
<p>
<img src="images/form_room_settings.jpg">
<p>
Each room has a name. Best give it a meaningful name. There also is a caption. This
caption is displayed in the window caption when the game is running. You can set the
width and height of the room (in pixels). Also you can set the speed of the game. This
is the number of steps per second. The higher the speed, the smoother the motion is.
But you will need a faster computer to run it.
<h3>Setting the background</h3>
With the tab <b>backgrounds</b> you can set the background image for the room.
Actually, you can specify multiple backgrounds. The tab page looks as follows:
<p>
<img src="images/form_room_backgrounds.jpg">
<p>
At the top you will see the background color. You can click on it to change it. The
background color is only useful if you don't use a background image that covers the
whole room. Otherwise, best uncheck the box labeled <b>Draw background color</b>
because this will be a waste of time.
<p>
At the top you see a list of 8 backgrounds. You can define each of them but most of
the time you will need just one or two. To define a background, first select it in the
list. Next check the box labeled <b>Visible when room starts</b> otherwise you won't
see it. The name of the background will become bold when it is defined. Now indicate a
background image in the menu. There are a number of settings you can change. First of
all you can indicate whether the background image should tile the room horizontally
and/or vertically. You can also indicate the position of the background in the room
(this will also influence the tiling). A different option is to stretch the
background. The background will then be scaled so that it fills the entire room.
The aspect ration of the image will not be maintained. Finally
you can make the background scrolling by giving it a horizontal or vertical speed
(pixels per step). Better not use scrolling with a stretched background. The result
will be a bit jaggy.
<p>
There is one more checkbox labeled <b>Foreground image</b>. When you check this box,
the background is actually a foreground, which is drawn on top of everything else
rather than behind it. Clearly such an image should be partially transparent to be of
any use.
<!--END-->
</body>
</html>
<!-- KEYWORDS
adding rooms
creating rooms
rooms
caption
room caption
instances
adding instances
background color
room color
background
room background
foregrounds
tiled backgrounds
streched backgrounds
room settings
room speed
room size
grid
snapping
delete underlying
-->

View File

@ -1,64 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Distributing your game</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Distributing your game</h1>
With the information in the preceding chapters you can create your games.
When your game is finished you obviously want other people to play it. You can of course
give them the .gmk file that you created and let them use <i>Game Maker</i> to play it
but this is normally not what you want. First of all, you don't want others to be able
to change the game, and secondly you also want people to play the game even if they do not have
<i>Game Maker</i>. So you would like to create a stand-alone executable of your game.
<p>
Creating stand-alone executables is very easy in <i>Game Maker</i>. In the <b>File</b> menu
you select the item <b>Create Executable</b>.
You will be asked for the name of the executable that should contain the game.
Indicate a name, press <b>OK</b> and you have your stand-alone game that
you can give to anyone you like. You can change the icon for the
stand-alone game in the <b>Global Game Settings</b>. See <A HREF="300_index.html">Part 3</A>
for details.
<p>
Once you have created a stand-alone executable in the way described above you can give this
file to other people or place it on your website to download.
You are free to distribute the games you create with <i>Game Maker</i>
in any way you like. You can even sell them. This of course assumes that the sprites,
images, and sounds you use can be distributed or sold as well.
See the enclosed license agreement for more information.
<p>
It is normally useful to zip your executable, together with some readme information.
In Windows XP and later this can be done directly through the right mouse button menu, and there
are many free zip utilities available on the web. Alternatively you can create an
installer for your game. Again, a large number of free installation creation programs
are available on the web.
<p>
If you want your game to be played by many more people we recommend you to upload it to the
<A HREF="http://www.yoyogames.com/">YoYo Games website</A> and press on the Share button at the top.
</p>
<!--END-->
</body>
</html>
<!-- KEYWORDS
distributing games
run-only version
stand-alone version
executable
create stand-alone game
zip files
game icon
selling games
-->

View File

@ -1,45 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Advanced use</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Advanced use</h1>
This section of the help file gives you information about the more
advanced aspects of <I>Game Maker</I>.
<!--HELPONLY-->
<P>
Information on the advanced use of <I>Game Maker</I> can be found in the
following pages:
<P>
<blockquote>
<a href="201_00_advanced.html">Advanced User Interface</a><br>
<a href="202_00_sprites.html">More about Sprites</a><br>
<a href="203_00_sounds.html">More about Sounds and Music</a><br>
<a href="204_00_backgrounds.html">More about Backgrounds</a><br>
<a href="205_00_objects.html">More about Objects</a><br>
<a href="206_00_actions.html">More Actions</a><br>
<a href="207_00_constants.html">Constants</a><br>
<a href="208_00_triggers.html">Trigger Events</a><br>
<a href="209_00_include.html">Including Files</a><br>
<a href="210_00_rooms.html">More about Rooms</a><br>
<a href="211_00_fonts.html">Fonts</a><br>
<a href="212_00_paths.html">Paths</a><br>
<a href="213_00_timelines.html">Time Lines</a><br>
<a href="214_00_scripts.html">Scripts</a><br>
<a href="215_00_extensions.html">Extension Packages</a><br>
<a href="216_00_import.html">Exporting and Importing Resources</a><br>
</blockquote>
<!--ENDHELPONLY-->
<!--END-->
</body>
</html>

View File

@ -1,170 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Advanced mode</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Advanced mode</h1>
Up to now we have only considered the simple features of <i>Game Maker</i>. But there are a lot more
possibilities. To be able to use these you must run <i>Game Maker</i> in advanced mode.
This is easy to change. In the <b>File</b> menu, click on the menu item <b>Advanced mode</b>.
(To fully see the effects you should restart <i>Game Maker</i> or at least save your
game and load it anew.)
<p>
When you start <i>Game Maker</i> in advanced mode, the following form is shown:
<p>
<img src="images/form_main_advanced.jpg">
<p>
It contains all that was there in simple mode, but there are a number
of additional resources, buttons, and menu items. Also, as we will see
in the chapters that follow, the different resources have additional options.
Here we will discuss the additional menu items.
<h3>File menu</h3>
In the file menu you can find the following additional commands:
<p>
<ul>
<li><b>Publish your Game.</b>
This command will take you to our website were you can easily upload and publish
your finished game such that everybody can play it. Carefully follow the
instructions to make your game available. Please only use this for finished games,
not for preliminary versions.
<b><i>This possibility is only available in the Pro Edition.</i></b>
</li>
<li><b>Import Resources.</b>
With this command you can import resources that you exported with the
next command. See the section on <a href="216_00_import.html">Exporting and Importing Resources</a>
for more details.</li>
<li><b>Export Resources.</b>
With this command you can export resources to a file.
See the section on <a href="216_00_import.html">Exporting and Importing Resources</a>
for more details.</li>
<li><b>Preferences.</b>
Here you can set a number of preferences about
<i>Game Maker</i>. They will be remembered between different calls
of <i>Game Maker</i>. For more information see the page on <A HREF="201_01_preferences.html">Preferences</A>.</li>
</ul>
<h3>Edit menu</h3>
In the edit menu you can find the following additional commands:
<ul>
<li><b>Add group.</b>
Resources can be grouped together.
This is very useful when you make large games. For example, you can
put all sounds related to a certain object in a group, or you can group all
objects that are used in a particular level. This command creates a new group
in the currently selected resource type. You will be asked for a name.
Groups can again contain groups, etc. You can drag
resources into the groups.</li>
<li><b>Find Resource.</b>
With this command you type in the name
of a resource and it open the corresponding property form.</li>
<li><b>Expand Resource Tree.</b>
Fully expands the resource tree, showing all resources.</li>
<li><b>Collapse Resource Tree.</b>
Fully collapses the resource tree, hiding all resources.</li>
<li><b>Show Object Information.</b>
Using this command you can get an overview of all objects in the game.</li>
</ul>
<h3>Resources menu</h3>
In this menu you can now also create the additional resources. Note that
for each of them there is also a button on the toolbar and a keyboard
shortcut. There are three special menu items at the bottom:
<ul>
<li><b>Define Constants.</b>
Here you can define constants for use in your scripts and action arguments.
For more information see the section on <a href="207_00_constants.html">Constants</a>.</li>
<li><b>Define Triggers.</b>
Here you can define your own trigger events.
For more information see the section on <a href="208_00_triggers.html">Trigger Events</a>.</li>
<li><b>Included Files.</b>
Here you can indicate which additional files should be included in the game executable.
For more information see the section on <a href="209_00_include.html">Including Files</a>.</li>
</ul>
<h3>Scripts menu</h3>
In the scripts menu you can find the following additional commands:
<ul>
<li><b>Import Scripts.</b>
Can be used to import useful scripts from files.</li>
<li><b>Export Scripts.</b>
Can be used to save your scripts in a file, to be used by others.
When you select a script resource only this script is saved. When
you select a group all scripts in the group are saved. When you
select the root resource (or a different type of resource) all scripts
are saved. This menu item is also available when right-clicking on a
script or group of scripts.</li>
<li><b>Show Built-in Variables.</b>
Shows a sorted list of all built-in variables, both local and global.</li>
<li><b>Show Built-in Functions.</b>
Shows a sorted list of all built-in functions.</li>
<li><b>Show Extension Functions.</b>
Shows a sorted list of all functions available in the extension packages you included
in your game.</li>
<li><b>Show Constants.</b>
Shows a sorted list of all built-in constants and constants
defined in the game options.</li>
<li><b>Show Resource Names.</b>
Shows a sorted list of all resource names. You can click on a name to open the
particular resource for editing.</li>
<li><b>Search in Scripts.</b>
You can search for a string in all scripts. You can click on one of
the reported places to move there for editing.</li>
<li><b>Check Resource Names.</b>
Does a check of all resource names. Names will be reported if they
are not correct, if there are duplicate resource names, or when a
resource name is the name of a variable, function, or constant.
You can click on a name to open the particular resource for editing.</li>
<li><b>Check All Scripts.</b>
Checks all scripts for errors. You can click on one of the reported
places to move there for editing.</li>
</ul>
<h3>Help menu</h3>
Here you can now also find help information about the extension packages you are using.
<!--END-->
</body>
</html>
<!-- KEYWORDS
advanced mode
groups
finding resources
object information
import scripts
export scripts
checking scripts
duplicate names
overview of functions
overview of variables
overview of constants
-->

View File

@ -1,194 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Preferences</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Preferences</h1>
Under the <b>Preferences</b> menu item in the <b>File</b> menu you can set a
number of preferences that will be maintained between runs of <i>Game Maker</i>.
The following preferences can be set:
<h3>General tab</h3>
<p>
<img src="images/form_preferences_general.jpg">
</p>
<ul>
<li><b>Show recently edited games in the file menu.</b>
If checked the eight most recently edited games are shown under the
recent files in the file menu.</li>
<li><b>Load last opened file on startup.</b>
If checked when you start <i>Game Maker</i> the most recently opened file
is opened automatically.</li>
<li><b>Keep backup copies of files.</b>
If checked the program saves a backup copy of your game with
the extension gb0-gb9. You can open these games in <i>Game Maker</i>.
You are strongly advised to use at least one backup copy for your work!</li>
<li><b>Maximum number of backups.</b>
Here you can indicate how many (1-9) different backup copies
should be remembered by the program.</li>
<li><b>Show progress while loading and saving files.</b>
If checked, when load or save a file a progress indicator is shown.</li>
<li><b>At startup check for, and remove old temporary files.</b>
<I>Game Maker</I> and games created with it, create temporary files.
Normally these are automatically removed but sometimes, for example
when games crash, they are left behind. If this option is checked,
<I>Game Maker</I> checks whether such files exist and removes them at startup.</li>
<li><b>Don't show the website in the main window.</b>
When checked the image and link to the website on the main window are not shown.</li>
<li><b>Hide the designer and wait while the game is running.</b>
When checked the game making program is hidden while you are testing a game.</li>
<li><b>Run games in secure mode.</b>
If checked, any game created with <i>Game Maker</i> that runs on your
machine will not be allowed to execute external programs or change
or delete files at a place different from the game location.
(This is a safeguard against Trojan horses although success is not
guaranteed.) Checking this means that games that utilizes external
files etc. won't be running correctly.
The setting only works while <i>Game Maker</i> is running.
So if you run the game independently of <i>Game Maker</i>, for
example as an executable stand-alone, it is NOT
run in secure mode.</li>
<li><b>Show news on startup.</b> Whether to show the <i>Game Maker</i> news
once a day when the program is started. (Cannot be changed in the Lite Edition.)</li>
<li><b>Show news in default brower.</b> Whether to show the <i>Game Maker</i> news
in your default Internet browser, rather than in the program itself.
(Cannot be changed in the Lite Edition.)</li>
</ul>
<h3>Forms tab</h3>
<p>
<img src="images/form_preferences_forms.jpg">
</p>
<ul>
<li><b>Show the origin in the sprite image.</b>
If checked, in the sprite properties form, in the sprite image, the origin
for the sprite is indicated.</li>
<li><b>In object properties, show hints for actions.</b>
If checked, in the object properties form, when you hold your mouse
over one of the actions, a description is shown.</li>
<li><b>When closing, remove instances outside the room.</b>
If checked, the program warns you when there are instances or tiles
outside a room and lets you remove them.</li>
<li><b>Remember room settings when closing the form.</b>
If checked, a number of room settings, like whether to show the grid,
whether to delete underlying objects, etc. are remembered when you
edit the same room later.</li>
</ul>
<h3>Scripts and code tab</h3>
<p>
<img src="images/form_preferences_scripts.jpg">
</p>
<p>
These settings relate to the built-in script and code editor.
Most of these settings are explained in detail in the page on <A HREF="214_00_scripts.html">Scripts</A>.
Here we just give a short overview:
<ul>
<li><b>Group undo operations</b> When grouped multiple actions (like typing a whole line) becomes
one operation for undo.</li>
<li><b>Number of undo</b> You can change this number but in general this should be fine.</li>
<li><b>Automatic indentation</b> When set Enter and Backspace keys cleverly deal with indents.</li>
<li><b>Indent amount</b> How much to indent with each tab.</li>
<li><b>Smart tabs</b> When set tabs go to the position below the first non-empty space in the previous line.</li>
<li><b>Allow cursor beyond end of line</b> When checked you can place the cursor at any position in the editor screen,
also beyond the end of line. If unchecked this is not possible. This also changes the behavior
of the left and right arrow keys.</li>
<li><b>Show auto-completion options</b> When set help is given on which functions and variables start with the
letters you are typing.</li>
<li><b>Dealy (msec)</b> The delay in milliseconds before the help is shown. Set e.g. to 0 for immediate.</li>
<li><b>Show function argument help</b> When set, when typing function arguments, in the statusbar help about
this is provided.</li>
<li><b>Show find string</b> When set, whenever typing in a find string, all locations are shown in the code.</li>
<li><b>Show line numbers</b> Whether the editor should display the line numbers.</li>
<li><b>Show matching brackets</b> Whether the editor should indicate matching open en close brackets.</li>
<li><b>Show code snippets with F2</b> When set, pressing F2 will bring up a number of useful code snippets.</li>
<li><b>Check code while typing</b> When set the code is constantly checked and errors reported.</li>
<li><b>Use color coding</b> Whether to use color coding in the editor.</li>
<li><b>Colors</b> Here you can set the colors used for color coding. You can also reset the default colors.</li>
<li><b>Font</b> Here you can select the font for the editor. Note that only fixed pitch fonts are shown. Also
note that only the font and the size are used.</li>
</ul>
<h3>Editors</h3>
<p>
<img src="images/form_preferences_editors.jpg">
</p>
<p>
Here you can choose whether to use the built-in code editor (highly recommended) or
an external editor. In the case of an external editor, the script text is saved as
a .txt file and the editor is called with this file as an argument. After editing it
you should save the file and close the editor such that <i>Game Maker</i> can read the
file back in.
</p>
<p>
Also you can choose whether to use the built-in image editor (highly recommended) or
an external editor. In the case of an external editor, the image is saved as
a .png file and the editor is called with this file as an argument. After editing it
you should save the file and close the editor such that <i>Game Maker</i> can read the
file back in.
</p>
<p>
Finally you can indicate the different external editors for the sound files you want to use.
<i>Game Maker</i> does not contain internal sound editors. There are three possible editors
handling .wav, .mid and .mp3 files. In the case of an external editor, the sound is saved as
a .wav, .mid, or .mp3 file and the corresponding editor is called with this file as an argument.
After editing it
you should save the file and close the editor such that <i>Game Maker</i> can read the
file back in.
</p>
<h3>Other Settings</h3>
<p>
It is also possible to change the location of the temp files that <i>Game Maker</i> creates
to e.g. store the game that is tested. This location cannot be changed from the Preferences but
is changes by creating a file <tt>tempdir.txt</tt> in the folder where <i>Game Maker</i> is located.
In this file there should be one line containing the location of the folder in which the temp files
are creates, for example <tt>C:\GMTEMP</tt>. Note that the name must include the complete path
and should <b>not</b> end with a backslash. Each time <i>Game Maker</i> is run a unique temporary folder is
created within this location. So things will work out fine, even when multiple instances of <i>Game Maker</i>
use the same location. (Note that the games themselves also create a temp folder for their files. Again,
this can be changed by creating a file <tt>tempdir.txt</tt> and placing it in the folder where the game
executable is located.)</p>
<p>
Secondly, it is possible to change the image <i>Game Maker</i> is using for the background of its main form.
To this end place an image file <tt>back.bmp</tt> in the folder where <i>Game Maker</i> is located.
</p>
<!--END-->
</body>
</html>
<!-- KEYWORDS
preferences
backups
secure mode
sprite origin
code settings
editor settings
external code editor
external image editor
sound editor
external sound editor
temp files
location temp files
temporary files
-->

View File

@ -1,144 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>More about sprites</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>More about sprites</h1>
When running <i>Game Maker</i> in advanced mode the
A number of advanced options exist. When you open the sprite form it will look as follows:
<p>
<img src="images/form_sprite_advanced.jpg">
<p>
A new button <b>Save Sprite</b> has appeared. With this button you can save the sprite
in a proprietary format. This format will not only store the image(s) of the sprite
but also other settings, such as collision settings and the origin. The file will have
the extension .gmspr. <i>Game Maker</i> can load such files but also the games can
load them.
<p>
At the bottom-left, you can indicate the origin of the sprite. This is the point in the
sprite that corresponds with its position in the room. When you set an instance at a
particular position, the origin of the sprite is placed there. Default it
is the top left corner of the sprite but it is sometimes more convenient
to use the center (by clicking the <b>Center</b> button)
or some other important point. You can even choose an
origin outside the sprite. You can also set the origin by clicking in the
sprite image. The origin will be shown with a cross.
<p>
Most important are the options related to collision checking. Whenever two instances
meet a collision event is generated. Collisions are checked in the following way.
Each sprite has a mask. Default this corresponds to all pixels that are not fully transparent.
When two pixels in the masks of the two sprites overlap, a collision is reported.
<p>
Sometimes you don't want precise collision checking. In this case, uncheck the
box <b>Precise collision checking</b>. Now the bounding box is used as the mask.
<p>
When the sprites has multiple subimages, default there is just a single mask that
combines the masks of all subimages. Normally this is what you want but in certain
situations you might want each subimage to have its own mask. In this case check
the box <b>Separate collision masks</b>.
<h3>Collision Masks</h3>
<p>
If you want even more control over
the collision masks, press the button <b>Modify Mask</b>. The following window
will show:
<p>
<img src="images/form_mask.jpg">
<p>
At the left top there is again the information about the sprite image. You can
show the different subimages. Also you can indicate here whether to show the
collision mask (default on). In this case, in the images at the right the mask
is shown in dark. You can also zoom in and out to get a better view.
</p>
<p>
To the right of this you can change the bounding box. Only pixels inside this bounding box are used for
the mask. Default the bounding box is automatically computed, taking the alpha tolerance
into account, separate for each subimage, when using separate collision masks. You can
also set it to the full image or you can set it to manual. In the latter case you can specify
the bounding box yourself. When set to manual you can also draw the bounding box with the
left mouse button in the image, or you can move it with the right mouse button. (Note though
that the mask is shown while drawing, not the bounding box!)
</p>
<p>
Below this you can indicate the shape of the mask. Default is precise, pixel-wise
collision checking, but you can select here also to use the bounding rectangle, a disk (or
ellipse) inside it, or a diamond shape. Rectangles or disks are is many cases better
representations of the shape. (Note that the choice has no effect on speed!)
</p>
<p>
Finally, at the left bottom you can (again) indicate whether or not there should be separate
collision masks for all subimages. (Note that if you set the bounding box manual,
a single bounding box will be used for all subimages, regardless of this setting.)
You can also indicate the tolerance with respect to the transparency. With
a higher tolerance also pixels that are partially transparent are left outside
the mask. This influences both the bounding box (when not set to manual) and the
mask for precise collision checking.
</p>
<p>
It is important to carefully decide on the collision mask you use for your sprites.
Although precise collision checking might seem the most logical option, in many
cases game play is improved by using bounding boxes or disks, or masks that are a
bit smaller than the actual sprites. If you want even further control over the mask,
note that for objects you can specify a different sprite to use as mask. In this way
you can make the collision mask completely independent of the image.
</p>
<p>
Once you are done, press <b>OK</b>. If the mask was modified, the word <b>Modified</b> will
show in the sprite form such that you are reminded that you changed some settings here.</p>
<!--HELPONLY-->
<h3>Editing Sprites</h3>
<P>
<i>Game Maker</i> has extensive possibilities to create and change your own sprites.
Information about this can be found in the following pages:
<P>
<blockquote>
<a href="202_01_editing.html">Editing your sprites</a><br>
<a href="202_02_strips.html">Strips</a><br>
<a href="202_03_individual.html">Editing individual subimages</a><br>
</blockquote>
<!--ENDHELPONLY-->
<!--END-->
</body>
</html>
<!-- KEYWORDS
collision masks
tolerance
enlarge maskk
precise collision checking
collision checking
bounding box
sprite origin
origin, sprite
-->

View File

@ -1,331 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Editing your sprites</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Editing your sprites</h3>
Up to now we loaded our sprites from files. It is though also possible to
create and in particular modify them within <i>Game Maker</i>. To do this,
open the sprite property window by double clicking on one of your sprites
(or by creating a new one). Now press the button labeled <b>Edit Sprite</b>.
A new form will appear showing all the subimages that make up the sprite.
<p>
The sprite editor form will look as follows:
<p>
<img src="images/form_sprite_editor.jpg">
<p>
At the right you see the different images that make up the sprite. Note that
in <i>Game Maker</i> all subimages of a sprite must have the same size. At
the left an animation of the sprite plays. (If you don't see the animation,
check the box labeled <b>Show Preview</b>.) Below the preview you can change
the speed of the animation and the background color. Also you can select one
of the backgrounds in your game and whether it must be streched. In this way you can
get an idea of what the animation will look like in the game. (Note that
this speed is only for preview. The speed of the animation during the
game depends on the room speed.)
<p>
The sprite editor contains many commands to create and change the sprite.
These are all given through the menus. (For some there are buttons on the
toolbar.) Some commands work on individual images. They require that you
first select a subimage with the mouse.
<H3>File menu</H3>
<p>
The file menu contains a number of commands related to loading and saving sprites.
<ul>
<li><b>New.</b>
Creates a new, empty sprite. You must indicate the size of the sprite.
(Remember, all images in a sprite must have the same size.)</li>
<li><b>Create from File.</b>
Creates the sprite from a file. Many file types can be used.
They all create a sprite consisting of a single image, except
for animated GIF files that are split into the subimages and strips
that have an name ending with _stripXX. When selecting a file
you can indicate whether the image should be opaque, whether to
remove the background, and whether to smooth the edge. You can select
multiple images which will then all be loaded. They should preferably
have the same size, otherwise, their canvas sizes will be adapted.</li>
<li><b>Add from File.</b>
Adds an image (or multiple images) from a file to the current sprite. If the
images do not have the same size you can choose where to place them
or to stretch them. You can select multiple images which will then
all be loaded. They must preferably have the same size.</li>
<li><b>Save as PNG File.</b>
Saves the sprite as a strip in a PNG file. When the sprite has multiple
subimages the text _stripXX with XX the number of subimages is automatically
appended.</li>
<li><b>Create from Strip.</b>
Allows you to create a sprite from a strip. See the next section for more information.</li>
<li><b>Add from Strip.</b>
Use this to add images from a strip. See the next section.</li>
<li><b>Close Saving Changes.</b>
Closes the form, saving the changes made to the sprite. If you don't
want to save the changes, click on the close button of the form.</li>
</ul>
<H3>Edit menu</H3>
<p>
The edit menu contains the following commands:
<ul>
<li><b>Undo.</b>
Undo the last change. The last 16 changes can be undone.</li>
<li><b>Redo.</b>
Redo the last undone change.</li>
<li><b>Cut.</b>
Cut the currently selected subimage to the clipboard. You can edit or use the
subimage in a different program this way. However, the transparency information
might be lost.</li>
<li><b>Copy.</b>
Copy the currently selected subimage to the clipboard.</li>
<li><b>Paste.</b>
Paste the image on the clipboard as a new subimage. When it has not the correct
size you should indicate how to change this. When the image came from a different
program, transparency information might be lost.</li>
<li><b>Erase.</b>
Erase the current, or all images to a particular color. A form open in which you can
select the color and the opacity (alpha) value. A preview of the result it shown. You
can indicate whether to erase all images or only the current one.</li>
<li><b>Delete.</b>
Delete the currently selected subimage.</li>
<li><b>Move Left.</b>
Move the currently selected subimage one position to the left in the sequence.</li>
<li><b>Move Right.</b>
Move the currently selected subimage one position to the right in the sequence.</li>
<li><b>Add Empty.</b>
Add a new empty subimage at the end of the sequence.</li>
<li><b>Insert Empty.</b>
Insert a new empty subimage before the currently selected subimage.</li>
<li><b>Edit.</b>
Edit the currently selected subimage using the built-in image editor.</li>
<li><b>Set Tranparency Background.</b>
Here you can indicate how the transparent area of the sprites should be shown in the
sprite editor. You can either use the (default) block pattern, or a color that you can change
by clicking on the color box.</li>
</ul>
<H3>Transform menu</H3>
<p>
In the transform menu you can perform a number of transformations on the images. For most of them
you can choose whether to apply them only to the current sub image or to all images.
<ul>
<li><b>Shift.</b>
Here you can shift the image(s) an indicated amount horizontally and vertically.</li>
<li><b>Mirror/Flip.</b>
Mirror the image(s) horizontally and/or flip them vertically.</li>
<li><b>Rotate.</b>
You can rotate the image(s) 90, 180 or 270 degrees, or an arbitrary
amount.</li>
<li><b>Scale.</b>
This command scales the image(s) (but not the image size!). You can indicate
the scale factor and whether to scale horizontally and/or vertically.</li>
<li><b>Skew.</b>
This command skews the image(s) horizontally and/or vertically with a given amount.</li>
<li><b>Resize Canvas.</b>
Here you can change the size of the canvas. You can also indicate where the
images are placed on the new canvas.</li>
<li><b>Stretch.</b>
Here you can stretch the images into a new size. You can indicate
the scale factor and the quality.</li>
<li><b>Crop.</b>
This makes the images as small as possible. This is very useful because the
larger the images, the more video memory <i>Game Maker</i> will use.
You can indicate the size of a transparent border around the images.
If you provide a negative value, the outside of the images will be cut off.</li>
</ul>
<H3>Images menu</H3>
<p>
In the images menu you can perform a number of operation on the images. Some of these
are only available in the Pro Edition.
<ul>
<li><b>Cycle Left.</b>
Cycles all images one place to the left. This effectively starts
the animation at a different point.</li>
<li><b>Cycle Right.</b>
Cycles all images one place to the right.</li>
<li><b>Black and White.</b>
Makes the image(s) black and white (that is, grayscale).</li>
<li><b>Colorize.</b>
Here you can change the color (hue) of the images.
Use the slider to pick the new hue. When you indicate to shift the
hue the colors are shifted over the amount indicated giving rather interesting
effects.</li>
<li><b>Colorize Partial.</b>
Here you can change the color (hue) of part of the images. You can
select the old hue and a tolerance around it and then indicate the new
hue with which to replace this range of colors. This can be used
for instance to change only the color of the shirts of players. You can pick the old
hue also by clicking in the left image. </li>
<li><b>Intensity.</b>
Here you can change the intensity by providing values for the color
saturation and the value of the new images.</li>
<li><b>Invert.</b>
Inverts the colors in the images.</li>
<li><b>Make Opaque.</b>
Remove all transparency information from the images, making them opaque.</li>
<li><b>Erase a Color.</b>
You can select a color (either by clicking on the color box or by clicking in the left image.
Also you specify a tolerance. All pixels with a color close the the selected color will be
made transparent.</li>
<li><b>Smooth Edges.</b>
Smooth the edges around the opaque part of the image(s) somewhat to make them look nicer.
(A stronger effect can be created by using Blur but only blurring the transparency; see below.</li>
<li><b>Opacity.</b>
Here you can change the opacity (transparency) for the whole image. You can either set it
relative to the current opacity or absolute. (Fully transparent pixels always stay fully
transparent.)</li>
<li><b>Set Alpha from File.</b>
You select an image. The lightness of the pixels of that image will be used as transparency value.
Black pixels will lead to completely transparent pixels, while white pixels will lead to opaque
pixels. When the image does not have the correct size it will be stretched.
<b><i>Only available in the Pro Edition.</i></b></li>
<li><b>Fade.</b>
Here you specify a color and an amount. The pixels in the image(s)
are now faded towards this color with the given amount.</li>
<li><b>Blur.</b>
By blurring the images the colors are mixed a bit, making it more vague. You can select a
small, medium, or large blur. Also you can select whether to blur the color values and/or
the transparency values. Only blurring the transparency values is a nice way to smooth the
boundary of the images.</li>
<li><b>Sharpen.</b>
This is sort of the reverse of blurring. The image will be made more sharp, enhancing the
edges. You can do a subtle sharpening or a strong sharpening. The special sharpening puts
additional empasis on the edges, leading to a funny effect. You can sharpen the color
values and/or the transparency values. </li>
<li><b>Outline.</b>
Create an outline around the image. You are asked for the color and a thickness of the outline.
You can also indicate to place the outline inside the image. You can indicate whether to
remove the image itself, just keeping the outline, and whether to smooth the outline.
<b><i>Only available in the Pro Edition.</i></b></li>
<li><b>Shadow.</b>
Create a shadow behind the image. (This will only work when the image is partially transparent.)
You indicate the color of the shadow and the opacity. Also you indicate the relative position
of the shadow. Finally you can indicate whether it should be a soft or a hard shadow.
<b><i>Only available in the Pro Edition.</i></b></li>
<li><b>Glow.</b>
Create a colored glow around the image.
You indicate the color of the glow, the opacity and the thickness.
You can also indicate to place the glow inside the image.
<b><i>Only available in the Pro Edition.</i></b></li>
<li><b>Buttonize.</b>
Turn the image(s) into a button. You specify the color of the button and the opacity. Also you
must indicate the thickness of the button boundary and whether it should be smooth or not.
<b><i>Only available in the Pro Edition.</i></b></li>
<li><b>Gradient Fill.</b>
Adds a gradient fill to the image(s). You specify the two colors of the fill, the opacity,
and the kind of fill. Default the image is replace by the gradient although the transparency is
maintained. By unchecking the Replace box the gradient is blended onto the image. By checking
the Change Transparency box the alpha value of the original image is changed as well. You
can create great effects. For example, make an image black-and-white and then blend a gradient
on it. <b><i>Only available in the Pro Edition.</i></b></li>
</ul>
<p>
You will have to experiment with these commands to get the sprites you want.
<H3>Animation menu</H3>
<p>
Under the animation menu you can create new animated sprites out of the current sprite.
There are many options and you should experiment a bit with them to create the effects
you want. Also don't forget that you can always save an animated sprite and later add it to
the current one. Also you can always add some empty images and delete unwanted ones.
We will briefly go through the different possibilities.
<ul>
<li><b>Set Length.</b>
Here you can change the length of your animation. The animation is
repeated enough times to create the number of frames you indicate.
(Normally you want this to be a multiple of the current number of frames.)</li>
<li><b>Stretch.</b>
This command also changes the length of the animation. But this time,
frames are duplicated or removed to get the right number. So if you
increase the number of frames the animation goes slower and if you
decrease the number it goes faster.</li>
<li><b>Reverse.</b>
Well, as you could guess this reverses the animation. So it is played backwards.</li>
<li><b>Add Reverse.</b>
This time the reverse sequence is added, doubling the number of frames.
This is very useful for making an object go left and right, change color
and return, etc. You sometimes might want to remove the double first
and middle frame that occur.</li>
<li><b>Translation Sequence.</b>
You can create an animation in which the image slightly translates in
each step. You must provide the number of frames and the total amount
to move horizontally and vertically.</li>
<li><b>Rotation Sequence.</b>
Creates an animation in which the image rotates. You can either choose
clockwise or counterclockwise rotation. Specify the number of frames and
the total angle in degrees (360 is a complete turn). (You might need to
resize the canvas first to make sure the total image remains visible
during the rotation.)</li>
<li><b>Colorize.</b>
Creates an animation that turns the image into a particular color.</li>
<li><b>Fade to color.</b>
Creates an animation that fades the image to a particular color.</li>
<li><b>Disappear.</b>
Makes the image disappear by making it more transparent in each step.</li>
<li><b>Shrink.</b>
Shrinks the image to nothing. You can indicate the direction.</li>
<li><b>Grow.</b>
Grows the image from nothing.</li>
<li><b>Flatten.</b>
Flattens the image to nothing in a given direction.</li>
<li><b>Raise.</b>
Raises the image from a given direction.</li>
<li><b>Overlay.</b>
Overlays the animation with another sprite or image in a file. You indicate the file
and the image(s) from that file are then placed on top of the current animation.
When the image from the file has a different size it is stretched.</li>
<li><b>Morph.</b>
Morphs the animation to an animation or image from a file. Note that
morphing works best if the two animations cover the same area of the
image. Otherwise, halfway certain pixels disappear and others suddenly appear.</li>
</ul>
<p>
In particular the last two commands are very powerful. For example, to blow
up an object, add a number of copies and then a number of empty frames.
Then overlay it with an explosion animation. (Make sure the numbers of images
match.) Alternatively, morph it to the explosion. With some practice you
can make great sprites.
<!--END-->
</body>
</html>
<!-- KEYWORDS
sprites editor
editing sprites
creating sprites
preview, sprite
GIF files
PNG files
animation
transformations
-->

View File

@ -1,86 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Strips</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Strips</h3>
<p>
As indicated above, sprites are normally either stored as animated gif files or
as strips in PNG files, in which all subimages are placed next to each other. In the
second case the file name should end with _stripXX where XX indicates the number
of subimages.
<p>
However, sometimes sprites are part of a larger bitmap in which the sub images can
be stored next to each other or below each other and maybe there are separating lines
between them. Such a strip cannot be read automatically as <i>Game Maker</i> will not
know the size and position of the subimage. For example, the following piece of a strip file
contains four different animations.
<p>
<img src="images/sprites2.gif">
<p>
If you want to pick a certain animation out of such a file you must indicate where the
images are. To this end you can choose
<b>Create from Strip</b> or <b>Add from Strip</b> from the <b>File</b> menu
in the sprite editor.
After indicating the appropriate strip image file, the following form will show:
<p>
<img src="images/form_strip.jpg">
<p>
At the right you see (part of) the strip image you selected. At the left you
can specify a number of parameters that specify which subimages you are
interested in. Note that one or more rectangles in the image indicate the
images you are selecting. The following parameters can be specified:
<p>
<ul>
<li><b>Number of images.</b>
This is the number of sub images you want to take from the strip.</li>
<li><b>Images per row.</b>
How many images of the ones you want are there per row. For example,
by setting this to 1 you will select a vertical sequence of images.</li>
<li><b>Image width.</b>
Width of the individual images.</li>
<li><b>Image height.</b>
Height of the individual images.</li>
<li><b>Horizontal cell offset.</b>
If you don't want to select the top-left images, you can set here
how many images should be skipped horizontally.</li>
<li><b>Vertical cell offset.</b>
Here you indicate how many images to skip vertically.</li>
<li><b>Horizontal pixel offset.</b>
Sometimes there is some additional space at the left top.
Here you indicate this amount (in pixels). You can also use the mouse to indicate
the place where the first image should start</li>
<li><b>Vertical pixel offset.</b>
Vertical amount of extra space.</li>
<li><b>Horizontal separation.</b>
In some strips there are lines or empty space between the images. Here
you can indicate the horizontal amount to skip between the images (in pixels).</li>
<li><b>Vertical separation.</b>
Vertical amount to skip between the images.</li>
</ul>
<p>
Once you selected the correct set of images, press <b>OK</b> to create your sprite.
Please remember that you are only allowed to use images created by others when you
have their permission or when they are freeware.
<!--END-->
</body>
</html>
<!-- KEYWORDS
strips
-->

View File

@ -1,248 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Editing individual images</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Editing individual images</h3>
<i>Game Maker</i> has a built-in image editor that can be used to edit
individual subimages of sprites and background images. To call the editor
for a subimage of a sprite, select the subimage in the sprite editor
and choose <b>Edit Image</b> from the <b>Image</b> menu (or double click on it).
To edit a background, open the background properties for and press the button
<b>Edit Background</b>.
<p>
The built-in image editor is pretty powerful and especially suited for creating
sprites and backgrounds for <i>Game Maker</i>. However, it does not have all
the features of full-blown paint and drawing packages. The buitl-in editor
is primarily meant for making changes to images, not for creating sprites and
backgrounds from scratch. For this you probably want to use a separate paint
program, save the images as PNG files, and load them into <i>Game Maker</i>.
You can also set an external image editor in the preferences.
<p>
When you start the image editor it will typically looks as follows:
<p>
<img src="images/form_image_editor.jpg">
<p>
The form shows the image in the middle and a number of drawing tools at
the left. Below there you can set certain properties of the drawing tools.
These will change depending on the tool you select (see below). In the middle
you see the current image. You can zoom in and out using the buttons on the
toolbar. At the right there is information about the colors with which the draw.
You can set a separate color for the left and the right mouse button. You can change
these by clicking with the left or right mouse button in the color selector images.
Also you can change them by clicking in the boxes at the top that repesent the colors.
Below the colors you see the Opacity. This indicates how opaque or transparent the color is.
When you set it to 255 the pixels your draw are fully opaque. When you set it to 0
they are fully transparent. Normally when you draw partially transparent pixels they
are blended with the current color. By setting the Color Mode to Replace, the pixels
will be replaced with the new color. Finally at the bottom of the form there is a
statusbar with some infomation about the current drawing tool, the position of the mouse,
the size of the image, and the amount of memory it requires.
<h3>Drawing tools</h3>
<p>
The following drawing tools are available (from left to right, top to bottom).
<ul>
<li><b>Paint.</b>
With this tool you can paint on the image. You can use the left or right mouse
button to paint in the different colors. You can select the size of the pen.
When holding &lt;Shift&gt; when starting to paint you only paint horizontal or
vertical lines. When holding the &lt;Ctrl&gt; key you can select a new paint color.</li>
<li><b>Spray.</b>
With this tool you can spray on the image. Spray is like paint except that you use a
brush that is partially transparent at the sides. You can use the left or right mouse
button to paint in the different colors. You can select the size of the brush. You can
also select the hardness of the brush. A soft brush will be more transparent near the sides.
When holding &lt;Shift&gt; when starting to spray you only paint horizontal or
vertical lines. When holding the &lt;Ctrl&gt; key you can select a new spray color.</li>
<li><b>Erase.</b>
With this tool you can erase part the image. It looks a lot like spray but you erase
what is below the mouse. How much you erase depends on the the Opacity. For a value of
255 you erase completely. For a smaller value you only make the image a bit more
transparent. You can set the hardness of the eraser.
When holding &lt;Shift&gt; when starting to spray you only paint horizontal or
vertical lines.</li>
<li><b>Color Picker.</b>
With this tool you can set the left or right mouse color to the color of a pixel in the
image. Note that also the opacity value is set.</li>
<li><b>Line.</b>
With this tool you can can draw straight lines.
When holding &lt;Shift&gt; you can draw horizontal, vertical, or diagonal lines.
You can set the width of the line and whether is should have arrows. By selecting <b>Anti-alias</b>
the line is drawn with partially transparent pixels on the side to make it more smooth.</li>
<li><b>Polygon.</b>
With this tool you can can draw a closed polygon. You click on the position of the first vertex.
Next you can either drag the next vertex or click on the position of the next vertex. In this way
you continue. You end the polygon with the &lt;Esc&gt; key.
When holding &lt;Shift&gt; you can draw horizontal, vertical, or diagonal lines.
You can set the width of the line and whether the polygon should be filled or not.
By selecting <b>Anti-alias</b>
the polygon is drawn with partially transparent pixels on the side to make it more smooth.</li>
<li><b>Rectangle.</b>
With this tool you can can draw a rectangle.
When holding &lt;Shift&gt; you can draw a square.
When holding &lt;Ctrl&gt; you draw the rectangle from the center.
You can set the width of the line and whether the rectangle should be filled or not.
By selecting <b>Anti-alias</b>
the rectangle is drawn with partially transparent pixels on the side to make it more smooth.</li>
<li><b>Ellipse.</b>
With this tool you can can draw an ellipse.
When holding &lt;Shift&gt; you can draw a circle.
When holding &lt;Ctrl&gt; you draw the ellipse from the center.
You can set the width of the line and whether the ellipse should be filled or not.
By selecting <b>Anti-alias</b>
the ellipse is drawn with partially transparent pixels on the side to make it more smooth.</li>
<li><b>Rounded Rectangle.</b>
With this tool you can can draw a rounded rectangle.
When holding &lt;Shift&gt; you can draw a square.
When holding &lt;Ctrl&gt; you draw the rounded rectangle from the center.
You can set the width of the line and whether the rounded rectangle should be filled or not.
By selecting <b>Anti-alias</b>
the rounded rectangle is drawn with partially transparent pixels on the side to make it more smooth.</li>
<li><b>Select Region.</b>
With this tool you can can select a rectangular region. You can extend the current selection by
holding the &lt;Shift&gt; key. Also you can remove parts by holding the &lt;Ctrl&gt; key.
Once you made a selection you can pick it up with the mouse and drag it to a new position. When you
use the right mouse button you make a copy. The selection can also be cut or copied to the
clipboard. It can be deleted with the &lt;Del&gt; key. You can end the selection using the
&lt;Esc&gt; key.</li>
<li><b>Select with Magic Wand.</b>
In this case you make the selection by clicking on a pixel. All connected pixels with the same
color will be selected. You can indicate the tolerance in color valu with which to select pixels
and whether only the color or also the transparency value should match. You can extend the current selection by
holding the &lt;Shift&gt; key. Also you can remove parts by holding the &lt;Ctrl&gt; key. You can
manipulate the selection as above.</li>
<li><b>Select by Spraying.</b>
In this case you make the selection by spraying with the mouse on the image. You can set the size
of the selector. For the rest the selection can be treated as above. Different selection types
can be combined.</li>
<li><b>Text.</b>
To add a text click on the image. A pop-up window appears in which you
can enter the text. Use the # symbol to insert a newline. Once you press
<B>OK</B> the text is put in the image, with a box around it. You can now move
the text by pressing with the mouse in the box and dragging the text. You can change
the text by clicking with the right mouse button in the box. You can set the Font of the text
and how the different lines should be alligned.</li>
<li><b>Fill.</b>
Click on a pixel in the image and all connected pixels with the same color will be turned
into the new pixel. You can set the tolerance with which the color should match. Also you can
set whether to only match on the color value or also take the transparency value into account.
Not that when the Color Mode is set to Blend the fill color is blended with the existing one. To
replace it, set the Color Mode to Replace.</li>
<li><b>Change Color.</b>
Click on a pixel in the image and all pixels in the image with the same color will be turned
into the new pixel. You can set the tolerance with which the color should match. Also you can
set whether to only match on the color value or also take the transparency value into account.
Not that when the Color Mode is set to Blend the new color is blended with the existing one. To
replace it, set the Color Mode to Replace.</li>
</ul>
<p>
<h3>Menus</h3>
A number of further commands is available through the menus. For some of these there is a corresponding
button on the tool bar.
<h4>File menu</h4>
<ul>
<li><b>New.</b>
Creates a new, empty image. You must indicate the size of the image. (When the image is part of
a sprite with multiple images you cannot set the size.)
(Remember, all images in a sprite must have the same size.)</li>
<li><b>Open.</b>
Open an image from a file. This menu item is not available when the image is part of
a sprite with multiple images.</li>
<li><b>Previous Image.</b>
Only available when the image is part of
a sprite with multiple images. Saves the changes and opens the previous subimage.</li>
<li><b>Next Image.</b>
Only available when the image is part of
a sprite with multiple images. Saves the changes and opens the next subimage.</li>
<li><b>Save as PNG File.</b>
Saves the image as a PNG file. No other file formats are supported.</li>
<li><b>Close Saving Changes.</b>
Closes the form, saving the changes made to the image. If you don't
want to save the changes, click on the close button of the form.</li>
</ul>
<h4>Edit menu</h4>
Here you find the usual commands to Undo the last change and Redo the last undo, to delete, cut, or
copy the current selection to the clipboard, to paste the image on the clipboard as a selection
in the image, and to select all. (Note that when using the clipboard, transparency information might
be lost.) Two additional commands require a bit more explanation.
<ul>
<li><b>Erase to Left Color.</b>
This erases the image and replaces it by the left color (and opacity setting).</li>
<li><b>Paste from File.</b>
You can select an image from a file. This image is then pasted into the current image
as a selection. You can then move that selection to the appropriate place.</li>
</ul>
<h4>View menu</h4>
<ul>
<li><b>Zoom Out.</b>
You can zoom out to see more of the image. You can also hold the &lt;Ctrl&gt; key
and move the mouse scroll wheel to zoom in or out.</li>
<li><b>No Zoom.</b>
Sets the image back to the normal size.</li>
<li><b>Zoom In.</b>
You can zoom in to more precisely draw in an area of the image.</li>
<li><b>Toggle Grid.</b>
You can toggle the grid on or off. Note that the grid is only shown when you
zoom in enough.</li>
<li><b>Grid Options.</b>
Here you can set the size of the grid and the color. You can indicate whether to use exclusive
or when drawing the grid (might make it more visible) and whether the drawing should be snapped
to the grid.</li>
<li><b>Show Preview.</b>
Show a preview of the image in the right bottom corner in the normal size. This is in particular
useful when you are zooming in a lot to make small changes. If the image is larger than the preview
are you can use the mouse to drag the part of the image you want to see. You can also double click
on the preview image to open a separate preview window in which you can see the complete image.</li>
<li><b>Set Tranparency Background.</b>
Here you can indicate how the transparent area of the image should be shown in the
sprite editor. You can either use the (default) block pattern, or a color that you can change
by clicking on the color box.</li>
</ul>
<h4>Transform menu</h4>
This menu contains the same transformation commands as in the sprite editor. You can read about
their function there. Note that <b>Resize Canvas</b>, <b>Stretch</b>, and <b>Crop</b> are not
available when the image is part of a sprite with multiple images, because in that case we
cannot change the size of the image.
<h4>Image menu</h4>
This menu contains the same commands as in the sprite editor. You can read about
their function there. Note that some commands are only available in the Pro Edition.
<!--END-->
</body>
</html>
<!-- KEYWORDS
image editor
image transformations
paint program
-->

View File

@ -1,97 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>More about sounds and music</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>More about sounds and music</h1>
In advanced mode you have a lot more control over the sounds and
pieces of music you add to your game. When you add a sound resource the
following form will show:
<p>
<img src="images/form_sound_advanced.jpg">
<p>
Besides the buttons to load, save, and play sounds there are a lot
of settings now that will be discussed here.
<p>
First of all you can indicate the kind of sound. Four kinds are possible.
Normal sounds are in general used for sound effects in wave files (although
they can be used for midi files as well). Multiple normal sounds can play
at the same time. You can even play multiple copies of the same sound
simultaneously. Background music is similar to normal sounds but only
one can play at any moment. So once you start a new background sound, the
currently playing one will be stopped. Midi files are default background
music. 3D sound is sound for which you can apply 3D settings through
special functions. You will only need these for advanced sound effects.
<p>
Sound files are normally played through DirectX. This gives many possibilities
but is limited to wave and midi files. If you want to play other files, like
mp3 files, you should select the option to use the media player. This is much
more limited though. No volume changes or effects can be used and only one piece
can play at once.
Note that midi files, when played through the media player may sound different
from playing them as background or normal sounds. The reason is that the media
player uses the hardware synthesizer (which is different on each machine) while
otherwise a software version is used (which sounds the same on all machines).
Preferably don't use mp3 files in you games.
They need to be decompressed which takes
processing time and might slow down the game. The fact that the file size is
smaller does not mean that they use less memory. Also, not all machines
support them. So your game might not run on all machines.
<p>
Secondly, you can indicate some sound effects, like chorus or echo (only in the Pro Edition
of <i>Game Maker</i>!) You can select any combination. You can immediately
listen to the results. (When using GML code you can even change the parameters
of these effects.)
<p>
Also you can indicate the default volume of the sound and whether to
pan it to the left or the right speaker.
<p>
For all sounds you can indicate whether they should be preloaded or not.
When a sound is played it must be loaded into audio memory. If you preload
the sound this is done at the start of the game, making it immediately
available for playback. When not, it is loaded the first time it is used.
This will save memory but might give a small delay the first time the sound
is used.
<p>
<i>Game Maker</i> does not have a built-in sound editor. But in the
preferences you can indicate external editors that you want to use for
editing sounds. If you selected these you can press the button labeled
<b>Edit Sound</b> to edit the current sound. (The <i>Game Maker</i> window will
be hidden while you edit the sound and returns when you close the sound
editor.)
<!--END-->
</body>
</html>
<!-- KEYWORDS
background music
sound kind
3D sound
sound 3D
mp3 files
sound effects
chorus
echo
volume
panning sound
preloading sounds
sound editor
editing sounds
-->

View File

@ -1,64 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>More about backgrounds</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>More about backgrounds</h1>
In advanced more there are a number of additional options for background.
First of all, a new button <b>Save Background</b> has appeared. With this
button you can save the background in a proprietary format. This will not only
store the image itself but also for example information about the tiles (see below).
These files will have the extension .gmbck. You can load them in <i>Game Maker</i>
and while running a game.
Also you can also change a background or create your own backgrounds by pressing the
button labeled <b>Edit Background</b>. A built-in image editor opens that has many
features. Please realize that this is not a full-blown program and if you require
more advanced editing tools you might want to use a separate drawing program.
For more information on how to use the image editor see the section on
<a href="202_03_individual.html">Editing images</a>.
<p>
Sometimes you want to use a background as a set of tiles, that is, a collection
of smaller images in one big image. When create the rooms you can then add these
subimages at different places in the room. This is very useful for creating
nice looking levels. To use a background as a tile set, check the box labelled
<b>Use as tile set</b>. The form now changes to look as follows:
<p>
<img src="images/form_background_advanced.jpg">
<p>
You can indicate a number of settings for the tile set. In particular you can
indicate the width and height of each tile. (Only one size can be given, so
better make sure that all tiles in the set have the same size. If you have
different sizes, create two or more tile sets.) You can also indicate an
offset where the top leftmost tile starts. Finally, a
separation between the tiles (this is normally 0 or 1) can be indicated.
For more information on using tiles, see the section on
<a href="210_02_tiles.html">Adding Tiles</a> when creating rooms.
<p>
A word of warning is required here. When you put separating borders between the
sprites and use interpolation between pixels (see the global game settings) this
can result in cracks between the tiles. Better make sure the pixels around the
tiles actually match with the pixels just inside the tiles to avoid this. You can
easily achieve this by editing the background and changing the color of such pixels.
<!--END-->
</body>
</html>
<!-- KEYWORDS
creating backgrounds
saving backgrounds
painting backgrounds
tile sets
-->

View File

@ -1,123 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>More about objects</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>More about objects</h1>
When you create an object in advanced mode, you can change some more
advanced settings.
<h3>Depth</h3>
First of all, you can set the <b>Depth</b> of the instances of the object.
When the instances are drawn on the screen they are drawn in order of depth.
Instances with the largest depth are drawn first. Instances with the
smallest depth are drawn last. When instances have the same depth, they are
drawn in the order in which they were created. If you want to guarantee that
an object lies in front of the others give it a negative depth. If you want
to make sure it lies below other instances, give it a large positive depth.
You can also change the depth of an instance during the game using the
variable called depth.
<h3>Persistent objects</h3>
Secondly, you can make an object persistent. A persistent object will
continue existing when you move from one room to the next. It only
disappears when you explicitly destroy it. So you only need to put an
instance of the object in the first room and then it will remain available
in all rooms. This is great when you have a main character that moves
from room to room. Using persistent objects is a powerful mechanism but also
one that easily leads to errors.
<h3>Parents</h3>
Every object can have a parent object. When an object has a parent, it
inherits the behavior of the parent. Stated differently, the object is a sort
of special case of the parent object. For example, if you have 4 different
balls, named ball1, ball2, ball3 and ball4, which all behave the same but
have a different sprite, you can make ball1 the parent of the other three.
Now you only need to specify events for ball1. The others will inherit the
events and behave exactly the same way. Also, when you apply actions to
instances of the parent object they will also be applied to the children.
So, for example, if you destroy all ball1 instances the ball2, ball3,
and ball4 instances will also be destroyed. This saves a lot of work.
<p>
Often, objects should behave almost identically but there will be
some small differences. For example, one monster might move up and down and
the other left and right. For the rest they have exactly the same behavior.
In this case almost all events should have the same actions but one or two
might be different. Again we can make one object the parent of the other.
But in this case we also define certain events for the child object. These
events &quot;override&quot; the parent events. So whenever an event for the
child object contains actions, these are executed instead of the event of
the parent. If you also want to execute the parent event you can call the
so-called &quot;inherited&quot; event using the appropriate action.
<p>
It is actually good practice in such cases to create one base object.
This base object contains all the default behavior
but is never used in the game. All actual objects have this base object as parent.
Parent objects can again have parents, and so on. (Obviously you are not
allowed to create cycles.) In this way you can create an object hierarchy.
This is extremely useful to keep your game structured and you are strongly
advised to learn to use this mechanism.
<p>
There is also a second use of the parent object. It also inherits the
collision behavior for other objects. Let us explain this with an example.
Assume you have four different floor objects. When a ball hits the floor it
must change direction. This has to be specified in the collision event of
the ball with the floor. Because there are four different floors we need to
put the code on four different collision events of the ball. But when you
make one base floor object and make this one the parent of the four actual
floor objects, you only need to specify the collision event with this base
floor. The other collisions will perform the same event. Again, this saves a
lot of copying.
<p>
As indicated, wherever you use an object, this also implies the descendants.
This happens when, in an action, you indicate that the action must be
applied to instances of a certain object. It also happens when you use the
<tt>with()</tt> statement in code (see below). And it works when you call
functions like <tt>instance_position</tt>, <tt>instance_number</tt>, etc.
Finally, it works when you refer to variables in other objects. In the
example above when you set <tt>ball1</tt>.speed to 10 this also applies to
ball2, ball3 and ball4.
<h3>Masks</h3>
When two instances collide a collision event occurs. To decide whether two
instances intersect, the sprites are used. This is fine in most cases, but
sometimes you want to base collisions on a different shape. For example, if
you make an isometric game, objects typically have a height (to give them a
3D view). But for collisions you only want to use the ground part of the
sprite. This can be achieved by creating a separate sprite that is used as
collision mask for the object.
<h3>Information</h3>
The button <b>Show Information</b> gives an overview of all information for
the object that can also be printed. This is particularly useful when you
loose overview of all your actions and events.
<!--END-->
</body>
</html>
<!-- KEYWORDS
depth
persistent objects
persistence, objects
parent object
inheritance
masks
object information
-->

View File

@ -1,38 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>More actions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>More actions</h1>
In advanced mode there are a number of additional actions available which will be described here.
<!--HELPONLY-->
<P>
Information on the different additional actions can be found in the
following pages:
<P>
<blockquote>
<a href="206_01_move.html">More Move Actions</a><br>
<a href="206_02_main.html">More Main Actions</a><br>
<a href="206_03_control.html">More Control Actions</a><br>
<a href="206_04_draw.html">More Draw Actions</a><br>
<a href="206_05_particles.html">Particle Actions</a><br>
<a href="206_06_extra.html">Extra Actions</a><br>
</blockquote>
<!--ENDHELPONLY-->
<!--END-->
</body>
</html>

View File

@ -1,74 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>More move actions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>More move actions</h3>
Some additional move actions are available in advanced mode. The following actions are added:
<p>
<b><img src="images/action_path.bmp"> Set Path</b><br>
With this action you can specify that the instance should follow a particular path.
You indicate the path that must be followed and the speed in pixels per step.
When the speed is positive the instance starts at the beginning of the path.
If it is negative it starts at the end. Next you specify the end behavior,
that is, what should happen when the end of the path is reached. You can
choose to stop the motion, restart from the beginning, restart from the current
position (which is the same when the path is closed), or reverse the motion.
Finally you can indicate that the path must be seen as absolute, that is, the
position will be as indicated in the path (this is useful when you have designed
the path at a particular place in the room) or relative, in which case the start
point of the path is placed at the current location of the instance (end point
when speed is negative). See the chapter on paths for more information.
<p>
<b><img src="images/action_pathend.bmp"> End Path</b><br>
Use this action to stop the path for the instance.
<p>
<b><img src="images/action_pathposition.bmp"> Path Position</b><br>
With this action you can change the current position of the instance in the path.
This must be a value between 0 and 1 (0=beginning, 1=end).
<p>
<b><img src="images/action_pathspeed.bmp"> Path Speed</b><br>
With this action you can change the speed of the instance on the path.
A negative speed moves the instance backwards along the path. Set it to 0 to
temporarily stop the motion along the path.
<p>
<b><img src="images/action_steplinear.bmp" > Step Towards</b><br>
This action should be placed in the step event to let the instance take a step
towards a particular position. When the instance is already at the position it
will not move any further. You specify the position to move to, the speed with
which to move, that is, the size of the step, and whether the motion should stop
when hitting a solid instance or when hitting any instance.
<p>
<b><img src="images/action_steppotential.bmp"> Step Avoiding</b><br>
This is a very powerful motion action. It should be placed in the step event.
Like the previous action it lets the instance take a step towards a particular
position. But in this case it tries to avoid obstacles. When the instance would
run into a solid instance (or any instance) it will change the direction of
motion to try to avoid the instance and move around it. The approach is not
guaranteed to work but in most easy cases it will effectively move the instance
towards the goal. For more complicated cases, there are motion planning functions.
You specify the position to move to, the speed with which to move, that is, the
size of the step, and whether the motion should avoid solid instances or any instance.
<!--END-->
</body>
</html>
<!-- KEYWORDS
setting path
avoiding objects
-->

View File

@ -1,157 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>More main actions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>More main actions</h3>
Some additional main actions are available in advanced mode. The following actions are added:
<p>
<b><img src="images/action_timeline_set.bmp"> Set Time Line</b><br>
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.
<p>
<b><img src="images/action_timeline_position.bmp"> Time Line Position</b><br>
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.
<p>
<b><img src="images/action_timeline_speed.bmp"> Time Line Speed</b><br>
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.
<p>
<b><img src="images/action_timeline_start.bmp"> Start Time Line</b><br>
This action starts the time line from its current position (if it is paused or stopped).
<p>
<b><img src="images/action_timeline_pause.bmp"> Pause Time Line</b><br>
This action pauses the time line. Use the start action to let it continue.
<p>
<b><img src="images/action_timeline_stop.bmp"> Stop Time Line</b><br>
This action stops the time line and sets the position back to 0.
<p>
<b><img src="images/action_splash_text.bmp"> Splash Text</b><br>
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 <b>Include Files</b> in the <b>Resources</b> menu.
(Note that no scrollbar will be shown nor is
there another way to scroll the text. So the text must fit the window.)
<b><i>This action is only available in the Pro Edition.</i></b>
<p>
<b><img src="images/action_splash_image.bmp"> Splash Image</b><br>
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 <b>Include Files</b> in the <b>Resources</b> 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.
<b><i>This action is only available in the Pro Edition.</i></b>
<p>
<b><img src="images/action_splash_web.bmp"> Splash Webpage</b><br>
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
<tt>http://www.yoyogames.com</tt>) 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 <tt>"" + working_directory + "\index.html"</tt>.
(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 <b>Include Files</b> in the <b>Resources</b> menu.
You can e.g. use this to create fancy help pages for your game.
<b><i>This action is only available in the Pro Edition.</i></b>
<p>
<b><img src="images/action_splash_video.bmp"> Splash Video</b><br>
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 <b>Include Files</b> in the <b>Resources</b> menu.
<b><i>This action is only available in the Pro Edition.</i></b>
<p>
<b><img src="images/action_splash_settings.bmp"> Splash Settings</b><br>
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.)
<b><i>This action is only available in the Pro Edition.</i></b>
<p>
<b><img src="images/action_resourcesprite.bmp"> Replace Sprite</b><br>
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.
<b><i>This action is only available in the Pro Edition.</i></b>
<p>
<b><img src="images/action_resourcesound.bmp"> Replace Sound</b><br>
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.
<b><i>This action is only available in the Pro Edition.</i></b>
<p>
<b><img src="images/action_resourcebackground.bmp"> Replace Background</b><br>
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.
<b><i>This action is only available in the Pro Edition.</i></b>
<!--END-->
</body>
</html>
<!-- KEYWORDS
replacing resources
showing videos
video display
movie display
showing splash screens
splash screens
fancy help
webpage display
showing webpages
webpage
show website
website
time line
looping time lines
-->

View File

@ -1,35 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>More control actions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>More control actions</h3>
Some additional control actions are available in advanced mode. The following actions are added:
<p>
<b><img src="images/action_script.bmp"> Execute Script</b><br>
With this action you can execute a script that you added to the game.
You specify the script and the maximal 5 arguments for the script.
<p>
<b><img src="images/action_inherited.bmp"> Call Parent Event</b><br>
This action is only useful when the object has a parent object.
It calls the corresponding event in the parent object.
<!--END-->
</body>
</html>
<!-- KEYWORDS
inherited event
calling inherited event
script action
-->

View File

@ -1,31 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>More draw actions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>More draw actions</h3>
The following additional draw action is available in advanced mode:
<p>
<b><img src="images/action_font.bmp"> Set Font</b><br>
You can set the font that is from this moment on used for drawing text.
This must be one of the font resources you have define. If you choose No Font
a default 12 point Arial font is used.
<!--END-->
</body>
</html>
<!-- KEYWORDS
setting fonts
current font
font action
-->

View File

@ -1,164 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Particle actions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Particle actions</h3>
A set of action dealing with particles is available on the <b>Extra</b> tab.
<b><i>These actions are only available in the Pro Edition of <i>Game Maker</i></i></b>.
<p>
Particle systems are meant to create special effects. Particles are small
elements (represented by a pixel or a little shape). Such particles move
around according to predefined rules and can change color while they move.
Many such particles together can create e.g. fireworks, flames, rain, snow,
star fields, flying debris, etc.
<p>
<img src="images/particles.jpg" width="155" height="172">
<p>
<i>Game Maker</i> contains an extensive particle system that can be accessed through
functions. A more limited particle system can be accessed through the actions described below.
<p>
A particle system can deal with particles of different types. After creating
the particle system the first thing to do is specify the particle types. Using
the actions below you can specify up to 16 types of particles. Each type has a shape,
a size, a start color and an end color. The color slowly changes from the start color
to the end color. Particles have a limited life time. In the type you specify the
minimal and maximal life time of the particles. Particles also have a speed and a
direction. Finally, gravity and friction can work on particles.
<p>
After you specify the particle types you must create them at places in
the room. You can either burst a number of particles of a particular type
from a place or you can create a constant stream of particles appearing.
Particles appear at emitters. The particle system can have up to 8 emitters
working at the same time. So after you create the particle types you must
create the emitters and tell them to burst or stream particles.
<p>
Here is the complete set of actions. Best experiment with them to get the required effect.
<p>
<b><img src="images/action_partsystcreate.bmp"> Create Part System</b><br>
This action creates the particle system. It must be called before any other actions
can be used. You only need to call it once. You can specify the depth at which the
particles are drawn. If you use a large positive depth the particles appear behind
the instances. If you use a negative depth they appear in front of the instances.
<p>
<b><img src="images/action_partsystdestroy.bmp"> Destroy Part System</b><br>
This action destroys the particle system, freeing all its memory. Don't forget to
call this (e.g. when you move to a different room) because particle systems use a lot of storage.
<p>
<b><img src="images/action_partsystclear.bmp"> Clear Part System</b><br>
This action removes all the particles currently visible. It does not stop the emitters
so new particles might be created again if you have streaming emitters (see below).
<p>
<b><img src="images/action_parttypecreate.bmp"> Create Particle</b><br>
With this action you create a particle type. You can choose one of the 16 types
available. For the particle type you can specify its shape or the sprite to be
used for it. If you specify a sprite the sprite will be used. If you set the sprite
to no sprite, the shape will be used. There are a number of interesting built-in
shapes. You also indicated its minimal and
maximal size (when the particle appears a random value between these bounds is
used). Finally you specify the increase in size in each step. For a decrease, use
a negative value. Note that only a particle type is created, not an actual particle.
For this you need emitters (see below).
<p>
<b><img src="images/action_parttypecolor.bmp"> Particle Color</b><br>
A particle can have a color (default the color is white). With this action you can
set the color to be used for a particular type. You must indicate the particle type
the color is defined for. Next you specify how a color is applied. Either a random
color is choosen between two given colors, or the color starts with the first color
and than gradually over the lifetime of the particle, it changes to the second color.
Both colors must be given. Finally you can indicate the alpha transparency. You specify
the transparency at the moment the particle is created and when it dies. The transparency
slowly changes between these values. It is normally nice to decrease the alpha value over the
lifetime of a particle.
<p>
<b><img src="images/action_parttypelife.bmp"> Particle Life</b><br>
A particle lives for a limited number of steps. After this is disappears. With this
action you set the life time for a particle type. You give two limiting values and the actual
life time is chosen randomly between them.
<p>
<b><img src="images/action_parttypespeed.bmp"> Particle Speed</b><br>
With this action you can set the speed and direction of motion for a particle type.
Again you give two limits and the actual value is chosen randomly between them. For
example, to make the particle move in a random direction, give 0 and 360 for the
limits for the direction. You can also specify a friction. This amount is subtracted
from the speed in each step until it becomes 0. (You can make a particle speed up
by using a negative friction.)
<p>
<b><img src="images/action_parttypegravity.bmp"> Particle Gravity</b><br>
With this action you set the amount of gravity and direction of gravity for a
particular particle type. 270 is downwards.
<p>
<b><img src="images/action_parttypesecondary.bmp"> Particle Secondary</b><br>
This is a bit more complicated. Particles can create other particles during their
life time and when they die. With this action you can specify this. You can define
the type and number of particles that must be created at each step during the life
time and you can specify the type and number of particles that must be created when
the particle dies. Be very careful here. You can easily create huge numbers of
particles in this way, slowing down the system considerably. For the numbers you
can also use a negative value. A negative value x means that in each step a
particle is created with chance -1/x. So for example, if you want to generate a
secondary particle about every 4 steps, use a value of -4. Secondary particles
are great for creating effects like tails of particles or exploding particles.
<p>
<b><img src="images/action_partemitcreate.bmp"> Create Emitter</b><br>
This action creates a particle emitter. Particles are generated by emitters.
You can have up to eight emitters. Choose the emitter and specify the shape of
it and its size and position (in the form of a bounding box).
<p>
<b><img src="images/action_partemitdestroy.bmp"> Destroy Emitter</b><br>
This action destroys the indicated emitter. Note that existing particles that
came from this emitter are not removed.
<p>
<b><img src="images/action_partemitburst.bmp"> Burst from Emitter</b><br>
Even if you defined a particle type and an emitter there are still no particles.
You still have to tell the emitter to generate the particles. With this action you
tell a particular emitter to generate a given number of particles of a given type.
All these particles are generated at once. For the number you can also use a negative
value. A negative value x means that a particle is created with chance -1/x. So for
example, if you want to generate a particle with a chance of 25 percent, use a value of -4.
<p>
<b><img src="images/action_partemitstream.bmp"> Stream from Emitter</b><br>
With this action you tell a particular emitter to stream a given number of particles
of a given type. In each step this number of particles is generated, leading to a
continuous stream of particles. The emitter will continue streaming particles until
you destroy it or tell it to stream 0 particles. For the number you can also use a
negative value. A negative value x means that in each step a particle is created
with chance -1/x. So for example, if you want to generate a particle about every
4 steps, use a value of -4.
<!--END-->
</body>
</html>
<!-- KEYWORDS
particle actions
particle systems
-->

View File

@ -1,65 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Extra actions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Extra actions</h3>
<p>
On the <b>Extra</b> tab there also are a number of actions related to the playing of CDs.
<b><i>These actions are only available in the Pro Edition of <i>Game Maker</i></i></b>.
<p>
<b><img src="images/action_cdplay.bmp"> Play CD</b><br>
With this action you can play some tracks from a CD in the default
CD-drive. You specify the starting track and the final track.
<p>
<b><img src="images/action_cdstop.bmp"> Stop CD</b><br>
Stops the currently playing CD.
<p>
<b><img src="images/action_cdpause.bmp"> Pause CD</b><br>
Pauses the currently playing CD.
<p>
<b><img src="images/action_cdresume.bmp"> Resume CD</b><br>
Resumes a paused CD.
<p>
<b><img src="images/action_ifcd.bmp"> Check CD</b><br>
If there is a CD in the default drive then the next action is executed.
<p>
<b><img src="images/action_ifcdplay.bmp"> Check CD Playing</b><br>
If a CD is playing in the default drive then the next action is executed.
<p>
Finally, there are an additional action that can be useful in certain games.
<p>
<b><img src="images/action_mouse.bmp"> Set Cursor</b><br>
You can use this action to replace the windows mouse cursor by a sprite.
You specify the sprite and whether the windows mouse cursor should still be shown.
The sprite can be animated. Note that the sprite will only be shown in the room,
not in the area outside it.
<!--END-->
</body>
</html>
<!-- KEYWORDS
change cursor
snapshot
CD actions
playing CDs
-->

View File

@ -1,71 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Constants</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Constants</h1>
<b><i>This functionality is only available in the Pro Edition of Game Maker.</i></b>
<p>
In advanced mode you can define constants that you can use in scripts and
in values for actions. Each constant has a name
and a value. Names should follow the same rules as variables, that is,
they must start with a letter or underscore symbol and further consist
of letters, digits or underscore symbols. You are though strongly
recommended to make all your constants easily distinguishable. A usual
convention is to use only capital letters and underscores.
<p>
To define constants you chose <b>Define Constants</b> from the <b>Resources</b> menu.
The following form will show (in which already some constants have been defined):
</p>
<p>
<img src="images/form_constants.jpg">
<p>
At the top you see the constants. At the left there is the name and at the right the
value. You can select the name or value with the mouse and change it by typing.
A value of a constant should be a constant expression. That is, it is
either a constant number or a string (with quotes around it) or it is an
expression. The expression is evaluated before anything else happens
in the game. So it for example cannot reference the current room, instances, or
scripts. But it can contain the built-in constants and the names of
resources.
<p>
You can append a constant at the end of the list using the button <B>Add</B> (or by pressing Enter)
and delete it using
<B>Delete</B>. You can also insert a constant above the current selected constant.
There are also buttons to clear all constants, to move them
up or down in the list, and to sort them by name.
<p>
Finally you can save all constants to a text file or load them from a text file. This is useful when you want
to store collections of useful constants for later use. When loading constants they are appended to the current list.
The text file can also be editor using a text editor. Each line contains a constant definition of the form
NAME=VALUE.
</p>
<p>
It is good practise to put any value that you use multiple times in a constant. Also, if you
are not completely sure about a certain value you better put it in a constant as it is a
lot easier to change the constants than to find the values in the scripts and actions and
change them there.
<!--END-->
</body>
</html>
<!-- KEYWORDS
constants
defining constants
adding constants
using constants
-->

View File

@ -1,138 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Trigger events</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Trigger events</h1>
<b><i>This functionality is only available in the Pro Edition of Game Maker.</i></b>
<p>
In advanced mode a new type of events is available: trigger events. Trigger events
you can define yourself. You specify the condition when the event must be executed.
To define trigger events you chose <b>Define Triggers</b> from the <b>Resources</b> menu.
The following form will show (in which already some triggers have been defined):
<p>
<img src="images/form_trigger.jpg">
<p>
At the left you see a list of all triggers that have been defined. Initially this list is empty.
Below there are some buttons with the following function:
<p>
<ul>
<li><b>Add.</b>
Use this button to add a new trigger event to the list. </li>
<li><b>Delete.</b>
Deletes the currently selected trigger event to the list. Be careful to never
delete a trigger event that is used in an object. It might lead to unexpected
results. </li>
<li><b>Load.</b>
Loads a collection of triggers from a file. Such a file must have extension
.gmtrg. The triggers from the file are added to the list of triggers. </li>
<li><b>Save.</b>
Saves the collection of triggers to a file. Such a file must have extension
.gmtrg. In this way you can create your own collections of useful triggers that
you can use in different games. </li>
<li><b>Clear.</b>
Clears the list of triggers. Be careful to only use this when no object uses
any trigger event. </li>
</ul>
<p>
Once you are finished you can press the <b>OK</b> button to save the changes. If you do not
want to save the changes, close the form with the cross in the top right corner and indicate
that you do not want to save changes.
<h3>Defining a trigger</h3>
<p>
Once you added a trigger you should fill in its properties. First of all you must give the trigger a name.
This name will appear in the menu with available triggers and in the event lists for objects. Next you
must specify the condition that will trigger the event. This is a piece of GML-code. It must contain
a return statement that returns a true or false value. The trigger will fire when the return value is true.
Here are some examples.
<p>
Assume you want to create an event that happens when the player presses both the Control key and the A key.
For this you can use the following condition:
<p>
<blockquote>
<pre>
{
<b>return</b> keyboard_check(ord('A')) &&
keyboard_check(vk_control);
}
</pre>
</blockquote>
<p>
You can put complete scripts in the condition as long as there somewhere is a return statement. For
example, to have an event that happen when the number of balls is between 3 and 5, you can use the
following condition:
<p>
<blockquote>
<pre>
{
<b>var</b> n;
n = instance_number(obj_ball);
<b>return</b> (n &gt;= 3) && (n &lt;= 5);
}
</pre>
</blockquote>
<p>
You can create many other type of trigger events. For example events that check for combinations of
keys and mouse buttons, events that check whether you are near to an enemy, events to check whether
you collected enough money or score, etc.
<p>
If the condition gets a bit long you might want to edit it in the code editor instead. To that end press
the button <b>Use code editor</b>.
</p>
<p>
After you specified the condition you should specify when the condition is tested. There are three options
here. You can test the condition at the beginning of a step (just before the begin step event), in
the middle (just before the normal step event) or at the end (just before the end step event). Most
of the time the default middle position is fine but in certain cases you need the other moments.
</p>
<p>
Finally, when you also want to call the event from code you can specify a constant with which you
can refer in code to the event. See Chapter 4 for more details about calling events from code.
</p>
<h3>Using a trigger</h3>
<p>
Once you have defined your scripts you can use them when defining objects. When setting the object
properties and click on <b>Add Event</b>, you can now select <b>Trigger</b> events.
<p>
<img src="images/form_event_selector2.jpg">
<p>
In the drop-down menu that appears you can select the type of trigger event you want to use. Now
you can add actions to this event in the same way as you add actions to other events.
</p>
<!--END-->
</body>
</html>
<!-- KEYWORDS
trigger
trigger events
defining triggers
-->

View File

@ -1,125 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Including files in stand-alone games</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Including files in stand-alone games</h3>
<b><i>This functionality is only available in the Pro Edition of Game Maker.</i></b>
<p>
As has been indicated before, you can create stand-alone versions of your game.
Sometimes your game will use additional files.
For example you might want to include video files or text files that are used in the game. In some
cases you want to add DLLs or images and sounds that are loaded during the running
of the game. You can provide these together
with the stand-alone executable but it is sometimes easier to include them
in the file. In this way only one file needs to be distributed. Included
files will default be exported when the game starts.
<p>
You can indicate the files you want to include in the executable in
by choosing <b>Included Files</b> from the <b>Resources</b> menu. The following
form will be shown:
<p>
<img src="images/form_include.jpg">
<p>
At the top of the form is a list of files to include.
Use <b>Add</b> to add a new file to the list, <b>Change</b> to change
a selected file, <b>Delete</b> to delete the selected file, and <b>Clear</b>
to clear the complete list. When adding or changing an entry, the following form will pop up:
<p>
<img src="images/form_datafile.jpg">
<p>
Here you can indicate a number of properties. You can press the <b>Load</b> button to indicate
which file must be included. You can change the <b>File Name</b> if you want to save the
file under a different name than the original file name.
<p>
There are a number of options you can set. When you check <b>Store in the editable gmk file</b> the
included file in not only added to the executable but also to the editable version of the game.
The advantage is that you can e.g. send the editable version to somebody else and can be sure
the file is still there. Also, you can remove the included file if you want or move it elsewhere
without problems. The disadvantage is that the editable version of the game becomes larger and
takes longer to load.
<p>
Checking the option <b>Free memory after export</b> means that after the file has been exported
(when running the game) it will be removed from memory. If you want to be able to export it again
later you should uncheck this option.
If a file that is exported already exists it is normally not written. You can change this
behavior by checking <b>Overwrite existing files</b>. Also, when the game is finished the
files are normally not removed (unless they are in the temporary folder which is completely
removed). You can change this by checking <b>Remove at game end</b>.
<p>
<b>A word of warning is in place here. If you are testing your game, the working directory
of the game is the directory where the .gmk file is stored. If your include files are also
stored here and you choose to remove them at the end of the game you might loose them
alltogether! So better not store these files with the .gmk file but e.g. in a subfolder!</b>
<p>
Finally you can indicate to what folder the files are exported.
There are four options here. In the
default situation the files are exported in the folder where the stand-alone game is
stored. This is also the working directory for the game. So the game can just use
the file names to access them (no paths are required). This works well if the stand-alone
is stored e.g. on the hard disk but will fail if it is stored on a read-only device,
e.g. on a CD.
<p>
The second possibility is to indicate that the files must be exported into the temporary
folder that is created during the running of the game. If you select this option you will
need to provide the path to the temporary folder when you use the file name during the
game. This path can be
obtained using the built-in variable <tt>temp_directory</tt>. Don't forget to
add the backslash in this case. So to e.g. play a video file you might type in
the following piece of code:
<p>
<blockquote>
<pre>
{
splash_show_video(temp_directory+'\movie.avi',<b>true</b>);
}
</pre>
</blockquote>
<p>
Realize that this temporary folder is removed once the
game is finished. So you e.g. cannot store save games or special information in this case.
Only choose this option when you want the game to be run from a CD or when you do not
write any files from within your game.
<p>
The third option is to indicate the folder to which the file must be exported yourself.
If it does not exist it will be created. E.g. you could specify <tt>C:\MyGame</tt>. (Note
that you need to provide a full patgh and that you should not include a backslash at the end.)
This is only allowed when the game does not run in secure mode.
<p>
Finally, you can indicate not the export the file automatically. In this case you should
use e.g. the function <tt>export_include_file(fname)</tt> to export it yourself when
required.
<!--END-->
</body>
</html>
<!-- KEYWORDS
including files
exporting files
export directory
data files
adding files
-->

View File

@ -1,60 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>More about rooms</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>More about rooms</h1>
Rooms in <i>Game Maker</i> have many options. Before we only treated the
most important ones. In this chapter we will discuss the other options. When
you open the room form in advanced mode it looks as follows:
<p>
<img src="images/form_room_advanced.jpg">
<p>
As you will see, some new buttons have been added to the toolbar. There are
buttons to sort the instances horizontally or vertically. This is useful
when instance partially overlap. (When adding tiles these buttons and the
others work on the tiles rather than the instances.) Also there are buttons
to lock all instances or unlock all instances. Locked instances cannot be
moved or deleted. This protects you against incidentally removing instances.
(However, when using the toolbar buttons to delete or shift
all instances, also the locked ones are deleted or shifted.)
Using the right mouse button menu (hold &lt;Ctrl&gt; and right click on an
instance) you can also lock or unlock individual instances.
<p>
Finally, you can indicate that you want to use an isometric grid. This is
very useful when creating isometric games. First of all, the grid lines now
run diagonally. Also the snapping of instances is different. (It works best
when the origin of the instance is at the top left corner as is default.)
<p>
Also there are two new tabs which we will discuss below.
<!--HELPONLY-->
<P>
Information on the different advanced room options can be found in the
following pages:
<P>
<blockquote>
<a href="210_01_advanced.html">Advanced settings</a><br>
<a href="210_02_tiles.html">Adding tiles</a><br>
<a href="210_03_views.html">Views</a><br>
</blockquote>
<!--ENDHELPONLY-->
<!--END-->
</body>
</html>

View File

@ -1,69 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Advanced settings</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Advanced settings</h3>
There were two aspects in the <b>settings</b> tab that we have not yet
discussed. First of all, there is a checkbox labeled <b>Persistent</b>.
Normally, when you leave a room and return to the same room later, the room
is reset to its initial settings. This is fine if you have a number of
levels in your game but it is normally not what you want in for example an
RPG. Here the room should be the way you left it the last time. Checking the
box labeled <b>Persistent</b> will do exactly that. The room status will be
remembered and when you return to it later, it will be exactly the same as
you left it. Only when you restart the game will the room be reset.
Actually, there is one exception to this. If you marked certain objects as
being persistent, instances of this object will not stay in
the room but move to the next room.
<p>
Secondly, there is a button labeled <b>Creation code</b>. Here you can type
in a piece of code in GML (see later) that is executed when the room is
created. This is useful to fill in certain variables for the room,
create certain instances, etc. It is important to understand what exactly
happens when you move to a particular room in the game.
<ul>
<li>First, in the current room (if any) all instances get a room-end
event. Next the non-persistent instances are removed (no destroy event is
generated!).</li>
<li>Next, for the new room the persistent instances from the previous room
are added.</li>
<li>All new instances are created and their creation events are executed
(if the room is not persistent or has not been visited before).</li>
<li>When this is the first room, for all instances the game-start event is
generated.</li>
<li>Now the room creation code is executed.</li>
<li>Finally, all instances get a room-start event.</li>
</ul>
<p>
So, for example, the room-start events can use variables set by the creation
code for the room and in the creation code you can refer to the instances
(both new ones and persistent ones) in the room.
<p>
There is one further option. In the pop-up menu when you right click on an
instance with the &lt;Ctrl&gt; key you can now indicate some creation code
for the specific instance. This code is executed when the room is started,
just before the creation event of the instance is executed. This is very
useful to e.g. set certain parameters that are specific to the instance.
<!--END-->
</body>
</html>
<!-- KEYWORDS
persistent rooms
persistence, rooms
room creation code
creation code
event order
-->

View File

@ -1,117 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Adding tiles</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Adding tiles</h3>
You can also create so-called tiled background. The idea behind this is as
follows: In many games you will want to have nice looking backgrounds. For
example, in a maze game, the walls of the maze should nicely match up, and
in platform games you like to see beautifully drawn platforms, trees, etc.
You can do this in <i>Game Maker</i> by defining many different objects and
composing your rooms from these objects. The problem though is that this
takes a lot of work, uses large amounts of resources, and makes the games
run slowly because of the many different objects. For example, to create nice
walls in maze games you need as a start 15 differently shaped wall objects.
<p>
The standard way out, used in many games, is that the walls and other static
objects are actually drawn on the background. But, you might ask, how does
the game know that an object hits a wall if it is drawn on the background
only? The trick is as follows: You create just one wall object in your game.
It must have the right size but it does not need to look nice. When creating
the room, place this object at all places where there is a wall. And, here
comes the trick, we make this object invisible. So when playing the game you
don't see the wall objects. You see the beautiful background instead. But
the solid wall objects are still there and the instances in the game will react
to them.
<p>
You can use this technique for any object that is not changing its shape or
position. (You cannot use it when the object must be animated.) For
platform games, you probably need just one floor and one wall object, but
you can make beautifully looking backgrounds where it looks as if you walk
on grass, on tree branches, etc.
<p>
To add tiles to your room you first need to add a background resource to your
game that contains the tiles.
If you want to have your tiles partially transparent, make sure you
make the background image transparent when loading it. When adding the background resource
indicate that it must be used as a tile set. Next indicate the size of
each tile and whether there is room between the tiles, as was indicated in
the chapter on background resources.
<p>
Now, when defining your room, click
on the tab <b>tiles</b>. The following form is shown (actually, we already
added some tiles in this room and switched off the grid).
<p>
<img src="images/form_room_tiles.jpg">
<p>
At the left top there is the current set of tiles used. To select the set,
click on the menu button below it and select the appropriate background
image.
<p>
Now you can add tiles by selecting the tile you want at the top left, and
next clicking at the appropriate place in the room at the right. This works
in exactly the same way as for adding instances. Underlying tiles are
removed, unless you uncheck the box <b>Delete underlying</b>. You can use
the right button to delete tiles. Hold the &lt;Shift&gt; key to add multiple
tiles. And hold the &lt;Ctrl&gt; key to move tiles to a new place. The
&lt;Alt&gt; key will avoid snapping to the gird. Also there is again a pop-
up menu when you hold the &lt;Ctrl&gt; key and click on a tile with the
right mouse button. The buttons in the toolbar will now clear all tiles,
shift all tiles, sort the tiles or lock/unlock them. (Actually they only
operate on the current layer; see below.)
<p>
In some situations you might want to put a part of the background in the
room that is not exactly the size of a tile or consists of multiple tiles.
This can be done as follows. In the top-left image press the left mouse button
while holding the &lt;Alt&gt; key. Now you can drag an area which you can then
place in the room in the same way as tiles. To select multiple tiles, hold the
&lt;Shift&gt; key. Note that this only works correctly when there is no
separation between the tiles. If you want to select an area that is multiple
of the room grid size, hold the &lt;Ctrl&gt; key rather than the &lt;Shift&gt; key.
(Note that you can actually change the key you hold during the dragging. This
can sometimes be useful.)
<p>
Tiles can be placed in layers at different depths. At the bottom you see the
current depth. Default this is 1000000 which is normally behind all
instances. So the instances will move in front of the tiles. You can use the
<b>Add</b> button to add new tile layers, each with a different depth.
Negative depths can be used to put tiles in front of instances. If you also
give objects different depths you can put them between different tile
layers. If you press <b>Delete</b> you delete a tile layer together with all
its tiles. (There must always be at least one layer.) If you press <b>Change
</b> you can change the depth of a tile layer. If you give it the same depth
as another layer, the layers are merged.
<p>
Using tiles is a powerful feature that should be used as much as possible.
It is much faster than using objects and the tile images are stored only
once. So you can use large tiled rooms with very little memory consumption.
<!--END-->
</body>
</html>
<!-- KEYWORDS
tiled backgrounds
tiles
adding tiles
placing tiles
tile layers
tile depth
-->

View File

@ -1,75 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Views</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Views</h3>
Finally, there is a tab labeled <b>views</b>. This gives a mechanism for
drawing different parts of your room at different places on the screen.
There are many uses for views. First of all, in a number of games you want
to show only part of the room at any time. For example, in most platform
games, the view follows the main character. In two-player games you often
want a split-screen mode in which in one part of the screen you see one
player and in another part you see the other player. A third use is in games
in which part of the room should scroll (e.g. with the main character) while
another part is fixed (for example some status panel). This can all be
easily achieved in <i>Game Maker</i>.
<p>
When you click the tab labeled <b>views</b> the following information will
show:
<p>
<img src="images/form_room_views.jpg">
<p>
At the top there is a box labeled <b>Enable the use of Views</b>. You must
check this box to use views. Below this you see the list of at most eight
views you can define. Below the list you can give information for the views.
First of all you must indicate whether the view should be visible when the
room starts. Make sure at least one view is visible. Visible views are shown
in bold.
<p>
A view is defined by a rectangular area in the room. This is the area that
must be shown in the view. You specify the position of the top-left corner and
the width and height of this area. Secondly, you must specify where this area is
shown in the window on the screen. This is called the (view)port.
Again you specify the position of the top-left
corner and the size. If you have a single view the position is typically (0,0).
Note that the size of the port can be different from the size of the view. In this
case the view will be scaled to fit in the port. (In code it is
also possible to rotate a view.) The ports can overlap. In this
case the are drawn in the indicated order on top of each other.
<p>
As indicated above, you often want the view to follow a certain object. This
object you can indicate at the bottom. If there are multiple instances of
this object, only the first one is followed by the view. (In code you can
also indicate that a particular instance must be followed.) Normally the
character should be able to walk around a bit without the view changing.
Only when the character gets close to the boundary of the view, should the
view change. You can specify the size of the border that must remain visible
around the object. Finally, you can restrict the speed with which the view
changes. This might mean that the character can walk off the screen, but it
gives a much smoother game play. Use -1 if you want the view to change
instantaneously.
<!--END-->
</body>
</html>
<!-- KEYWORDS
views
enabling views
view port
following an object
multiple views
split-view
-->

View File

@ -1,66 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Fonts</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Fonts</h1>
When you want to draw text in your game this text is drawn in an Arial 12 points font. To make more fancy
looking texts you probably want to use different fonts. To use different fonts you must create font resources.
In each font resource you specify a particular type of font which can then be used in your game using the
action to set a font.
<p>
To create a font resource in your game, use the item <b>Create Font</b> in the <b>Resources</b> menu or use
the corresponding button on the toolbar. The following form will pop up.
<p>
<img src="images/form_font.jpg">
<p>
As always you should give your font resource a name. Next you can pick the name of the font. Also you can
indicate its size and whether it should be bold and/or italic. Realize that large fonts take a lot of
memory to store. So you are strongly recommended not to use fonts with a size larger than say 32. (It
is possible to scale the fonts while running the game.) An example of the indicated font is shown at the bottom.
<p>
A font typically consist of 256 characters, numbered from 0 to 255.
But in general you use only a small portion of
these. So default in a font only the characters from 32 till 127 are stored in the font. The more characters you
store in the font the more memory it will use. You can change the character range used. To see the index of
each character you can use the Character Map that can be found in the
Windows Start menu under Accessories/System Tools.
Some standard ranges can be indicated using the buttons: The <b>Normal</b> range from 32 till 127, the <b>All</b>
range from 0 till 255, the <b>Digits</b> range that only contains the 10 digits, and the <b>Letters</b>
range that contains all uppercase and lowercase letters. Other ranges can be used by typing in the
first and last character index. If a character does not lie in the range it is replaced by a space.
<p>
Normally you have a large number of different fonts
installed on your computer and there are websites where you can download hundreds more. The problem is that
if you use them in your game and then give your game to somebody else to play there is a big chance that
the other person does not have the same fonts installed on his or her computer.
To avoid this, <i>Game Maker</i> embeds all the fonts you want to use in the game file, but only in
the stand-alone games. So if you give a stand-alone game to someone else you don't need to provide
the font files. But if you give somebody the editable version of your game and you use fancy fonts, you
better also provide the person with the correct font files.
<!--END-->
</body>
</html>
<!-- KEYWORDS
fonts
adding fonts
creating fonts
defining fonts
font type
character range
bold
italic
-->

View File

@ -1,203 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Paths</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Paths</h1>
In more advanced games you often want to let instances follow certain paths.
Even though you can indicate this by e.g. using timer events or code, this
is rather complicated. Path resources are an easier mechanism for this. The
idea is rather simple. You define a path by drawing it. Next you can place
an action in the creation event of the object to tell the object to
follow the particular path. This chapter will explain this in detail.
<h3>Defining paths</h3>
To create a path in your game, choose <b>Create Path</b> from the <b>Resources</b> menu.
The following form will pop up (in the example we already added a little
path).
<p>
<img src="images/form_path.jpg">
<P>
At the top left of the form you can set the name of the path, as usual.
Below it you find the points that define the path. Each point has both a
position and a speed (indicated with sp). Depending on how you use the path,
the position is either absolute, that is, the instance for which you will
later use the path will follow it at that particular place, or it is
relative, that is, the instance will always start at the first position on
the path and follow the path from there. The speed should be interpreted as
follows. A value of 100 means the original speed given for the path when
assigning it to the instance. A lower value reduces the speed, a higher
value increases it (so it indicates the percentage of the actual speed).
Speed will be interpolated between points, so the speed changes gradually.
<P>
To add a point press the button <B>Add</B>. A copy is made of the currently
selected point. Now you can change the actual position and speed by changing
the values in the edit boxes. Whenever you select a point in the list, you
can also change its values. Press <B>Insert</B> to insert a new point before
the current one, and <B>Delete</B> to delete the current point.
<P>
At the right of the form you will see the actual path. The red dot indicates
the currently selected control point. The blue dots are the other control
points. The green square indicates the position where the path starts. You
can also change the path using the mouse. Click anywhere on the image to add
a point. Click on an existing point and drag it to change its position. When
you hold &lt;Shift&gt; while clicking on a point, you insert a point.
Finally, you can use the right mouse button to remove points. (Note that you
cannot change the speed this way.) Normally the points will be aligned with
a grid. You can change the grid settings at the top tool bar. Here you can
also indicate whether the grid should be visible or not. If you want to
precisely position a point, hold the &lt;Alt&gt; key while adding or moving
it.
<P>
You can influence the shape of the path in two ways. Fist of all you can use
the type of connection. You can either choose straight line connections or a
smooth path. Secondly, you can indicate whether the path must be closed or
not.
<P>
On the toolbar there are a number of important controls. From left to right
they have the following meaning. The first button indicates that you are
ready and want to close the form, keeping the changes. (If you want to
discard the changes, press the cross to close the window and indicate that
you do not want to save the changes.) Next there is the button to undo the
last change.
<P>
The following set of toolbar buttons allows you the clear the path, reverse
the order in which the path is traversed, shift the path, mirror it
horizontally, flip it vertically, rotate it, and scale it. Next there are
buttons to shift the view (not the path itself; the actual view area is
indicated in the status bar at the bottom) and to center the view.
<P>
As already indicated above you can next set the snap values and whether to
show the grid. Finally there is a button to indicate that you want to see a
particular room as background for the path. Using this you can easily put
the path at a particular place in the room, for example on a race track,
so that later the instances will follow the correct route. (This only
makes sense when you use absolute paths; see below.)
<h3>Assigning paths to objects</h3>
To assign a path to an instance of an object, you can place the path action
in some event, for example in the creation event. In this action you must
specify the path from the drop down menu. There are some further values you
can provide.
<P>
You must indicate the path that must be followed and the speed in pixels per
step. When the speed is positive the instance starts at the beginning of the
path. If it is negative it starts at the end. Remember that when you defined
the path you specify the actual speed relative to this indicated speed.
There is also an action to change the speed with which the path is executed.
You could, for example, use this to let an instance slow down or speed up along its
path. Note that the normal speed of the instance is ignored (actually set to
0) when executing a path. Also things like gravity and friction do not
influence the motion along a path.
<P>
Next you specify the end behavior, that is, what should happen when the end
of the path is reached. You can choose to stop the motion and end the path.
You can also restart the path from the beginning, that is, the instance
jumps back to the position where the path was started and executes the path
again. A third option is to restart from the current position, that is, the
instance follows the path again but now with this new starting position
(this is the same when the path is closed). Finally you can choose to
reverse the motion, making the instance go back and forth along the path.
Note that also at the end of the path an event happens; see below.
<P>
Finally you can indicate whether the path must be absolute or relative. An
absolute path is executed at the place where it is defined. The instance is
placed at the start position and moved from there (end position when speed
is negative). This is, for example, useful when you have a race track on
which you have defined the path. When you choose relative the instances starts
executing the path from its current position. This is useful when an
instance should make a local motion. For example, space ships in a space
invader game can make a particular turn from their current position.
<P>
When you want to place the instance at a different point along its path you
can use the action to set the path position. A path position always lies
between 0 and 1, 0 indicating the start position and 1 the end position on
the path. Note that in each step the direction variable is automatically set
to the correct direction along the path. You can use this variable to
choose the correct orientation for the sprite.
<P>
When using scripts or pieces of code you have more control over the way the
path is executed. There is a function to start a path for an instance. The
variable <TT>path_position</TT> indicates the current position on the path
(between 0 and 1 as indicated above). The variable <TT>path_speed</TT>
indicates the speed along the path. A variable <TT>path_scale</TT> can be
used to scale the path. A value of 1 is the original size. A larger value
indicates that the path is made larger; a smaller value makes it smaller.
The variable <TT>path_orientation</TT> indicates the orientation in which
the path is executed (in degrees counter-clockwise). This enables you to
execute the path in a different orientation (e.g. moving up and down rather
than left and right). There is also a variable to control the end behavior.
Finally there are lots of functions to ask for properties of paths (e.g. the
x and y coordinate at a certain positions) and there are functions to create
paths. There are even functions that create collision free paths for an
instance to reach a certain goal. See the later sections on GML for details
on this.
<P>
You might wonder what happens when the instance collides with another
instance while it follows a path. Basically the same happens as when the
instance moves with a speed. When there is a solid instance, the instance is
placed back at its previous location. When both instances are not solid they are
placed at their new positions Next the collision event(s) are executed and
it is checked whether the collision has been resolved. If not and the other
instance is solid the instance will stop, as it should (assuming there is a
collision event defined). Also, the <TT>path_position</TT> variable is not
increased. When the blocking instance disappears the instance will continue
to follow its path. To handle collisions yourself the variable <TT>
path_positionprevious</TT> can be useful. It holds the previous position for
the path and you can set the path position to this variable to avoid
advancing along the path.
<h3>The path event</h3>
As described above, you can indicate what must happen when the instance
reaches the end of the path. At this moment also an <b>End of Path</b> event
occurs. You can find it under the <b>Other</b> events. Here you can place
actions. For example, you might want to destroy the instance, or let it
start a new (different) path.
<!--END-->
</body>
</html>
<!-- KEYWORDS
adding paths
creating paths
paths
path on room image
setting paths
path index
path orientation
path scale
path position
path end behavior
end of path event
smooth paths
-->

View File

@ -1,94 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Time lines</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Time lines</h1>
In many games certain things must happen at certain moments in time. You can
try to achieve this by using alarm events but when things get too
complicated this won't work any more. The time line resource is meant for
this. In a time line you specify which actions must happen at certain
moments in time. You can use all the actions that are also available for the
different events. Once you create a time line you can assign it to an
instance of an object. This instance will then execute the actions at the
indicated moments of time. Let us explain this with an example. Assume you
want to make a guard. This guard should move 20 time steps to the left, then
10 upwards, 20 to the right, 10 downwards and then stop. To achieve this you
make a time line where you start with setting a motion to the left. At
moment 20 you set a motion upward, at moment 30 a motion to the right, at
moment 50 a motion downwards and at moment 60 you stop the motion. Now you
can assign this time line to the guard and the guard will do exactly what
you planned. You can also use a time line to control your game more
globally. Create an invisible controller object, create a time line that at
certain moments creates enemies, and assign it to the controller object. If
you start to work with it you will find out it is a very powerful concept.
<p>
To create a time line, choose <b>Create Time Line</b> from the <b>Resources</b> menu.
The following form will pop up.
<p>
<img src="images/form_timeline.jpg">
<p>
It looks a bit like the object properties form. At the left you can set the
name and there are buttons to add and modify moments in the time line. Next
there is the list of moments. This list specifies the moments in time steps
at which assigned action(s) will happen. Then there is the familiar list of
actions for the selected moment and finally there is the total set of
actions available.
At the left you can use the following buttons:
<ul>
<li><b>Add</b>. Use this to add a moment to the time line. You must indicate the moment, which
is the number of steps since the time line was started. Now you can
drag actions to the list as for object events.</li>
<li><b>Change</b>. Use this button to change the time steps for the currently selected moment.</li>
<li><b>Delete</b>. Use this button to delete a moment or a range of moments. You must indicate the time step
of the first moment to delete and the last one. All moments in between will be deleted.</li>
<li><b>Clear</b>. Use this button to clear the entire list of moments.</li>
<li><b>Shift</b>. Use this button to shift a range of moment to a new moment. You must indicate
the start of the range, the end of the range, and the new time step to which the start of the
range must be shifted. When different moments become the same their action lists will be merged.</li>
<li><b>Duplicate</b>. This is almost the same as the shift button but in this case a copy of the moments
are made.</li>
<li><b>Spread</b>. Use this button to spread out a range of moments by adding time between them or put them
closer together by removing time between them. You specify the start and the end of the range and the percentage
for the spread. A percentage of 100 means nothing changes. For values smaller than 100 the moments are moved closer
together and for values larger than 100 they are moved further apart. For example if you have moments at timesteps 5, 8,
and 12 and you indicate as range 5:12 and a percentage 200, the moments will move to time steps 5, 11, and 19.
(The intervals between them have doubled.) When different moments become the same their action lists will be merged.</li>
<li><b>Merge</b>. Use this button to merge a number of moments into a single one. You specify the start and the
end of the range and they will all be merged into the start moment.</li>
</ul>
<p>
Make sure you do not create negative time moments. They will
never be executed.
<p>
There is also a button <b>Show Information</b> that shows the time line in a readable form.
<p>
There are a number of actions related to time lines. You can find them in the section on
<a href="206_02_main.html">More Main Actions</a>.
<!--END-->
</body>
</html>
<!-- KEYWORDS
time lines
adding time lines
creating time lines
time line actions
moments
-->

View File

@ -1,347 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Scripts</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Scripts</h1>
<p>
<i>Game Maker</i> has a built-in programming language called GML. Once you become more
familiar with <i>Game Maker</i> and want to use it to its fullest extend, it
is advisable to start learning to use this language. For more details in the
GML language see <A HREF="400_index.html">Part 4</A> of this documentation.
</p>
<p>
There are two ways to
use the language. First of all you can create scripts. These are pieces of
code to which you give a name. They are shown in the resource tree and can be
saved to a file and loaded from a file. They can even be used to form a library
that extends the possibilities of <i>Game Maker</i>. Alternatively, you can
add a code action to some event and type a piece of code there. Adding code
actions works in exactly the same way as adding scripts except for two
differences. Code actions don't have a name and cannot use arguments. Also
they have the well-known field to indicate to what objects the action should
apply. For the rest you enter code in exactly the same way as in scripts. We
recommend you to use scripts for all but simple pieces of code as <i>Game Maker</i>
has many more features that deal with scripts.
So we further concentrate on scripts in this chapter.
</p>
<p>
As stated before, a script is written with code in GML (the built-in programming language)
and is meant to perform a particular task. Scripts can takes input-variables called arguments
(sometimes called parameters). To execute a script from any event, you can use
the script action. In the script action you specify
the script you want to execute, together with the up to five arguments.
</p>
<p>
You can also execute a script from within a piece of code (a different script) in the same way you
call a GM-function. In that case you can use up to 16 arguments.
Scripts can return a value. This is often used to build calculating methods
(mathematical methods). The <b>return</b> keyword is used for this.
No code after the return keyword is executed!
When a script returns a value, you can also use it as a function when
providing values in other actions.
</p>
<p>
Scripts are extremely useful to extend the possibilities of <i>Game Maker</i>.
This does though require that you design your scripts carefully. Scripts
can be stored in files that can be added to your game. To import a
script file, use the item <b>Import scripts</b> from the <b>Scripts</b> menu. To save your
scripts in the form of a file use <b>Export scripts</b>. Script libraries
are simple text files (although they have the extension .gml). Preferably
don't edit them directly because they have a special structure.
</p>
<p>
To create a script in your game, choose <b>Create Script</b> from the <b>Resources</b> menu.
A code editor will appear that will be described next.
</p>
<h3>The code editor</h3>
<p>
When creating or editing a script (or a code action) the following code editor form
will appear (in the example we already added a
little script that computed the product of the two arguments).
</p>
<p>
<img src="images/form_script.jpg">
</p>
<p>
At the top right you can indicate the name of the script. You should give all
of your scripts a sensible name. Make sure the name only consists of letter, digits,
and the _ symbol. It should not start with a digit. In this way you can use the
script later as a function in code.
</p>
<p>
At the top you have a toolbar with some useful buttons. From left to right you
have the OK button to close the editor, saving the changes, buttons to load the
script from a text file, save it to a text file, and print it.
</p>
<p>
Next there are undo and redo buttons. The editor will basically remember all
changes you did and you can undo them (or redo the undone changes). You can change
the maximal number of undo operations in the Preferences. Here you can also
indicate whether you want to group the undo operations (such that e.g. typing
a line of text can be undone in one step) or that every keystroke is separate
saved. You can use &lt;Ctrl&gt; + Z for undo and &lt;Ctrl&gt; + &lt;Shift&gt; + Z for
redo.
</p>
<p>
Next to this there are buttons to cut, copy, and paste text, as you should be familiar
with. The final two buttons are for finding and replacing and for code checking. These will
be explained below in detail.
</p>
<p>
Below the toolbar there is the area where you can type the text. At the left there are the
line numbers. (You can switch these on and off using the F9 key.) The line with the cursor
on it is marked in bold. The dark red bar behind certain line numbers indicated that these
lines have changed. You will notice that you can type text anywhere on the lines. So
a line does not really have an end. This tends to be useful when alligning text. There
are many editing possibilities, that will be described below.
</p>
<p>
At the bottom there is the status bar. This shows from left to right the current line number,
total number of lines and cursor position. Whether you are in Insert mode or Overwrite mode. (In
Overwrite mode also the cursor chnanges to make it clear that you are overwriting the existing text.)
Next there is the point size for the font used. You can use F7 and F8 to decrease or increase the
font size. (You have more control over the font size and type in the Preference.)
</p>
<h3>Editing tools</h3>
<p>
The editor has many editing possibilities. Some of these can also be accessed through the
pop-up menu that appears when you press the right mouse button. Here are the most important ones:
</p>
<ul>
<li>Multiple undo and redo either per key press or in groups</li>
<li>The arrow keys move you around in the text. Use &lt;Ctrl&gt; with
the left and right arrow key to move to the beginning of the previous
or next word. Use &lt;Ctrl&gt; with the up and down key to also scroll
the text. Hold the &lt;Shift&gt; key to select text.</li>
<li>Double click the line number to select the complete line.</li>
<li>The Home key moves to the beginning of the line and the End key
to the end of the line. With &lt;Ctrl&gt; they move to the start and end of the
script. Hold the &lt;Shift&gt; key to select text.</li>
<li>You can scroll through the text with the mouse wheel.
With &lt;Ctrl&gt; the cursor scrolls with the text. Hold the &lt;Shift&gt; key to select text.</li>
<li>Intelligent auto indent that aligns with the previous line when you use the
return key of the backspace key (can be set in the preferences). </li>
<li>Intelligent tabbing that tabs till the first non space in the previous
lines (can be set in the preferences).</li>
<li>Use &lt;Ctrl&gt; + I to indent selected lines and &lt;Shift&gt; +
&lt;Ctrl&gt; + I to unindent selected lines.</li>
<li>Hold &lt;Ctrl&gt; with the Backspace or Delete key to delete until the
beginning of the previous or next word.</li>
<li>You can drag a selection with the mouse. (Use &lt;Ctrl&gt; to copy it.) The new location is immediately shown.</li>
<li>Cut, copy and paste of text between script forms and other programs.</li>
<li>Use F12 to open the script or resource whose name is at the cursor
position.</li>
</ul>
<h3>Color coding</h3>
<p>
As you might have noticed, parts of the script text are colored. The editor
knows about existing objects, built-in variables and functions, etc. Color-
coding helps a lot in avoiding mistakes. In particular, you see immediately
if you misspelled some name or use a keyword as a variable.
If you don't like the color coding, in the Preferences you can switch
it on and off (you can also use F10). In the Preferences you can also change the
color for the different components of the code.
</p>
<h3>Function and variable help</h3>
<p>
<i>Game Maker</i> contains many built-in functions and variables and you add your own
resources and scripts to this. So it might be hard to remember all of them. Fortunately
the editor helps you with this. When you type part of a name (at least two characters) and
wait a little, a list is shown of all possibilities. For example, as follows:
</p>
<p>
<img src="images/form_completion.jpg">
</p>
<p>
You can continue typing and the list will adapt. You can use the up and down keys to scroll through
the list and press Enter to replace the text you are typing with the selected function or variable name.
</p>
<p>
You can switch this feature on and off in the preferences. You can always force the list to appear
by pressing &lt;Ctrl&gt; + Space.
</p>
<p>
A second form of help is given when you are typing in the arguments for a function. In this case, in the
status bar at the bottom the function with its arguments is given. The current argument you are typing is
shown in bold. In this way you will never forget arguments or get the order wrong.
</p>
<h3>Find and replace</h3>
<p>
It is common that you want to find some piece of text in your code or replace some text with another one.
To this end press the Find button in the toolbar. A panel will show up at the right of the form, as follows:
</p>
<p>
<img src="images/form_script2.jpg">
</p>
<p>
You can type the find string at the top. Note that in the code all occurrences of the find string are immediately shown
with a yellow background. (You can switch this off in the Preferences.) As usual you can indicate whether the search
must be case sensitive (which is normally what you want as variable and function names in GML are also case sensitive)
and whether you want to only search for whole words. Note that the editor remembers your most recent searches.
</p>
<p>
With the buttons with the blue arrows you can now move to the previous, next, first, and last occurrence of the
find string. It will be selected in the text such that you can e.g. delete it.
</p>
<p>
When you want to replace occurrences, also type a text in the replace box. Now you can use the buttons to replace the
previous occurrence, the next, the first, the last, or all occurrences of the find text. Remember you can always
use Undo to undo the replacements.
</p>
<h3>Code snippets</h3>
<p>
Code snippets are small pieces of code that you will often use. You can add them in the code through the snippet menu.
To this end press F2. A menu appears from which you can select the snippet. It will be inserted at the cursor in
your code. Some pieces consists of capital letters only. These must still be replaced by you. The first one is
selected for replacement. To replace another, simply double click on it.
</p>
<p>
You can define your own code snippets if you want. The snippets are stored in the file <tt>snippets.txt</tt> in
the folder in which <i>Game Maker</i> is installed. You can edit this file with any text editor. Each snippet is
on a separate line and there should be no blank lines. It starts with the name of the snippet (shown in the menu)
followed by the colon (:) followed by the actual snippet. Use # for a newline and put the text that needs to
be selected first between | symbols. See the examples that are already in the file. (Better make a backup of
it before you start changing it.)
</p>
<h3>Error checking</h3>
<p>
In the toolbar at the top there is a button with which you can switch error checking on or off.
When error checking is on, <i>Game Maker</i> constantly tests the code you are typing and reports
the first error it finds at the bottom of the window. Also the line number for the line with the
error is drawn in red. You can click on the error message to go to the correct line and position to
correct the error. Note that not all aspects can be tested at this stage but the syntax of your
script will be tested, together with the existence of functions used.
</p>
<p>
When you start typing a script, error checking might be annoying so you can switch it off. But when the
script is almost ready you better switch it on to correct all the errors. Note that also the
color coding will help you catch errors. Finally, when you put your cursor at a bracket the editor
will show you the corresponding opening or closing bracket. If it cannot find it, it is shown in red.
(You can switch this off in the Preferences.)
</p>
<h3>Debugging</h3>
<p>
When creating scripts you can easily make mistakes. Always test the scripts by
using the error checking button. However, this will not catch all errors. So
you will need to run the game to test your code.
</p>
<p>
When an error occurs during the execution of a
script this is reported, with an indication of the type of error, the script or
action it occurs in, and the line and position.
Rarely you will see a popup with the text
"Unexpected error occurred during the game".
This error message indicate that some problem occurred in windows or in
the hardware. Often the reason for this is infinite recursion, lack of
memory or insufficient hardware, drivers or firmware.
Generally speaking, these errors have to do with problems outside the <i>Game Maker</i> environment.
</p>
<p>
If you need to check things more carefully, you can run the game in
debug mode. Now a form appears in which you can monitor lots of information
in your game.
</p>
<p>
<img src="images/form_debug.jpg">
</p>
<p>
Under the <b>Run</b> menu you can pause the game, run it step by step and
even restart it. Under the <b>Watch</b> menu you can watch the value of
certain expressions. Use <b>Add</b> to type in some expression whose value
is shown in each step of the game. In this way you can see whether your game
is doing things the right way. You can watch many expressions. You can save
them for later use (e.g. after you made a correction to the game). Under the
<b>Tools</b> menu you find items to see even more information. You can see a
list of all instances in the game, you can watch all global variables (well,
the most important ones) and the local variables of an instance (either use
the object name or the id of the instance). You can also view messages which
you can send from your code using the function <tt>show_debug_message(str)</tt>.
Finally you can give the game commands and change the speed of the
game. If you make complicated games you should really learn how to use the
debug options.
</p>
<!--END-->
</body>
</html>
<!-- KEYWORDS
adding scripts
creating scripts
scripts
importing scripts
exporting scripts
script files
color coding
completion
auto-completion
function help
code snippets
snippets
testing scripts
scripts, function help
code editor
script, editor
debugging
watching variables
watching instances
show_debug_message
frames per second
-->

View File

@ -1,76 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Extension Packages</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Extension Packages</h1>
<b><i>This functionality is only available in the Pro Edition of Game Maker.</i></b>
<p>
Extension packages extend the possibilities of <i>Game Maker</i>. An
extension package can add a set of actions to <i>Game Maker</i>
or it adds a number of additional functions and constants to the GML language
built into <i>Game Maker</i>. When extension packages are
available to you, help about these is placed in the <b>Help</b> menu.
<p>
When double clicking on the <b>Extension Packages</b> resource item the following form is shown:
<p>
<img src="images/form_extensions.jpg">
<p>
In this form you can indicate which extension packages must be used
in the game. On the left there is the list of <b>Used</b> packages and on the
right is the list of <b>Available</b> packages. To move a package from one list
to the other, simply select it and press the button between the list. When selecting
a package a short description is given at the bottom. Further help is available
by pressing the <b>Help</b> button.
<p>
Extension packages are an extremely powerful part of <i>Game Maker</i>. A few
extension packages are provided with <i>Game Maker</i> but many more will
become available through the website. To install new packages or uninstall
existing ones, press the <b>Install</b> button. The following form
is shown
<p>
<img src="images/form_extensions_install.jpg">
<p>
You will see a list of all extension packages installed. By selecting a package
and clicking the <b>Uninstall</b> button the package is removed from the system.
<p>
Install packages are distributed in the form of a .gex file. You can find
a number of such packages on our website which you can go to by pressing
the button <b>Find More</b>. Once you donwloaded such a package file on
your computer, press the <b>Install</b> button and select the package file.
It will then be installed in the system.
<p>
If you want to create your own extension packages, please check out
the information that is available on
<a href="http://www.yoyogames.com/extensions" target="_blank">http://www.yoyogames.com/extensions</a>.
<!--END-->
</body>
</html>
<!-- KEYWORDS
extension packages
extra actions
extending GML
extra functions
DLL
installing packages
uninstalling packages
-->

View File

@ -1,153 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Exporting and importing resources</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Exporting and importing resources</h1>
<b><i>This functionality is only available in the Pro Edition of Game Maker.</i></b>
<p>
<b>Note:</b> Import and export of resources is only for experienced users. Carefully read
this section before using these features. Also, always make a back-up copy of your game
before importing resources.
<p>
Sometimes you want to copy certain resources (sprites, sounds, rooms, etc.) from one game
to another game. For example when you want to create a new game using the same sprites and
sounds as another game. Or when you are working together on a game. One of you might have
created some additional rooms that you then want to import in the other game.
To this end <i>Game Maker</i> has commands to import and export resources.
</p>
<h3>Exporting resources</h3>
<p>
To export resources, choose <b>Export Resources</b> from the <b>File</b> menu. First of all
it is checked whether all resources have different names. Because resources in one game are
linked to the ones in the other game by name, it is essential that all resources have different
names. If not, you get an error message and no resources can be exported. Otherwise, a file selector
is shown in which you can indicate the name of the file in which you want to export the resources.
These files must end with the extension <tt>.gmres</tt>. Next the following form is shown:
</p>
<p>
<img src="images/form_export.jpg">
<p>
In this form you can indicate which resources must be exported. Default all are exported but you can
select the particular types of resources you want to export.
Care must be taken when exporting objects, timelines, or rooms.
These will refer to sprites, sounds, triggers, etc. So if you do not export these other resources as well
you must be certain that these other resources already exist in the game in which you are going to
import the resources (under the same names). If you are uncertain, better export everything.
<h3>Importing resources</h3>
<p>
Once you have a file containing resources you can import them in a different game by
choosing <b>Import Resources</b> from the <b>File</b> menu. First of all
it is checked whether all resources have different names. Again, because resources in one game are
linked to the ones in the other game by name, it is essential that all resources have different
names. If not, you get an error message and no resources can be imported. Otherwise, a file selector
is shown in which you can indicate the name of the file from which you want to import the resources.
These files will end with the extension <tt>.gmres</tt>. Next all open property forms are closed.
This is necessary because imported resources might replace
existing ones. Next the following form is shown:
</p>
<p>
<img src="images/form_import.jpg">
<p>
All types of resources in the file are shown. (The ones that were not exported and grayed out.)
You can select which of these resources you want to import. Most of the time you want to import all
but sometimes you want to make a selection. Be careful when importing objects, rooms, or timelines
while not importing other resources. As indicated above this can lead to problems if the resources they
refer to do not exist in your game under the same name. In such a case they will be replaced by non-existing
resources. (For example, in the rooms it means the corresponding instances will be removed.)
</p>
<p>
When resources in the file have the same name as resources in the game a naming conflict appears. You can
indicate how that should be resolved. The default is that you keep the resource that was changed last.
You can however also choose to always keep the original in the game or always replace it with the
resource in the file. A fourth option is to keep both. Only use this when it is absolutely necessary,
because you will now end up with multiple resources with the same name which can lead to conflicts
when referring to them. When you import resources into an empty game, better choose to always replace them.
(This may sound strange but for example otherwise the global game settings will not be replaced as the new
empty game is of a more recent date!)
</p>
<p>
Finally you can indicate whether to place the new resources (that is, the ones that do not already occur) in
a new group. This might be useful to distinguish (visually) the imported resources from the existing ones. If
you check this box the new resources will be place in a group. The name of this group is the name of the
import file.
</p>
<p>
Once you press <b>OK</b> the resources are added to the game, replacing existing resources with
the same name when required. You will see them appear in the resource selector at the left.
</p>
<h3>Warnings and Remarks</h3>
<p>
Importing and exporting resources is a powerful mechanism, in particular when you are working
on a game with multiple people. However, if you do not understand what you are doing it might
lead to errors and frustration. Here are some important warnings that you should read and
understand.
</p>
<ul>
<li>Always make a backup copy of your game before importing resources. Otherwise your hard
work might be lost. You cannot undo the import of resources.</li>
<li>Always check after an import whether everything was imported correctly. Also immediately
run the game to see if it all works. Otherwise return to your backup copy.</li>
<li>Note that the indices of resources, instances, and tiles, most likely change in the process to
guarantee that they remain unique. This will cause problems
when you refer to resources (or instances) by number. Also it will cause problems if you assume
anything about the order in which instances are created.</li>
<li>Note that the resources will be added in the order in which they are given in the resource list/tree.
New resources will be added at the end. However, the group structure is maintained.
This is normally what you expect but in some rare cases
you might have to move resources to a different location. For example, when you have a start room,
an end room and some rooms in between, when somebody adds some rooms (in between) and you then export
these and import them in the original game, they will appear at the end (because they are new). You then
must move the end room to the appropriate location again.!</li>
<li>Note that constants and triggers only globally store information about when they were last changed.
So when you change one constant or one trigger, all will be replaced when choosing
<b>Keep Last Changed</b>.</li>
<li>For the global game settings the same holds. They are either all, or not at all replaced.</li>
<li>Note that an empty game will have a new date at which it was last changed. This means that if
you import resources in a new empty game, the constants, triggers, and global game settings will
<b>not</b> be imported, unless you set the name conflict handling to always replace.</li>
<li>Don't remove resources from a game before importing the same resources again! This might
sound a logical thing to do but it will not work. Once you remove a resource from a game
it no longer exists. Hence all references to it will become undefined. Importing the
same resource later will not restore those references because the program cannot know
it is the same resource. Instead let the import feature replace the resources.</li>
<li>If you have worked on a game for a long time adding and deleting many resources, it is useful
to completely export it and then import it into an empty game (with the option to always replace).
The game will work as before but will be stripped of lots of unused data.</li>
</ul>
<!--END-->
</body>
</html>
<!-- KEYWORDS
importing resources
exporting resources
merging games
working together
collaborating
-->

View File

@ -1,35 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Polishing your game</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Polishing your game</h1>
When you want to distribute your game you better make sure that it has all the ingredients
that make it a great game. Besides the game itself this means that you should provide
game information, set the correct global game settings, and take care of speed.
This section gives you information about these aspects.
<!--HELPONLY-->
<P>
Information on finishing your game can be found in the following pages:
<P>
<blockquote>
<a href="301_00_information.html">Game Information</a><br>
<a href="302_00_settings.html">Global Game Settings</a><br>
<a href="303_00_speed.html">Speed Considerations</a><br>
</blockquote>
<!--ENDHELPONLY-->
<!--END-->
</body>
</html>

View File

@ -1,64 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Game information</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Game information</h1>
A good game provides the player with some information on how to play the game.
This information is displayed when the player presses the &lt;F1&gt; key during
game play. <i>Game Maker</i> has a simple built-in mechanism to provide game
help. However, it is limited in functionality. To create nicer games it is better
to create the help yourself using special rooms or by using splash screen with
e.g. html pages.
<p>
To create the simple game information, double click <b>Game Information</b>
in the resource tree at the left of the screen. A little built-in editor is
opened where you can edit the game information. You can use different fonts,
different colors, and styles. Also you can set the background color.
<p>
<img src="images/form_help.jpg">
<p>
In the <b>File</b> menu you can also set a number of <b>Options</b>.
Default the help is shown in the game window and game play is temporarily
halted. Here you can indicate to show the help file in a separate window.
In this case you can indicate the caption of the game information during the game. Also
you can indicate the position (use -1 for centered) and size of the game
information window and whether it should have a border and be sizeable by
the player. You can force the information window to stay on top and you
can indicate whether the game should continue playing while the information
is shown.
<p>
Good advice is to make the information short but precise. Of course
you should add your name because you created the game. All example games
provided have an information file about the game and how it was created.
You might want to indicate at the
bottom of the help file that the user must press Escape to continue playing.)
<p>
If you want to make a bit more fancy help, use a program like Word. Then select
the part you want and use copy and paste to move it from Word to
the game information editor. For more advanced games though you
probably will not use this mechanism at all but use some dedicated rooms
to show help about the game.
<!--END-->
</body>
</html>
<!-- KEYWORDS
information
game information
game help
help
mimic main window
-->

View File

@ -1,54 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Global Game Settings</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Global Game Settings</h1>
There are a number of settings you can change for your game. These change the shape
of the main window, set some graphics options, deal with interaction settings, to
loading image, constants and information about the creator of the game. Also you
can indicate here which files should be included in stand-alone games and how
errors should be handled.
<p>
The settings can be changed by double clicking on <b>Global Game Settings</b>
in the resource tree at the left
of the screen. They are subdivided in a number of tabbed pages. (Some options
are only available in advanced mode.)
<!--HELPONLY-->
<p>
Information about the different settings can be found in the following pages:
<p>
<blockquote>
<a href="302_01_graphics.html">Graphics and Window Options</a><br>
<a href="302_02_resolution.html">The Screen Resolution</a><br>
<a href="302_03_various.html">Various Other Options</a><br>
<a href="302_04_loading.html">Loading Options</a><br>
<a href="302_05_errors.html">Error Options</a><br>
<a href="302_06_info.html">Information about the Game</a><br>
</blockquote>
<!--ENDHELPONLY-->
<!--END-->
</body>
</html>
<!-- KEYWORDS
options
game options
game settings
global game settings
settings
-->

View File

@ -1,102 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Graphics options</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Graphics options</h3>
In this tab you can set a number of options that are related to the graphical
appearance of your game. It is normally useful to check out the effects of these
options because they can have a significant effect on the way the game looks.
Remember though that different users have different machines. So better make sure
that the settings also work on other peoples machines.
<p>
<b>Start in fullscreen mode</b><br>
When checked the game runs in the full screen; otherwise it runs in a window.
<p>
<b>Scaling</b><br>
Here you can indicate what happens when the window is larger than the room
or when the game is run in full-screen mode. There are three choices. You can
indicate a fixed scaling. The room is drawn scaled with the given amount in the
center of the window or the center of the screen. 100 indicates no scaling.
You typically use fixed scaling when your sprites and rooms are very small. The second
option is scale the room such that it fills the window or screen but keep
the aspect ratio (ratio between width and height) the same. The third
option is to scale such that the window or screen is completely filled. This
can lead to distortions in the image (in particular in windowed mode when
the user can resize the window).
<p>
<b>Interpolate colors between pixels</b><br>
When checked, colors of pixels in sprites, backgrounds, and tiles that are not
aligned with pixels on the screen will be interpolated. This in particular is the
case when they are scaled, rotated, or placed at non-integer positions. Interpolation
makes movement smoother but can also give a blurred effect. (Also for tiles it can
lead to cracks between them, if not carefully designed.)
<p>
<b>Color outside the room region</b><br>
When the room does not completely fill the window or screen there is some area
unused around it. Here you can specify the color of the area.
<p>
<b>Allow the player to resize the game window</b><br>
When checked in windowed mode the user can change the size of the game window by
dragging with the mouse at its corners.
<p>
<b>Let the game window always stay on top</b><br>
When checked in windowed mode the game window always stays on top of other windows.
<p>
<b>Don't draw a border in windowed mode</b><br>
When checked in windowed mode the game window will not have a border or a caption bar.
<p>
<b>Don't show the buttons in the window caption</b><br>
When checked in windowed mode the window caption will not show the buttons to
close the window or to minimize or maximize it.
<p>
<b>Display the cursor</b><br>
Indicates whether you want the mouse pointer to be visible. Turning it off is
normally faster and nicer.
(You can easily make you own cursor object in <i>Game Maker</i>.)
<p>
<b>Freeze the game when the form loses focus</b><br>
When checked, whenever the player brings some other form to the top (e.g.
another application) the game freezes until the game window again gets the
focus.
<p>
<b>Disable screensavers and power saving actions</b><br>
When checked (default) screensavers or power saving actions (sleep, hibernate) will not
activate while the game is running. This is important as these might destroy certain
graphics aspects of the game (like surfaces).
<!--END-->
</body>
</html>
<!-- KEYWORDS
fullscreen mode
scaling
window
resizable window
window border
border window
outside color
displaying the cursor
cursor display
freezing
-->

View File

@ -1,75 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Resolution</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Resolution</h3>
In this tab you can set the screen resolution in which your game must run.
By default the resolution is not changed. But sometimes you want to run the
game in a lower resolutions or you want to set the frequency of the monitor
to make sure the timing in the game works correctly. If you want to change
the resolution you must first check the box labeled
<b>Set the resolution of the screen</b>.
<p>
There are three things you can change. First of all there is the color depth.
This indicates the number of bits used to represent the color for a pixel.
Most machines now only allow for 16-bit (High Color) or 32-bit (Full Color) but
older machines also allowed for 8-bit and sometimes 24-bit color.
<i>Game Maker</i> only works correctly in 16-bit and 32-bit color. 32-bit
color gives nicer looking images but will take more memory and processing
time. If you want your game to run will on most older machines set the
color depth to 16-bit. Otherwise use 32-bit or don't change it.
<p>
Secondly there is the screen resolution, the number
of pixels (horizontal and vertical) on the screen. Changing the
resolution is useful when e.g. your rooms are very small. In this case
it might help to reduce the resolution of the screen. Realize though that
this will also effect other applications running. This can in particular
give problems with low resolutions. So in general it is better
to only do this when running the game in full screen mode. <i>Game Maker</i>
will automatically change the resolution back to the starting situation
once the game finishes.
<p>
Finally you can change the refresh frequency. This indicates how many times per second
the image on the screen is refreshed. If your room speed is larger than the frequency
not all steps are actually visible. It works best if the frequency is a multiple of
the room speed. (If you specify a frequency that is too high or not available the
frequency is not changed.)
<p>
There also is a setting here to <b>Use synchronization to avoid tearing</b>. This requires
some explanation. A display is redrawn a number of times per second, depending on the
refresh frequency. If a room is drawn halfway such a refresh, the top of the display will still
show the old image while the bottom part shows the new image. This is called tearing. To
avoid this you can check this option. In this case the new room image is only copied to
the screen when the refresh is not inside the window avoiding the tearing most of the time.
The disadvantage is that we normally have to wait till the next refresh. This means that the
maximal number of frames is bounded by the frequency of the monitor and, when the processing
is not fast enough, the framerate immediately drops to half that number.
Also there can be a conflict between the internal timing of the game and the synchronization.
If you want to do this best set the monitor frequency to e.g. 60 and also make the room speed
either 30 or 60.
<!--END-->
</body>
</html>
<!-- KEYWORDS
changing screen resolution
screen resolution
resolution
frequency
graphics mode
color depth
synchronization
tearing
-->

View File

@ -1,77 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Various other options</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Various other options</h3>
Here you can set a number of additional options. First of all you can set some default keys:
<p>
<b>Let &lt;Esc&gt; end the game</b><br>
When checked, pressing the escape key will end the game. More advanced games
normally don't want this to happen because they might want to do some processing
(like saving) before ending the game. In this case, uncheck this box and provide
your own actions for the escape key.
<p>
<b>Treat the close button as &lt;Esc&gt; key</b><br>
When checked the close button of the window will generate an escape key event. When
not checked the close button events are called instead.
<p>
<b>Let &lt;F1&gt; show the game information</b><br>
When checked pressing the F1 key will display the game information.
<p>
<b>Let &lt;F4&gt; switch between screen modes</b><br>
When checked the F4 key will switch between fullscreen and windowed mode.
<p>
<b>Let &lt;F5&gt; save the game and &lt;F6&gt; load a game</b><br>
When checked the player can use &lt;F5&gt; to store the current game situation
and &lt;F6&gt; to load the last saved game. (Note that only the basic game
data is stored. Once you use advanced features like particles or data structures
those settings are not saved and you might have to create a save mechanism yourself.
<p>
<b>Let &lt;F9&gt; take a screenshot of a game</b><br>
When checked the player can use &lt;F9&gt; to create a screenshot of the game.
This screenshot will be place in the file screenshotXXX.png in the folder where
the game is running, where XXX is the number of the screenshot. When creating
multiple screenshot the number is automatically increased.
<p>
Also you can set the priority of the game process. This priority indicates how
much processor time is allotted to the game. In normal mode the operating system
tries to give processor time to each process that needs it in some reasonable way.
The higher you put the priority the more time is allotted to the game, making it
run more smoothly and faster. But other processes get less time (also Windows
processes so even the mouse might not move anymore). Use this with care.
<p>
Finally, you can set the version information of the game. This information is shown in the
helptip that pops up when the user rests his mouse on the game executable. It is also
shown when the users clicks with the right mouse button on the program and chooses
properties and then version. If you distribute your game you best fill in this
information.
<p>
You should give your game a version number that consists of four parts: the major version,
the minor version, the release number and the build number. Also you should provide the
name of the company (you), the name of the product, the copyright information, and a
very brief description. All these fields should be at most 64 characters long.
<!--END-->
</body>
</html>
<!-- KEYWORDS
special keys
priority
-->

View File

@ -1,56 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Loading options</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Loading options</h3>
Here you can indicate what should happen when loading a game. First of all
you can specify your own loading image. Secondly, you can indicate whether
to display a loading progress bar at the bottom of the image. You have three
options here. Either no loading bar is displayed, or the default bar is
displayed or you can specify two images: the background of the loading bar
and the foreground. You can indicate whether the front loading bar must be
scaled (default) or clipped while it becomes longer. In the second case,
make sure enough the image is large enough to fill the bar. (Note that
both images must be specified in this case, not just one.)
<p>
It is possible to indicate that the loading image must be transparent.
In this case the left bottom pixel of the background image is used as
transparent color. (Note that transparency from e.g. png or gif files
is not taken into account here!)
Also the alpha translucency can be indicated. A value
of 0 means fully translucent. A value of 255 means fully opaque. (Both
only work under Windows 2000, XP, or later.)
<p>
Secondly, you can indicate here the icon that should be used for stand-alone
games. Your icons must contain at least a 32x32 icon, but they can also
contain larger ones. If you try to select another type of
icon you will get a warning.
<p>
Finally you can change the unique game id. This id is used for storing the
highscore list and save game files. If you release a new version of your
game and don't want to take over the old highscore list, you should change
this number.
<!--END-->
</body>
</html>
<!-- KEYWORDS
game id
loading image
loading bars
icon
game icon
translucense
-->

View File

@ -1,50 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Error options</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Error options</h3>
Here you can set a number of options that relate to the way errors are reported.
<p>
<b>Display error messages</b><br>
When checked, error messages are shown to the player. In the final
version of the game you might want to uncheck this option.
<p>
<b>Write error messages to file <tt>game_errors.log</tt></b><br>
When checked all error messages are written to a file called
<tt>game_errors.log</tt> in the game folder.
<p>
<b>Abort on all error messages</b><br>
Normally, certain errors are fatal while others can be ignored.
When checking this option all errors are considered fatal and lead
to aborting the game. In the final version of the game you distribute
you might want to check this option.
<p>
<b>Treat uninitialized variables as 0</b><br>
One common error is to use a variable before a value is assigned to it.
Sometimes this is difficult to avoid. When checking this option such
uninitialized variables no longer report an error but are treated as
value 0. Be careful though. It might mean that you don't spot typing
mistakes anymore.
<!--END-->
</body>
</html>
<!-- KEYWORDS
error messages
error options
uninitialized variables
error log
game_error.log
-->

View File

@ -1,27 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Information about the game</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Information about the game</h3>
Here you can indicate the author of the game, the version of the game, and some
information about the game. Also the last changed date is maintained. This is
useful if you are working with many people on a game or make new, updated
version. The information is not accessible when the game is running.
<!--END-->
</body>
</html>
<!-- KEYWORDS
information
creator
version
description
-->

View File

@ -1,77 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Speed considerations</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Speed considerations</h1>
If you are making complicated games you probably want to make them run as fast as possible.
Even though <i>Game Maker</i> does its best to make games run fast, a lot depends on how
you design your game. Also, it is rather easy to make games that use large amounts of
memory. In this page we give some hints on how to make your games faster and smaller.
<p>
First of all, look carefully at the sprites and backgrounds you use. Animated
sprites take a lot of memory and drawing lots of sprites takes a lot of time.
So make your sprites as small as possible. Remove any invisible area around it
(the command <b>Crop</b> in the sprite editor does that automatically). The same
applies to background images.
If you have a covering background, make sure you switch off the use of a
background color.
<p>
If you use full screen mode, make sure the size of the room
(or window) is never larger than the screen size. Most graphics cards can
efficiently scale images up but they are more slow in scaling images down!
Whenever possible, switch off the cursor. It slows down the graphics.
<p>
Also be careful with the use of many views. For each view the room is redrawn.
<p>
Besides the graphics, there are also other aspects that influence the speed.
Make sure you have as few instances as possible. In particular, destroy
instances once they are no longer required (e.g. when they leave the room).
Avoid lots of work in the step event or drawing event of instances. Often
things do not need to be checked in each step. Interpretation of code is
reasonably fast, but it is interpreted. Also, some functions and actions
take a lot of time; in particular those that have to check all instances
(like for example the bounce action).
<p>
When you need complicated processing (for example for advanced AI), you better write
a DLL for this in a different language and create an extension package out of this
to import the DLL using the functions described in the page on <A HREF="414_00_dlls.html">Using DLL's</A>.
</p>
<p>
Think about where to treat the collision events. You normally have two
options. Objects that have no collision events are treated much
faster, so preferably treat collisions in those objects of which there are
just a few instances.
<p>
Be careful with using large sound files. They take a lot of memory and
also compress badly. You might want to check your sounds and see whether
you can sample them down.
<p>
Finally, if you want to make a game that many people can play, make sure
you test it on a number of different machines, in particular also older machines.
<!--END-->
</body>
</html>
<!-- KEYWORDS
speed
fast games
testing
memory consumption
-->

View File

@ -1,50 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>The Game Maker Language (GML)</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>The Game Maker Language (GML)</h1>
<i>Game Maker</i> contains a built-in programming language.
This programming language gives you much more flexibility
and control than the standard actions. This language we
will refer to as GML (the <i>Game Maker</i> Language).
In this section we describe the language GML and we give
an overview of all the (close to 1000) functions and
variables available to control all aspects of your game.
<!--HELPONLY-->
<P>
Information on GML can be found in the following pages:
<p>
<blockquote>
<a href="401_00_language.html">Language overview</a><br>
<a href="402_00_computing.html">Computing things</a><br>
<a href="403_00_gameplay.html">Game play</a><br>
<a href="404_00_interaction.html">User interaction</a><br>
<a href="405_00_graphics.html">Game graphics</a><br>
<a href="406_00_sound.html">Sound and music</a><br>
<a href="407_00_splash.html">Splash screens, highscores and other pop-ups</a><br>
<a href="408_00_resources.html">Resources</a><br>
<a href="409_00_changing.html">Changing resources</a><br>
<a href="410_00_files.html">Files, registry, and executing programs</a><br>
<a href="411_00_datastructures.html">Data structures</a><br>
<a href="412_00_particles.html">Creating particles</a><br>
<a href="413_00_multiplayer.html">Multiplayer games</a><br>
<a href="414_00_dlls.html">Using DLL's</a><br>
<a href="415_00_d3d.html">3D Graphics</a><br>
</blockquote>
<!--ENDHELPONLY-->
<!--END-->
</body>
</html>

View File

@ -1,80 +0,0 @@
<html>
<head>
<title>GML Language Overview</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>GML Language overview</h1>
<i>Game Maker</i> contains a built-in programming language. This
programming language gives you much more flexibility and control than the
standard actions. This language we will refer to as GML (the <i>Game Maker
</i> Language). There are a number of different places where you can type
programs in this language. First of all, when you define scripts. A script
is a program in GML. Secondly, when you add a code action to an event. In
a code action you again have to provide a program in GML. Thirdly, in the
room creation code. And finally, wherever you need to specify a value in
an action, you can also use an expression in GML. An expression, as we
will see below is not a complete program, but a piece of code resulting in a
value.
<p>
In this chapter we will describe the basic structure of programs in GML.
When you want to use programs in GML, there are a couple of things you
have to be careful about. First of all, for all your resources (sprites,
objects, sounds, etc.) you must use names that start with a letter and
only consist of letters, digits and the underscore '_' symbol. Otherwise
you cannot refer to them from within the program. Make sure all resources
have different names. Also be careful not to name resources self, other,
global, or all because these have special meaning in the language. Also
you should not use any of the keywords, indicated below.
<!--HELPONLY-->
<P>
Information on the GML language can be found in the following pages:
<p>
<blockquote>
<a href="401_01_program.html">A Program</a><br>
<a href="401_02_variables.html">Variables</a><br>
<a href="401_03_assignments.html">Assignments</a><br>
<a href="401_04_expressions.html">Expressions</a><br>
<a href="401_05_extra.html">Extra Variables</a><br>
<a href="401_06_addressing.html">Addressing Variables in Other Instances</a><br>
<a href="401_07_arrays.html">Arrays</a><br>
<a href="401_08_if.html">If Statement</a><br>
<a href="401_09_repeat.html">Repeat Statement</a><br>
<a href="401_10_while.html">While Statement</a><br>
<a href="401_11_do.html">Do Statement</a><br>
<a href="401_12_for.html">For Statement</a><br>
<a href="401_13_switch.html">Switch Statement</a><br>
<a href="401_14_break.html">Break Statement</a><br>
<a href="401_15_continue.html">Continue Statement</a><br>
<a href="401_16_exit.html">Exit Statement</a><br>
<a href="401_17_functions.html">Functions</a><br>
<a href="401_18_scripts.html">Scripts</a><br>
<a href="401_19_with.html">With Construction</a><br>
<a href="401_20_comment.html">Comment</a><br>
<a href="401_21_funcvar.html">Functions and Variables in GML</a><br>
</blockquote>
<!--ENDHELPONLY-->
<!--END-->
</body>
</html>
<!-- KEYWORDS
GML
game maker language (GML)
coding language
script language
language
-->

View File

@ -1,41 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>A Program</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>A program</h3>
A program consists of a set of instructions, called statements. A program
must start with the symbol '{' and end with the symbol '}'. Between these
symbols there are the statements. Statements must be separated with a ';'
symbol. So the global structure of every program is:
<p>
<blockquote>
<pre>
{
&lt;statement&gt;;
&lt;statement&gt;;
...
}
</pre>
</blockquote>
<p>
There are a number of different types of statements, which will be
discussed below.
<!--END-->
</body>
</html>
<!-- KEYWORDS
program
statements
statement separator
-->

View File

@ -1,36 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Variables</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Variables</h3>
Like any programming language GML contains variables. Variables are memory
locations that store information. They have a name so that you can refer
to them. A variable in GML can store either a real number or a string.
Variables do not need to be declared like in many other languages. There
are a large number of built-in variables. Some are general, like
<tt>mouse_x</tt> and <tt>mouse_y</tt> that indicate the current mouse
position, while all others are local to the object instance for which we
execute the program, like x and y that indicate the current position of
the instance. A variable has a name that must start with a letter and can
contain only letters, numbers, and the underscore symbol '_'. (The maximal
length is 64 symbols.) When you use a new variable it is local to the
current instance and is not known in programs for other instances (even of
the same object). You can though refer to variables in other instances;
see below.
<!--END-->
</body>
</html>
<!-- KEYWORDS
variables
variable name
local variables
-->

View File

@ -1,31 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Assignments</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Assignments</h3>
An assignment stores a value in a variable. An assignment has the form:
<p>
<blockquote><pre>&lt;variable&gt; = &lt;expression&gt;;</pre></blockquote>
<p>
An expression can be a simple value but can also be more complicated.
Rather than assigning a value to a variable, one can also add the value to
the current value of the variable using +=. Similar, you can subtract it
using -=, multiply it using *=, divide it using /= ,or use bitwise
operators using |=, &amp;\, or ^=.
<!--END-->
</body>
</html>
<!-- KEYWORDS
assignements
-->

View File

@ -1,92 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Expressions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Expressions</h3>
Expressions can be real numbers (e.g. 3.4), hexadecimal numbers, starting
with a $ sign (e.g. $00FFAA), strings between single or
double quotes (e.g. 'hello' or &#8220;hello&#8221;) or more complicated
expressions. (Note that strings can run over multiple lines!)
For expressions, the following binary operators exist (in
order of priority):
<ul>
<li>&amp;&amp; || ^^: combine Boolean values (&amp;&amp; = and, || = or,
^^ = xor)</li>
<li>&lt; &lt;= == != &gt; &gt;=: comparisons, result in true (1) or
false (0)</li>
<li>| &amp; ^: bitwise operators (| = bitwise or, &amp; = bitwise and, ^
= bitwise xor)</li>
<li>&lt;&lt; &gt;&gt;: bitwise operators (&lt;&lt; = shift left, &gt;
&gt; = shift right)</li>
<li>+ -: addition, subtraction</li>
<li>* / div mod: multiplication, division, integer division, and modulo
</li>
</ul>
<p>
Note that
value of <tt>x div y</tt> is the value of <tt>x/y</tt> rounded in the direction of zero to the nearest integer.
The <tt>mod</tt> operator returns the remainder obtained by dividing its operands.
In other words, <tt>x mod y = x - (x div y) * y</tt>.
Also, the following unary operators exist:
<ul>
<li>!: not, turns true into false and false into true</li>
<li>-: negates the next value</li>
<li>~: negates the next value bitwise</li>
</ul>
As values you can use numbers, variables, or functions that return a
value. Sub-expressions can be placed between brackets. All operators work
for real values. Comparisons also work for strings and + concatenates
strings. (Please note that, contrary to certain languages, both arguments
to a Boolean operation are always computed, even when the first argument
already determines the outcome.)
<p>
<b>Example</b>
<p>
Here is an example with some assignments.
<p>
<blockquote>
<pre>
{
x = 23;
color = $FFAA00;
str = 'hello world';
y += 5;
x *= y;
x = y &lt;&lt; 2;
x = 23*((2+4) / sin(y));
str = 'hello' + &quot; world&quot;;
b = (x &lt; 5) &amp;&amp; !(x==2 || x==4);
}
</pre>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
hexadecimal numbers
expressions
operators
binary operators
unary operators
bitwise operators
boolean operators
logical operators
-->

View File

@ -1,90 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Extra Variables</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Extra variables</h3>
You create new variables by assigning a value to them (no need to declare
them first). If you simply use a variable name, the variable will be
stored with the current object instance only. So don't expect to find it
when dealing with another object (or another instance of the same object)
later. You can also set and read variables in other objects by putting the
object name with a dot before the variable name.
<p>
To create global variables, that are visible to all object instances,
precede them with the word <tt>global</tt> and a dot. So for example you
can write:
<p>
<blockquote>
<pre>
{
<b>if</b> (<b>global</b>.doit)
{
// do something
<b>global</b>.doit = false;
}
}
</pre>
</blockquote>
<p>
Alternatively you can declare the variables as being global.
This declaration looks as follows.
<p>
<blockquote>
<pre><b>globalvar</b> &lt;varname1&gt;,&lt;varname2&gt;,&lt;varname3&gt;, ... ;</pre>
</blockquote>
<p>
Once this declaration has been executed, the variable is always treated as global without
the need to put the word <tt>global</tt> and a dot in front of it. It only needs to
be declared once in a piece of code that is executed. After that in all other
places the variable is considered as being global.
<p>
Sometimes you want variables only within the current piece of code or
script. In this way you avoid wasting memory and you are sure there is no
naming conflict. It is also faster than using global variables. To achieve
this you must declare the variables at the beginning of the piece of code
using the keyword var. This declaration looks as follows.
<p>
<blockquote>
<pre><b>var</b> &lt;varname1&gt;,&lt;varname2&gt;,&lt;varname3&gt;, ... ;</pre>
</blockquote>
<p>
For example, you can write:
<p>
<blockquote>
<pre>
{
<b>var</b> xx,yy;
xx = x+10;
yy = y+10;
instance_create(xx,yy,ball);
}
</pre>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
global variables
local variables
declaring variables
var
globalvar
-->

View File

@ -1,133 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Addressing variables in other instances</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Addressing variables in other instances</h3>
As described earlier, you can set variables in the current instance using
statements like
<p>
<blockquote><pre>x = 3;</pre></blockquote>
<p>
But in a number of cases you want to address variables in another
instance. For example, you might want to stop the motion of all balls, or
you might want to move the main character to a particular position, or, in
the case of a collision, you might want to set the sprite for the other
instance involved. This can be achieved by preceding the variable name
with the name of an object and a dot. So for example, you can write
<p>
<blockquote><pre><tt>ball</tt>.speed = 0;</pre></blockquote>
<p>
This will change the speed of all instances of object ball. There are a
number of special &quot;objects&quot;.
<ul>
<li><tt>self</tt>: The current instance for which we are executing the
action</li>
<li><tt>other</tt>: The other instance involved in a collision event
</li>
<li><tt>all</tt>: All instances</li>
<li><tt>noone</tt>: No instance at all (sounds weird probably but it
does come in handy as we will see later on)</li>
<li><tt>global</tt>: Not an instance at all, but a container that stores
global variables</li>
</ul>
So, for example, you can use the following kind of statements:
<p>
<blockquote>
<pre>
other.sprite_index = sprite5;
all.speed = 0;
global.message = 'A good result';
global.x = ball.x;
</pre>
</blockquote>
<p>
Now you might wonder what the last assignment does when there are multiple
balls. Well, the first one is taken and its x value is assigned to the
global value.
<p>
But what if you want to set the speed of one particular ball, rather than
all balls? This is slightly more difficult. Each instance has a unique id.
When you put instances in a room in the designer, this instance id is
shown when you rest the mouse on the instance. These are numbers larger
than or equal to 100000. Such a number you can also use as the left-hand
side of the dot. But be careful. The dot will get interpreted as the
decimal dot in the number. To avoid this, put brackets around it. So for
example, assuming the id of the ball is 100032, you can write:
<p>
<blockquote><pre>(100032).speed = 0;</pre></blockquote>
<p>
When you create an instance in the program, the call returns the id. So a
valid piece of program is
<p>
<blockquote>
<pre>
{
nnn = instance_create(100,100,ball);
nnn.speed = 8;
}
</pre>
</blockquote>
<p>
This creates a ball and sets its speed. Note that we assigned the instance
id to a variable and used this variable as indication in front of the dot.
This is completely valid. Let us try to make this more precise. A dot is
actually an operator. It takes a value as left operand and a variable
(address) as right operand, and returns the address of this particular
variable in the indicated object or instance. All the object names, and
the special objects indicated above simply represent values and these can
be dealt with like any value. For example, the following program is valid:
<p>
<blockquote>
<pre>
{
obj[0] = ball;
obj[1] = flag;
obj[0].alarm[4] = 12;
obj[1].id.x = 12;
}
</pre>
</blockquote>
<p>
The last statement should be read as follows. We take the id of the first
flag. For the instance with that id we set the x coordinate to 12.
<p>
Object names, the special objects, and the instance id's can also be used
in a number of functions. They are actually treated as constants in the
programs.
<!--END-->
</body>
</html>
<!-- KEYWORDS
variables, in other instances
self
other
all
global
noone
instance id
-->

View File

@ -1,43 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Arrays</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Arrays</h3>
You can use 1- and 2-dimensional arrays in GML. Simply put the index
between square brackets for a 1-dimensional array, and the two indices
with a comma between them for 2-dimensional arrays. At the moment you use
an index the array is generated. Each array runs from index 0. So be
careful with using large indices because memory for a large array will be
reserved. Never use negative indices. The system puts a limit of 32000 on
each index and 1000000 on the total size. So for example you can write the
following:
<p>
<blockquote>
<pre>
{
a[0] = 1;
i = 1;
<b>while</b> (i &lt; 10) { a[i] = 2*a[i-1]; i += 1;}
b[4,6] = 32;
}
</pre>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
arrays
2-dimensional arrays
1-dimensional arrays
-->

View File

@ -1,72 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>If statement</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>If statement</h3>
An if statement has the form
<p>
<blockquote>
<pre><b>if</b> (&lt;expression&gt;) &lt;statement&gt;</pre>
</blockquote>
<p>
or
<p>
<blockquote>
<pre><b>if</b> (&lt;expression&gt;) &lt;statement&gt; <b>else</b> &lt;statement&gt;</pre>
</blockquote>
<p>
The statement can also be a block. The expression will be evaluated. If
the (rounded) value is &lt;=0 (<b>false</b>) the statement after else is
executed, otherwise (<b>true</b>) the other statement is executed. It is a
good habit to always put curly brackets around the statements in the if
statement. So best use
<p>
<blockquote>
<pre>
<b>if</b> (&lt;expression&gt;)
{
&lt;statement&gt;
}
<b>else</b>
{
&lt;statement&gt;
}
</pre>
</blockquote>
<p>
<b>Example</b><br>
The following program moves the object toward the middle of the screen.
<p>
<blockquote>
<pre>
{
<b>if</b> (x&lt;200) {x += 4} <b>else</b> {x -= 4};
}
</pre>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
else
if
conditional statement
-->

View File

@ -1,44 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Repeat statement</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Repeat statement</h3>
A repeat statement has the form
<p>
<blockquote><pre><b>repeat</b> (&lt;expression&gt;) &lt;statement&gt;
</pre></blockquote>
<p>
The statement is repeated the number of times indicated by the rounded
value of the expression.
<p>
<b>Example</b><br>
The following program creates five balls at random positions.
<p>
<blockquote>
<pre>
{
<b>repeat</b> (5) instance_create(random(400),random(400),ball);
}
</pre>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
repeat statement
-->

View File

@ -1,54 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>While statement</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>While statement</h3>
A while statement has the form
<p>
<blockquote>
<pre><b>while</b> (&lt;expression&gt;) &lt;statement&gt;</pre>
</blockquote>
<p>
As long as the expression is true, the statement (which can also be a
block) is executed. Be careful with your while loops. You can easily make
them loop forever, in which case your game will hang and not react to any
user input anymore.
<p>
<b>Example</b><br>
The following program tries to place the current object at a free position
(this is about the same as the action to move an object to a random
position).
<p>
<blockquote>
<pre>
{
<b>while</b> (!place_free(x,y))
{
x = random(room_width);
y = random(room_height);
}
}
</pre>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
while statement
loop
-->

View File

@ -1,53 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Do statement</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Do statement</h3>
A do statement has the form
<p>
<blockquote>
<pre><b>do</b> &lt;statement&gt; <b>until</b>(&lt;expression&gt;)</pre>
</blockquote>
<p>
The statement (which can also be a block) is executed until the expression
is true. The statement is executed at least once. Be careful with your do
loops. You can easily make them loop forever, in which case your game will
hang and not react to any user input anymore.
<p>
<b>Example</b><br>
The following program tries to place the current object at a free position
(this is about the same as the action to move an object to a random
position).
<p>
<blockquote>
<pre>
{
<b>do</b>
{
x = random(room_width);
y = random(room_height);
}
<b>until</b> (place_free(x,y))
}
</pre>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
do statement
until
-->

View File

@ -1,57 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>For statement</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>For statement</h3>
A for statement has the form
<p>
<blockquote>
<pre><b>for</b> (&lt;statement1&gt; ; &lt;expression&gt; ;&lt;statement2&gt;) &lt;statement3&gt;</pre>
</blockquote>
<p>
This works as follows. First statement1 is executed. Then the expression
is evaluated. If it is true, statement 3 is executed; then statement 2 and
then the expression is evaluated again. This continues until the
expression is false.
<p>
This may sound complicated. You should interpret this as follows. The
first statement initializes the for-loop. The expression tests whether the
loop should be ended. Statement2 is the step statement that goes to the
next loop evaluation.
<p>
The most common use is to have a counter run through some range.
<p>
<b>Example</b><br>
The following program initializes an array of length 10 with the values 1-
10.
<p>
<blockquote>
<pre>
{
<b>for</b> (i=0; i&lt;=9; i+=1) list[i] = i+1;
}
</pre>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
for statement
for loop
-->

View File

@ -1,71 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Switch statement</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Switch statement</h3>
In a number of situations you want to let your action depend on a
particular value. You can do this using a number of if statements but it
is easier to use the switch statement. A switch statement has the
following form:
<p>
<blockquote>
<pre>
<b>switch</b> (&lt;expression&gt;)
{
<b>case</b> &lt;expression1&gt;: &lt;statement1&gt;; ... ; <b>break</b>;
<b>case</b> &lt;expression2&gt;: &lt;statement2&gt;; ... ; <b>break</b>;
...
<b>default</b>: &lt;statement&gt;; ...
}
</pre>
</blockquote>
<p>
This works as follows. First the expression is executed. Next it is
compared with the results of the different expressions after the case
statements. The execution continues after the first case statement with
the correct value, until a break statement is encountered. If no case
statement has the right value, execution is continued after the default
statement. (It is not required to have a default statement.)
Note that multiple case
statements can be placed for the same statement. Also, the break is not
required. If there is no break statement the execution simply continues
with the code for the next case statement.
<p>
<b>Example</b><br>
The following program takes action based on a key that is pressed.
<p>
<blockquote>
<pre>
<b>switch</b> (keyboard_key)
{
<b>case</b> vk_left:
<b>case</b> vk_numpad4:
x -= 4; <b>break</b>;
<b>case</b> vk_right:
<b>case</b> vk_numpad6:
x += 4; <b>break</b>;
}
</pre>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
switch statement
case
break
-->

View File

@ -1,31 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Break statement</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Break statement</h3>
The break statement has the form
<p>
<blockquote><pre><b>break</b></pre></blockquote>
<p>
If used within a for-loop, a while-loop, a repeat-loop, a switch
statement, or a with statement, it end this loop or statement. If used
outside such a statement it ends the program (not the game).
<!--END-->
</body>
</html>
<!-- KEYWORDS
break statement
breaking loops
-->

View File

@ -1,34 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Continue statement</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Continue statement</h3>
The continue statement has the form
<p>
<blockquote>
<pre>
<b>continue</b>
</pre>
</blockquote>
<p>
If used within a for-loop, a while-loop, a repeat-loop, or a with
statement, it continues with the next value for the loop or with
statement.
<!--END-->
</body>
</html>
<!-- KEYWORDS
continue statement
-->

View File

@ -1,31 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Exit statement</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Exit statement</h3>
The exit statement has the form
<p>
<blockquote><pre><b>exit</b></pre></blockquote>
<p>
It simply ends the execution of this script or piece of code. (It does not
end the execution of the game! For this you need the function game_end();
see below.)
<!--END-->
</body>
</html>
<!-- KEYWORDS
exit statement
ending a program
-->

View File

@ -1,46 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Functions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Functions</h3>
A function has the form of a function name, followed by zero or more
arguments between brackets, separated by commas.
<p>
<blockquote>
<pre>&lt;function&gt;(&lt;arg1&gt;,&lt;arg2&gt;,...)</pre>
</blockquote>
<p>
There are two types of functions. First of all, there is a huge collection
of built-in functions, to control all aspects of your game. Secondly, any
script you define in your game can be used as a function.
<p>
Note that for a function without arguments you still need to use the
brackets. Some functions return values and can be used in expressions.
Others simply execute commands.
<p>
Note that it is impossible to use a function as the lefthand side of an
assignment. For example, you cannot write
<tt>instance_nearest(x,y,obj).speed = 0</tt>.
Instead you must write <tt>(instance_nearest(x,y,obj)).speed = 0</tt>.
<!--END-->
</body>
</html>
<!-- KEYWORDS
functions
calling functions
arguments
-->

View File

@ -1,61 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Scripts</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Scripts</h3>
When you create a script, you want to access the arguments passed to it
(either when using the script action, or when calling the script as a
function from a program (or from another, or even the same script). These
arguments are stored in the variables argument0, <tt>argument1</tt>, ...,
<tt>argument15</tt>. So there can be at most 16 arguments. (Note that when
calling the script from an action, only the first 5 arguments can be
specified.) You can also use <tt>argument[0]</tt> etc.
<p>
Scripts can also return a value, so that they can be used in
expressions. For this end you use the return statement:
<p>
<blockquote>
<pre><b>return</b> &lt;expression&gt;</pre>
</blockquote>
<p>
Execution of the script ends at the return statement!
<p>
<b>Example</b><br>
Here is the definition for a little script that computes the square of the
argument:
<p>
<blockquote>
<pre>
{
<b>return</b> (argument0*argument0);
}
</pre>
</blockquote>
<p>
To call a script from within a piece of code, just act the same way as
when calling functions. That is, write the script name with the argument
values in parentheses.
<!--END-->
</body>
</html>
<!-- KEYWORDS
scripts
calling scripts
return value
-->

View File

@ -1,121 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>With constructions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>With constructions</h3>
As indicated before, it is possible to read and change the value of
variables in other instances. But in a number of cases you want to do a
lot more with other instances. For example, imagine that you want to move
all balls 8 pixels down. You might think that this is achieved by the
following piece of code
<p>
<blockquote>
<pre>ball.y = ball.y + 8;</pre>
</blockquote>
<p>
But this is not correct. The right side of the assignment gets the value
of the y-coordinate of the first ball and adds 8 to it. Next this new
value is set as y-coordinate of all balls. So the result is that all balls
get the same y-coordinate. The statement
<p>
<blockquote>
<pre>ball.y += 8;</pre>
</blockquote>
<p>
will have exactly the same effect because it is simply an abbreviation of
the first statement. So how do we achieve this? For this purpose there is
the <b>with</b> statement. Its global form is
<p>
<blockquote>
<pre><b>with</b> (&lt;expression&gt;) &lt;statement&gt;</pre>
</blockquote>
<p>
&lt;expression&gt; indicates one or more instances. For this you can use
an instance id, the name of an object (to indicate all instances of this
object) or one of the special objects (all, self, other, noone).
&lt;statement&gt; is now executed for each of the indicated instances, as
if that instance is the current (self) instance. So, to move all balls 8
pixels down, you can type.
<p>
<blockquote>
<pre><b>with</b> (ball) y += 8;</pre>
</blockquote>
<p>
If you want to execute multiple statements, put curly brackets around
them. So for example, to move all balls to a random position, you can use
<p>
<blockquote>
<pre>
<b>with</b> (ball)
{
x = random(room_width);
y = random(room_height);
}
</pre>
</blockquote>
<p>
Note that, within the statement(s), the indicated instance has become the
self instance. Within the statements the original self instance has become
the other instance. So for example, to move all balls to the position of
the current instance, you can type
<p>
<blockquote>
<pre>
<b>with</b> (ball)
{
x = other.x;
y = other.y;
}
</pre>
</blockquote>
<p>
Use of the with statement is extremely powerful. Let me give a few more
examples. To destroy all balls you type
<p>
<blockquote>
<pre><b>with</b> (ball) instance_destroy();</pre>
</blockquote>
<p>
If a bomb explodes and you want to destroy all instances close by you can
use
<p>
<blockquote>
<pre>
<b>with</b> (all)
{
<b>if</b> (distance_to_object(other) &lt; 50) instance_destroy();
}
</pre>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
with construction
applying code to instances
-->

View File

@ -1,26 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Comment</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Comment</h3>
You can add comment to your programs. Everything on a line after // is not
read. You can also make a multi-line comment by placing the text between /
* and */. (Colorcoding might not work correctly here! Press F12 to re-
colorcode the text if an error occurs.)
<!--END-->
</body>
</html>
<!-- KEYWORDS
comment
multiline comment
-->

View File

@ -1,37 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Functions and variables in GML</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Functions and variables in GML</h3>
GML contains a large number of built-in functions and variables. With
these you can control any part of the game. For all actions there are
corresponding functions so you actually don't need to use any actions if
you prefer using code. But there are many more functions and variables
that control aspects of the game that cannot be used with actions only. So
if you want to make advanced games you are strongly advised to read
through the following chapters to get an overview of all that is possible.
Please note that these variables and functions can also be used when
providing values for actions. So even if you don't plan on using code or
writing scripts, you will still benefit from this information.
<p>
The following convention is used below. Variable names marked with a * are
read-only, that is, their value cannot be changed. Variable names with
[0..n] after them are arrays. The range of possible indices is given.
<!--END-->
</body>
</html>
<!-- KEYWORDS
builtin functions
builtin variables
-->

View File

@ -1,37 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Computing things</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Computing things</h1>
<i>Game Maker</i> contains a large number of functions to compute certain things. Here is a complete list.
<!--HELPONLY-->
<P>
Information on the GML language can be found in the following pages:
<p>
<blockquote>
<a href="402_01_constants.html">Constants</a><br>
<a href="402_02_real.html">Real-valued functions</a><br>
<a href="402_03_string.html">String handling functions</a><br>
<a href="402_04_dates.html">Dealing with dates and time</a><br>
</blockquote>
<!--ENDHELPONLY-->
<!--END-->
</body>
</html>

View File

@ -1,32 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Constants</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Constants</h3>
The following mathematical constants exist:
<p>
<blockquote>
<tt><b>true</b></tt> Equal to 1.<br>
<tt><b>false</b></tt> Equal to 0.<br>
<tt><b>pi</b></tt> Equal to 3.1415...
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
true
false
pi
-->

View File

@ -1,166 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Real-valued functions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Real-valued functions</h3>
The following functions exist that deal with real numbers.
<p>
<blockquote>
<tt><b>random(x)</b></tt>
Returns a random real number between 0 and x. The number is always smaller than x.<br>
<tt><b>random_range(x1,x2)</b></tt>
Returns a random real number between x1 (inclusive) and x2 (exclusive).<br>
<tt><b>irandom(x)</b></tt>
Returns a random integer number between 0 and x (inclusive when x is an integer).<br>
<tt><b>irandom_range(x1,x2)</b></tt>
Returns a random real number between x1 (inclusive) and x2 (inclusive). Both x1 and x2 must
be integer values (otherwise they are rounded down).<br>
<tt><b>random_set_seed(seed)</b></tt>
Sets the seed (an integer) that is used for the random number generation. Can be used
to repeat the same random sequence. (Note though that also some actions and the system
itself uses random numbers.)<br>
<tt><b>random_get_seed()</b></tt>
Returns the current seed.<br>
<tt><b>randomize()</b></tt>
Sets the seed to a random number.<br>
<tt><b>choose(val1,val2,val3,...)</b></tt>
Returns one of the arguments choosen randomly.
The function can have up to 16 arguments.<br>
<tt><b>abs(x)</b></tt>
Returns the absolute value of x.<br>
<tt><b>sign(x)</b></tt>
Returns the sign of x (-1, 0 or 1).<br>
<tt><b>round(x)</b></tt>
Returns x rounded to the nearest integer.<br>
<tt><b>floor(x)</b></tt>
Returns the floor of x, that is, x rounded down to an integer.<br>
<tt><b>ceil(x)</b></tt>
Returns the ceiling of x, that is, x rounded up to an integer.<br>
<tt><b>frac(x)</b></tt>
Returns the fractional part of x, that is, the part behind the decimal dot.<br>
<tt><b>sqrt(x)</b></tt>
Returns the square root of x. x must be non-negative.<br>
<tt><b>sqr(x)</b></tt>
Returns x*x.<br>
<tt><b>power(x,n)</b></tt>
Returns x to the power n.<br>
<tt><b>exp(x)</b></tt>
Returns e to the power x.<br>
<tt><b>ln(x)</b></tt>
Returns the natural logarithm of x.<br>
<tt><b>log2(x)</b></tt>
Returns the log base 2 of x.<br>
<tt><b>log10(x)</b></tt>
Returns the log base 10 of x.<br>
<tt><b>logn(n,x)</b></tt>
Returns the log base n of x.<br>
<tt><b>sin(x)</b></tt>
Returns the sine of x (x in radians).<br>
<tt><b>cos(x)</b></tt>
Returns the cosine of x (x in radians).<br>
<tt><b>tan(x)</b></tt>
Returns the tangent of x (x in radians).<br>
<tt><b>arcsin(x)</b></tt>
Returns the inverse sine of x.<br>
<tt><b>arccos(x)</b></tt>
Returns the inverse cosine of x.<br>
<tt><b>arctan(x)</b></tt>
Returns the inverse tangent of x.<br>
<tt><b>arctan2(y,x)</b></tt>
Calculates arctan(Y/X), and returns an angle in the correct quadrant.<br>
<tt><b>degtorad(x)</b></tt>
Converts degrees to radians.<br>
<tt><b>radtodeg(x)</b></tt>
Converts radians to degrees.<br>
<tt><b>min(val1,val2,val3,...)</b></tt>
Returns the minimum of the values. The function can have up to 16 arguments.
They must either be all real or all strings.<br>
<tt><b>max(val1,val2,val3,...)</b></tt>
Returns the maximum of the values. The function can have up to 16 arguments.
They must either be all real or all strings.<br>
<tt><b>mean(val1,val2,val3,...)</b></tt>
Returns the average of the values. The function can have up to 16 arguments.
They must all be real values.<br>
<tt><b>median(val1,val2,val3,...)</b></tt>
Returns the median of the values, that is, the middle value. (When the number
of arguments is even, the smaller of the two middle values is returned.)
The function can have up to 16 arguments.
They must all be real values.<br>
<tt><b>point_distance(x1,y1,x2,y2)</b></tt>
Returns the distance between point (x1,y1) and point (x2,y2).<br>
<tt><b>point_direction(x1,y1,x2,y2)</b></tt>
Returns the direction from point (x1,y1) toward point (x2,y2) in degrees.<br>
<tt><b>lengthdir_x(len,dir)</b></tt>
Returns the horizontal x-component of the vector determined by the
indicated length and direction.<br>
<tt><b>lengthdir_y(len,dir)</b></tt>
Returns the vertical y-component of the vector determined by the
indicated length and direction.<br>
<tt><b>is_real(x)</b></tt>
Returns whether x is a real value (as opposed to a string).<br>
<tt><b>is_string(x)</b></tt>
Returns whether x is a string (as opposed to a real value).<br>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
mathematical functions
computing
calculations
mathematics
trigonometric functions
is_real()
is_string()
random()
random_range()
irandom()
irandom_range()
random_set_seed()
random_get_seed()
randomize()
choose()
abs()
round()
floor()
ceil()
sign()
frac()
sqrt()
sqr()
exp()
ln()
log2()
log10()
sin()
cos()
tan()
arcsin()
arccos()
arctan()
arctan2()
degtorad()
radtodeg()
power()
logn()
min()
max()
mean()
median()
point_distance()
point_direction()
lengthdir_x()
lengthdir_y()
-->

View File

@ -1,108 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>String handling functions</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>String handling functions</h3>
The following functions deal with characters and string.
<p>
<blockquote>
<tt><b>chr(val)</b></tt>
Returns a string containing the character with asci code val.<br>
<tt><b>ord(str)</b></tt>
Returns the asci code of the first character in str.<br>
<tt><b>real(str)</b></tt>
Turns str into a real number. str can contain a minus sign, a decimal
dot and even an exponential part.<br>
<tt><b>string(val)</b></tt>
Turns the real value into a string using a standard format (no decimal
places when it is an integer, and two decimal places otherwise).<br>
<tt><b>string_format(val,tot,dec)</b></tt>
Turns val into a string using your own format: tot indicates the total
number of places and dec indicates the number of decimal places.<br>
<tt><b>string_length(str)</b></tt>
Returns the number of characters in the string.<br>
<tt><b>string_pos(substr,str)</b></tt>
Returns the position of substr in str (0=no occurrence).<br>
<tt><b>string_copy(str,index,count)</b></tt>
Returns a substring of str, starting at position index, and of length count.<br>
<tt><b>string_char_at(str,index)</b></tt>
Returns the character in str at position index.<br>
<tt><b>string_delete(str,index,count)</b></tt>
Returns a copy of str with the part removed that starts at position
index and has length count.<br>
<tt><b>string_insert(substr,str,index)</b></tt>
Returns a copy of str with substr added at position index.<br>
<tt><b>string_replace(str,substr,newstr)</b></tt>
Returns a copy of str with the first occurrence of substr replaced by newstr.<br>
<tt><b>string_replace_all(str,substr,newstr)</b></tt>
Returns a copy of str with all occurrences of substr replaced by newstr.<br>
<tt><b>string_count(substr,str)</b></tt>
Returns the number of occurrences of substr in str.<br>
<tt><b>string_lower(str)</b></tt>
Returns a lowercase copy of str.<br>
<tt><b>string_upper(str)</b></tt>
Returns an uppercase copy of str.<br>
<tt><b>string_repeat(str,count)</b></tt>
Returns a string consisting of count copies of str.<br>
<tt><b>string_letters(str)</b></tt>
Returns a string that only contains the letters in str.<br>
<tt><b>string_digits(str)</b></tt>
Returns a string that only contains the digits in str.<br>
<tt><b>string_lettersdigits(str)</b></tt>
Returns a string that contains the letters and digits in str.<br>
</blockquote>
<p>
The following functions deal with the clipboard for storing text.
<p>
<blockquote>
<tt><b>clipboard_has_text()</b></tt>
Returns whether there is any text on the clipboard.<br>
<tt><b>clipboard_get_text()</b></tt>
Returns the current text on the clipboard.<br>
<tt><b>clipboard_set_text(str)</b></tt>
Sets the string str on the clipboard.<br>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
string functions
clipboard functions
real()
string()
string_format()
chr()
ord()
string_length()
string_pos()
string_copy()
string_char_at()
string_delete()
string_insert()
string_lower()
string_upper()
string_repeat()
string_letters()
string_digits()
string_lettersdigits()
string_replace()
string_replace_all()
string_count()
clipboard_has_text()
clipboard_set_text()
clipboard_get_text()
-->

View File

@ -1,196 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Dealing with dates and time</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Dealing with dates and time</h3>
In <I>Game Maker</I> there are a number of functions to deal with dates and time.
A date-time combination is stored in a real number. The integral part of a date-time
value is the number of days that have passed since 12/30/1899. The fractional part
of the date-time value is fraction of a 24 hour day that has elapsed.
The following functions exist:
<p>
<blockquote>
<tt><b>date_current_datetime()</b></tt>
Returns the date-time value that corresponds to the current moment.<br>
<tt><b>date_current_date()</b></tt>
Returns the date-time value that corresponds to the current date only (ignoring the time).<br>
<tt><b>date_current_time()</b></tt>
Returns the date-time value that corresponds to the current time only (ignoring the date).<br>
<tt><b>date_create_datetime(year,month,day,hour,minute,second)</b></tt>
Creates a date-time value corresponding to the indicated date and time.<br>
<tt><b>date_create_date(year,month,day)</b></tt>
Creates a date-time value corresponding to the indicated date.<br>
<tt><b>date_create_time(hour,minute,second)</b></tt>
Creates a date-time value corresponding to the indicated time.<br>
<tt><b>date_valid_datetime(year,month,day,hour,minute,second)</b></tt>
Returns whether the indicated date and time are valid.<br>
<tt><b>date_valid_date(year,month,day)</b></tt>
Returns whether the indicated date is valid.<br>
<tt><b>date_valid_time(hour,minute,second)</b></tt>
Returns whether the indicated time is valid.<br>
<tt><b>date_inc_year(date,amount)</b></tt>
Returns a new date that is amount years after the indicated date.
amount must be an integer number.<br>
<tt><b>date_inc_month(date,amount)</b></tt>
Returns a new date that is amount months after the indicated date.
amount must be an integer number.<br>
<tt><b>date_inc_week(date,amount)</b></tt>
Returns a new date that is amount weeks after the indicated date.
amount must be an integer number.<br>
<tt><b>date_inc_day(date,amount)</b></tt>
Returns a new date that is amount days after the indicated date.
amount must be an integer number.<br>
<tt><b>date_inc_hour(date,amount)</b></tt>
Returns a new date that is amount hours after the indicated date.
amount must be an integer number.<br>
<tt><b>date_inc_minute(date,amount)</b></tt>
Returns a new date that is amount minutes after the indicated date.
amount must be an integer number.<br>
<tt><b>date_inc_second(date,amount)</b></tt>
Returns a new date that is amount seconds after the indicated date.
amount must be an integer number.<br>
<tt><b>date_get_year(date)</b></tt>
Returns the year corresponding to the date.<br>
<tt><b>date_get_month(date)</b></tt>
Returns the month corresponding to the date.<br>
<tt><b>date_get_week(date)</b></tt>
Returns the week of the year corresponding to the date.<br>
<tt><b>date_get_day(date)</b></tt>
Returns the day of the month corresponding to the date.<br>
<tt><b>date_get_hour(date)</b></tt>
Returns the hour corresponding to the date.<br>
<tt><b>date_get_minute(date)</b></tt>
Returns the minute corresponding to the date.<br>
<tt><b>date_get_second(date)</b></tt>
Returns the second corresponding to the date.<br>
<tt><b>date_get_weekday(date)</b></tt>
Returns the day of the week corresponding to the date.<br>
<tt><b>date_get_day_of_year(date)</b></tt>
Returns the day of the year corresponding to the date.<br>
<tt><b>date_get_hour_of_year(date)</b></tt>
Returns the hour of the year corresponding to the date.<br>
<tt><b>date_get_minute_of_year(date)</b></tt>
Returns the minute of the year corresponding to the date.<br>
<tt><b>date_get_second_of_year(date)</b></tt>
Returns the second of the year corresponding to the date.<br>
<tt><b>date_year_span(date1,date2)</b></tt>
Returns the number of years between the two dates.
It reports incomplete years as a fraction. <br>
<tt><b>date_month_span(date1,date2)</b></tt>
Returns the number of months between the two dates.
It reports incomplete months as a fraction. <br>
<tt><b>date_week_span(date1,date2)</b></tt>
Returns the number of weeks between the two dates.
It reports incomplete weeks as a fraction. <br>
<tt><b>date_day_span(date1,date2)</b></tt>
Returns the number of days between the two dates.
It reports incomplete days as a fraction. <br>
<tt><b>date_hour_span(date1,date2)</b></tt>
Returns the number of hours between the two dates.
It reports incomplete hours as a fraction. <br>
<tt><b>date_minute_span(date1,date2)</b></tt>
Returns the number of minutes between the two dates.
It reports incomplete minutes as a fraction. <br>
<tt><b>date_second_span(date1,date2)</b></tt>
Returns the number of seconds between the two dates.
It reports incomplete seconds as a fraction. <br>
<tt><b>date_compare_datetime(date1,date2)</b></tt>
Compares the two date-time values. Returns -1, 0, or 1 depending on whether the first is
smaller, equal, or larger than the second value. <br>
<tt><b>date_compare_date(date1,date2)</b></tt>
Compares the two date-time values only taking the date part into account.
Returns -1, 0, or 1 depending on whether the first is smaller, equal, or
larger than the second value. <br>
<tt><b>date_compare_time(date1,date2)</b></tt>
Compares the two date-time values only taking the time part into account.
Returns -1, 0, or 1 depending on whether the first is smaller, equal, or
larger than the second value. <br>
<tt><b>date_date_of(date)</b></tt>
Returns the date part of the indicated date-time value,
setting the time part to 0.<br>
<tt><b>date_time_of(date)</b></tt>
Returns the time part of the indicated date-time value,
setting the date part to 0.<br>
<tt><b>date_datetime_string(date)</b></tt>
Returns a string indicating the given date and time in the
default format for the system.<br>
<tt><b>date_date_string(date)</b></tt>
Returns a string indicating the given date in the default format
for the system.<br>
<tt><b>date_time_string(date)</b></tt>
Returns a string indicating the given time in the default format
for the system.<br>
<tt><b>date_days_in_month(date)</b></tt>
Returns the number of days in the month indicated by the date-time value.<br>
<tt><b>date_days_in_year(date)</b></tt>
Returns the number of days in the year indicated by the date-time value.<br>
<tt><b>date_leap_year(date)</b></tt>
Returns whether the year indicated by the date-time value is a leap year.<br>
<tt><b>date_is_today(date)</b></tt>
Returns whether the indicated date-time value is on today.<br>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
date functions
time functions
date_current_datetime()
date_current_date()
date_current_time()
date_create_datetime()
date_create_date()
date_create_time()
date_valid_datetime()
date_valid_date()
date_valid_time()
date_inc_year()
date_inc_month()
date_inc_week()
date_inc_day()
date_inc_hour()
date_inc_minute()
date_inc_second()
date_get_year()
date_get_month()
date_get_week()
date_get_day()
date_get_hour()
date_get_minute()
date_get_second()
date_get_weekday()
date_get_day_of_year()
date_get_hour_of_year()
date_get_minute_of_year()
date_get_second_of_year()
date_year_span()
date_month_span()
date_week_span()
date_day_span()
date_hour_span()
date_minute_span()
date_second_span()
date_compare_datetime()
date_compare_date()
date_compare_time()
date_date_of()
date_time_of()
date_datetime_string()
date_date_string()
date_time_string()
date_days_in_month()
date_days_in_year()
date_leap_year()
date_is_today()
-->

View File

@ -1,47 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Game play</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h1>Game play</h1>
There are a large number of variables and functions that you can use to define the game play.
These in particular influence the movement and creation of instances, the timing,
the room, and the handling of events.
<P>
Information on game play can be found in the following pages:
<P>
<p>
<blockquote>
<a href="403_01_moving.html">Moving Around</a><br>
<a href="403_02_paths.html">Paths</a><br>
<a href="403_03_planning.html">Motion Planning</a><br>
<a href="403_04_collision.html">Collision Detection</a><br>
<a href="403_05_instances.html">Instances</a><br>
<a href="403_06_deactive.html">Deactivating Instances</a><br>
<a href="403_07_timing.html">Timing</a><br>
<a href="403_08_rooms.html">Rooms</a><br>
<a href="403_09_score.html">Score</a><br>
<a href="403_10_events.html">Generating Events</a><br>
<a href="403_11_misc.html">Miscellaneous Variables and Functions</a><br>
</blockquote>
<!--ENDHELPONLY-->
<!--END-->
</body>
</html>

View File

@ -1,189 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Moving around</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Moving around</h3>
Obviously, an important aspect of games is the moving around of object instances.
Each instance has two built-in variables x and y that indicate the position of the
instance. (To be precise, they indicate the place where the origin of the sprite is
placed. Position (0,0) is the top-left corner of the room. You can change the
position of the instance by changing its x and y variables. If you want the
object to make complicated motions this is the way to go. You typically put
this code in the step event for the object.
<p>
If the object moves with constant speed and direction, there is an easier
way to do this. Each object instance has a horizontal speed (<tt>hspeed</tt>)
and a vertical speed (<tt>vspeed</tt>). Both are indicated in pixels per step.
A positive horizontal speed means a motion to the right, a negative horizontal
speed mean a motion to the left. Positive vertical speed is downwards and
negative vertical speed is upwards. So you have to set these variables only
once (for example in the creating event) to give the object instance a constant motion.
<p>
There is quite a different way for specifying motion, using a direction
(in degrees 0-359), and a speed (should be non-negative). You can set
and read these variables to specify an arbitrary motion. (Internally this
is changed into values for <tt>hspeed</tt> and <tt>vspeed</tt>.) Also
there is the friction and the gravity and gravity direction. Finally,
there is the function <tt>motion_add(dir,speed)</tt> to add a motion to
the current one.
<p>
To be complete, each instance has the following variables and functions dealing with
its position and motion:
<p>
<blockquote>
<tt><b>x</b></tt>
Its x-position.<br>
<tt><b>y</b></tt>
Its y-position.<br>
<tt><b>xprevious</b></tt>
Its previous x-position.<br>
<tt><b>yprevious</b></tt>
Its previous y-position.<br>
<tt><b>xstart</b></tt>
Its starting x-position in the room.<br>
<tt><b>ystart</b></tt>
Its starting y-position in the room.<br>
<tt><b>hspeed</b></tt>
Horizontal component of the speed.<br>
<tt><b>vspeed</b></tt>
Vertical component of the speed.<br>
<tt><b>direction</b></tt>
Its current direction (0-360, counter-clockwise, 0 = to the right).<br>
<tt><b>speed</b></tt>
Its current speed (pixels per step).<br>
<tt><b>friction</b></tt>
Current friction (pixels per step).<br>
<tt><b>gravity</b></tt>
Current amount of gravity (pixels per step).<br>
<tt><b>gravity_direction</b></tt>
Direction of gravity (270 is downwards).<br>
<tt><b>motion_set(dir,speed)</b></tt>
Sets the motion with the given speed in direction dir.<br>
<tt><b>motion_add(dir,speed)</b></tt>
Adds the motion to the current motion (as a vector addition).<br>
</blockquote>
<p>
There are a large number of functions available that help you in defining your motions:
<p>
<blockquote>
<tt><b>place_free(x,y)</b></tt>
Returns whether the instance placed at position(x,y) is collision-free.
This is typically used as a check before actually moving to the new position.<br>
<tt><b>place_empty(x,y)</b></tt>
Returns whether the instance placed at position (x,y) meets nobody.
So this function takes also non-solid instances into account.<br>
<tt><b>place_meeting(x,y,obj)</b></tt>
Returns whether the instance placed at position (x,y) meets obj.
obj can be an object in which case the function returns true is some
instance of that object is met. It can also be an instance id, the
special word all meaning an instance of any object, or the special word other.<br>
<tt><b>place_snapped(hsnap,vsnap)</b></tt>
Returns whether the instance is aligned with the snapping values.<br>
<tt><b>move_random(hsnap,vsnap)</b></tt>
Moves the instance to a free random, snapped position, like the corresponding action.<br>
<tt><b>move_snap(hsnap,vsnap)</b></tt>
Snaps the instance, like the corresponding action.<br>
<tt><b>move_wrap(hor,vert,margin)</b></tt>
Wraps the instance when it has left the room to the other side. <tt>hor</tt>
indicates whether to wrap horizontaly and <tt>vert</tt> indicates whether
to wrap vertically. <tt>margin</tt> indicates how far the origin of the
instance must be outside the room before the wrap happens. So it is a
margin around the room. You typically use this function in the Outside
event.<br>
<tt><b>move_towards_point(x,y,sp)</b></tt>
Moves the instances with speed sp toward position (x,y).<br>
<tt><b>move_bounce_solid(adv)</b></tt>
Bounces against solid instances, like the corresponding action. adv
indicates whether to use advance bounce, that also takes slanted walls into account.<br>
<tt><b>move_bounce_all(adv)</b></tt>
Bounces against all instances, instead of just the solid ones.<br>
<tt><b>move_contact_solid(dir,maxdist)</b></tt>
Moves the instance in the direction until a contact position with a solid
object is reached. If there is no collision at the current position, the
instance is placed just before a collision occurs. If there already is a
collision the instance is not moved. You can specify the maximal distance
to move (use a negative number for an arbitrary distance).<br>
<tt><b>move_contact_all(dir,maxdist)</b></tt>
Same as the previous function but this time you stop at a contact with
any object, not just solid objects.<br>
<tt><b>move_outside_solid(dir,maxdist)</b></tt>
Moves the instance in the direction until it no longer lies within a solid object.
If there is no collision at the current position the instance is not moved.
You can specify the maximal distance to move (use a negative number for an
arbitrary distance).<br>
<tt><b>move_outside_all(dir,maxdist)</b></tt>
Same as the previous function but this time you move until outside any object,
not just solid objects.<br>
<tt><b>distance_to_point(x,y)</b></tt>
Returns the distance of the bounding box of the current instance to (x,y). (If the instance
does not have a sprite or mask, the result of the function is undefined.)<br>
<tt><b>distance_to_object(obj)</b></tt>
Returns the distance of the instance to the nearest instance of object obj. (If the instance
or object does not have a sprite or mask, the result of the function is undefined.)<br>
<tt><b>position_empty(x,y)</b></tt>
Returns whether there is nothing at position (x,y).<br>
<tt><b>position_meeting(x,y,obj)</b></tt>
Returns whether at position (x,y) there is an instance obj. obj can be an object, an instance
id, or the keywords <tt>self</tt>, <tt>other</tt>, or <tt>all</tt>.<br>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
motion
distance
moving
instance variables
positions
x
y
xprevious
yprevious
xstart
ystart
hspeed
vspeed
direction
speed
friction
gravity
gravity_direction
motion_set()
motion_add()
place_free()
place_empty()
place_meeting()
place_snapped()
move_random()
move_snap()
move_wrap()
move_towards_point()
move_contact_solid()
move_contact_all()
move_outside_solid()
move_outside_all()
move_bounce_solid()
move_bounce_all()
distance_to_point()
distance_to_object()
position_empty()
position_meeting()
-->

View File

@ -1,81 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Paths</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Paths</h3>
In <I>Game Maker</I> you can define paths and order instances to follow such paths.
Although you can use actions for this, there are functions and variables that give
you more flexibility:
<p>
<blockquote>
<tt><b>path_start(path,speed,endaction,absolute)</b></tt>
Starts a path for the current instance. The <TT>path</TT> is the name of the path you
want to start. The <TT>speed</TT> is the speed with which the path must be followed.
A negative speed means that the instance moves backwards along the path. The
<TT>endaction</TT> indicates what should happen when the end of the path
is reached. The following values can be used:
<p>
<blockquote>
0 : stop the path<br>
1: continue from the start position (if the path is not closed we jump to the start position<br>
2: continue from the current position<br>
3: reverse the path, that is change the sign of the speed<br>
</blockquote>
The argument <TT>absolute</TT> should be true or false. When true the absolute
coordinates of the path are used. When false the path is relative to the current
position of the instance. To be more precise, if the speed is positive, the start
point of the path will be placed on the current position and the path is followed
from there. When the speed is negative the end point of the path will be placed
on the current position and the path is followed backwards from there.<br>
<tt><b>path_end()</b></tt>
Ends the following of a path for the current instance.<br>
<tt><b>path_index*</b></tt>
Index of the current path the instance follows. You cannot change this
directly but must use the function above.<br>
<tt><b>path_position</b></tt>
Position in the current path. 0 is the beginning of the path. 1 is the end of
the path. The value must lie between 0 and 1.<br>
<tt><b>path_positionprevious</b></tt>
Previous position in the current path. This can be used e.g. in collision events
to set the position on the path back to the previous position.<br>
<tt><b>path_speed</b></tt>
Speed (in pixels per step) with which the path must be followed. Use a
negative speed to move backwards.<br>
<tt><b>path_orientation</b></tt>
Orientation (counter-clockwise) into which the path is performed. 0 is
the normal orientation of the path.<br>
<tt><b>path_scale</b></tt>
Scale of the path. Increase to make the path larger. 1 is the default value.<br>
<tt><b>path_endaction</b></tt>
The action that must be performed at the end of the path. You
can use the values indicated above.<br>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
path functions
path_start()
path_end()
path_index
path_position
path_positionprevious
path_speed
path_scale
path_orientation
path_endaction
-->

View File

@ -1,242 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Motion planning</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Motion planning</h3>
Motion planning helps you to move certain instances from a given location
to a different location while avoiding collisions with certain other instances
(e.g. walls). Motion planning is a difficult problem. It is impossible to
give general functions that will work properly in all situations. Also,
computing collision free motions is a time-consuming operation. So you have
be careful how and when you apply it. Please keep these remarks in mind when
you use any of the following functions.
<P>
Different forms of motion planning are provided by <I>Game Maker</I>.
The simplest form lets an instance take a step towards a particular goal
position, trying to go straight if possible but taking a different direction
if required. These functions should be used in the step event of an instance.
They correspond to the motion planning actions that are also available:
<p>
<blockquote>
<tt><b>mp_linear_step(x,y,stepsize,checkall)</b></tt>
This function lets the instance take a step straight towards the indicated
position (x,y). The size of the step is indicated by the <TT>stepsize</TT>.
If the instance is already at the position it will not move any further.
If <TT>checkall</TT> is true the instance will stop when it hits an instance
of any object. If it is false it only stops when hitting a solid instance.
Note that this function does not try to make detours if it meets an obstacle.
It simply fails in that case. The function returns whether or not the goal position
was reached.<br>
<tt><b>mp_linear_step_object(x,y,stepsize,obj)</b></tt>
Same as the function above but this time only instances of <tt>obj</tt> are
considered as obstacles. <tt>obj</tt> can be an object or an instance id.<br>
<tt><b>mp_potential_step(x,y,stepsize,checkall)</b></tt>
Like the previous function, this function lets the instance take a step towards
a particular position. But in this case it tries to avoid obstacles. When the
instance would run into a solid instance (or any instance when checkall is true)
it will change the direction of motion to try to avoid the instance and move
around it. The approach is not guaranteed to work but in most easy cases it
will effectively move the instance towards the goal. The function returns
whether or not the goal was reached.<br>
<tt><b>mp_potential_step_object(x,y,stepsize,obj)</b></tt>
Same as the function above but this time only instances of <tt>obj</tt> are
considered as obstacles. <tt>obj</tt> can be an object or an instance id.<br>
<tt><b>mp_potential_settings(maxrot,rotstep,ahead,onspot)</b></tt>
The previous function does its work using a number of parameters that can
be changed using this function. Globally the method works as follows. It
first tries to move straight towards the goal. It looks a number of steps
ahead which can be set with the parameter <TT>ahead</TT> (default 3).
Reducing this value means that the instance will start changing direction
later. Increasing it means it will start changing direction earlier. If
this check leads to a collision it starts looking at directions more to
the left and to the right of the best direction. It does this in steps of
size <TT>rotstep</TT> (default 10). Reducing this gives the instance more
movement possibilities but will be slower. The parameter <TT>maxrot</TT>
is a bit more difficult to explain. The instance has a current direction.
<TT>maxrot</TT> (default 30) indicates how much it is allowed to change its
current direction in a step. So even if it can move e.g. straight to the goal
it will only do so if it does not violate this maximal change of direction.
If you make <TT>maxrot</TT> large the instance can change a lot in each step.
This will make it easier to find a short path but the path will be uglier.
If you make the value smaller the path will be smoother but it might take
longer detours (and sometimes even fail to find the goal). When no step can
be made the behavior depends on the value of the parameter <TT>onspot</TT>.
If <TT>onspot</TT> is true (the default value), the instance will rotate on
its spot by the amount indicated with <TT>maxrot</TT>. If it is false it
will not move at all. Setting it to false is useful for e.g. cars but reduces
the chance of finding a path.<br>
</blockquote>
<p>
Please note that the potential approach uses only local information. So it will only
find a path if this local information is enough to determine the right direction of
motion. For example, it will fail to find a path out of a maze (most of the time).
<P>
The second kind of functions computes a collision-free path for the instance.
Once this path has been computed you can assign it to the instance to move
towards the goal. The computation of the path will take some time but after
that the execution of the path will be fast. Of course this is only valid if
the situation has not changed in the meantime. For example, if obstacles
change you possibly will need to recompute the path. Again notice that these functions
might fail.
<B><I>These functions are only available in the Pro Edition of Game Maker.</I></B>
<P>
The first two functions use the linear motion and potential field approach that
were also used for the step functions.
<p>
<blockquote>
<tt><b>mp_linear_path(path,xg,yg,stepsize,checkall)</b></tt>
This function computes a straight-line path for the instance from its
current position to the position (xg,yg) using the indicated step size.
It uses steps as in the function <TT>mp_linear_step()</TT>. The indicated
path must already exist and will be overwritten by the new path. (See a
later chapter on how to create and destroy paths.) The function will
return whether a path was found. The function will stop and report failure
if no straight path exists between start and goal. If it fails a
path is still created that runs till the position where the instance was blocked.<br>
<tt><b>mp_linear_path_object(path,xg,yg,stepsize,obj)</b></tt>
Same as the function above but this time only instances of <tt>obj</tt> are
considered as obstacles. <tt>obj</tt> can be an object or an instance id.<br>
<tt><b>mp_potential_path(path,xg,yg,stepsize,factor,checkall)</b></tt>
This function computes a path for the instance from its current position
and orientation to the position (xg,yg) using the indicated step size
trying to avoid collision with obstacles. It uses potential field steps,
like in the function <TT>mp_potential_step()</TT> and also the parameters
that can be set with <TT>mp_potential_settings()</TT>. The indicated path
must already exist and will be overwritten by the new path. (See a later
chapter on how to create and destroy paths.) The function will return
whether a path was found. To avoid the function continuing to compute
forever you need to provide a length factor larger than 1. The function
will stop and report failure if it cannot find a path shorter than this
factor times the distance between start and goal. A factor of 4 is normally
good enough but if you expect long detours you might make it longer. If
it fails a path is still created that runs in the direction of the goal
but it will not reach it.<br>
<tt><b>mp_potential_path_object(path,xg,yg,stepsize,factor,obj)</b></tt>
Same as the function above but this time only instances of <tt>obj</tt> are
considered as obstacles. <tt>obj</tt> can be an object or an instance id.<br>
</blockquote>
<p>
The other functions use a much more complex mechanism using a grid-based
approach (sometimes called an A* algorithm). It will be more successful
in finding paths (although it still might fail) and will find shorter paths
but it required more work on your side. The global idea is as follows.
First of all we put a grid on (the relevant part of) the room. You can
choose to use a fine grid (which will be slower) or a coarse grid. Next,
for all relevant objects we determine the grid cells they overlap (either
using bounding boxes or precise checking) and mark these cells as being
forbidden. So a cell will be marked totally forbidden, even if it only
partially overlaps with an obstacle. Finally we specify a start and a goal
position (which must lie in free cells) and the function computes the
shortest path (actually close to the shortest) between these. The path
will run between centers of free cells. So if the cells are large enough
so that the instance placed at its center will lie completely inside
it this will be successful. This path you can now give to an instance
to follow.
<P>
The grid-based approach is very powerful (and is used in many professional
games) but it requires that you do some careful thinking. You must determine
which area and cell size are good enough for solving the game. Also you must
determine which objects must be avoided and whether precise checking is
important. All these parameters strongly influence the efficiency of the approach.
<P>
In particular the size of the cells is crucial. Remember that the cells
must be large enough so that the moving object placed with its origin
on the center of a cell must lie completely inside the cell. (Be careful
about the position of the origin of the object. Also realize that you can
shift the path if the origin of the object is not in its center!) On the
other hand, the smaller the cells the more possible paths exist. If you
make cells too large, openings between obstacles may get closed because
all cells intersect an obstacle.
<p>
The actual functions for the grid-based approach are as follows:
<p>
<blockquote>
<tt><b>mp_grid_create(left,top,hcells,vcells,cellwidth,cellheight)</b></tt>
This function creates the grid. It returns an index that must be used in
all other calls. You can create and maintain multiple grid structures at
the same moment. left and top indicate the position of the top-left corner
of the grid. hcells and vcells indicate the number of horizontal and vertical
cells. Finally cellwidth and cellheight indicate the size of the cells.<br>
<tt><b>mp_grid_destroy(id)</b></tt>
Destroys the indicated grid structure and frees its memory. Don't forget to
call this if you don't need the structure anymore.<br>
<tt><b>mp_grid_clear_all(id)</b></tt>
Mark all cells in the grid to be free.<br>
<tt><b>mp_grid_clear_cell(id,h,v)</b></tt>
Clears the indicated cell. Cell 0,0 is the top left cell.<br>
<tt><b>mp_grid_clear_rectangle(id,left,top,right,bottom)</b></tt>
Clears all cells that intersect the indicated rectangle (in room coordinates).<br>
<tt><b>mp_grid_add_cell(id,h,v)</b></tt>
Marks the indicated cell as being forbidden. Cell 0,0 is the top left cell.<br>
<tt><b>mp_grid_add_rectangle(id,left,top,right,bottom)</b></tt>
Marks all cells that intersect the indicated rectangle as being forbidden.<br>
<tt><b>mp_grid_add_instances(id,obj,prec)</b></tt>
Marks all cells that intersect an instance of the indicated object as
being forbidden. You can also use an individual instance by making obj
the id of the instance. Also you can use the keyword <TT><B>all</b></tt>
to indicate all instances of all objects. prec indicates whether precise
collision checking must be used (will only work if precise checking is
enabled for the sprite used by the instance).<br>
<tt><b>mp_grid_path(id,path,xstart,ystart,xgoal,ygoal,allowdiag)</b></tt>
Computes a path through the grid. path must indicate an existing path that
will be replaced by the computer path. xstart and ystart indicate the start
of the path and xgoal and ygoal the goal. allowdiag indicates whether
diagonal moves are allowed instead of just horizontal or vertical. The
function returns whether it succeeded in finding a path. (Note that the
path is independent of the current instance; It is a path through the g
rid, not a path for a specific instance.) <br>
<tt><b>mp_grid_draw(id)</b></tt>
This function draws the grid with green cells being free and red cells being
forbidden. This function is slow and only provided as a debug tool.<br>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
motion planning
potential fields
A* algorithm
finding paths
mp_linear_step()
mp_potential_step()
mp_linear_step_object()
mp_potential_step_object()
mp_potential_settings()
mp_linear_path()
mp_potential_path()
mp_linear_path_object()
mp_potential_path_object()
mp_grid_create()
mp_grid_destroy()
mp_grid_clear_all()
mp_grid_clear_cell()
mp_grid_clear_rectangle()
mp_grid_add_cell()
mp_grid_add_rectangle()
mp_grid_add_instances()
mp_grid_path()
mp_grid_draw()
-->

View File

@ -1,62 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Collision checking</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Collision checking</h3>
When planning motions or deciding on certain actions, it is often important
to see whether there are collisions with other objects at certain places. The
following routines can be used for this. All these have three arguments in
common: The argument <TT>obj</TT> can be an object, the keyword <TT><B>all</b></tt>,
or the id of an instance. The argument <TT>prec</TT> indicates whether
the check should be precise or only based on the bounding box of the instance.
Precise checking is only done when the sprite for the instance has the
precise collision checking set. The argument <TT>notme</TT> can be set
to true to indicate that the calling instance should not be checked.
All these functions return either the id of one of the instances that
collide, or they return a negative value when there is no collision.
<p>
<blockquote>
<tt><b>collision_point(x,y,obj,prec,notme)</b></tt>
This function tests whether at point (x,y) there is a collision
with entities of object obj. <br>
<tt><b>collision_rectangle(x1,y1,x2,y2,obj,prec,notme)</b></tt>
This function tests whether there is a collision between the (filled)
rectangle with the indicated opposite corners and entities of object obj.
For example, you can use this to test whether an area is free of obstacles.<br>
<tt><b>collision_circle(xc,yc,radius,obj,prec,notme)</b></tt>
This function tests whether there is a collision between the (filled)
circle centered at position (xc,yc) with the given radius and entities
of object obj. For example, you can use this to test whether there is
an object close to a particular location.<br>
<tt><b>collision_ellipse(x1,y1,x2,y2,obj,prec,notme)</b></tt>
This function tests whether there is a collision between the (filled)
ellipse with the indicated opposite corners and entities of object obj. <br>
<tt><b>collision_line(x1,y1,x2,y2,obj,prec,notme)</b></tt>
This function tests whether there is a collision between the line segment
from (x1,y1) to (x2,y2) and entities of object obj. This is a powerful
function. You can e.g. use it to test whether an instance can see another
instance by checking whether the line segment between them intersects a wall.<br>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
collision checking
collision_point()
collision_rectangle()
collision_circle()
collision_ellipse()
collision_line()
-->

View File

@ -1,188 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Instances</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Instances</h3>
In the game, the basic units are the instances of the different objects. During
game play you can change a number of aspects of these instances. Also you can
create new instances and destroy instances. Besides the movement related
variables discussed above and the drawing related variables discussed below,
each instance has the following variables:
<p>
<blockquote>
<tt><b>object_index*</b></tt>
Index of the object this is an instance of. This variable cannot be changed.<br>
<tt><b>id*</b></tt>
The unique identifier for the instance (&gt;= 100000). (Note that
when defining rooms the id of the instance under the mouse is always indicated.)<br>
<tt><b>mask_index</b></tt>
Index of the sprite used as mask for collisions. Give this a value
of -1 to make it the same as the sprite_index.<br>
<tt><b>solid</b></tt>
Whether the instance is solid. This can be changed during the game.<br>
<tt><b>persistent</b></tt>
Whether the instance is persistent and will reappear when moving
to another room. You often want to switch persistence off at certain
moments. (For example if you go back to the first room.)<br>
</blockquote>
<p>
There is one problem when dealing with instances. It is not so easy to identify
individual instances. They don't have a name. When there is only one instance
of a particular object you can use the object name but otherwise you need to
get the id of the instance. This is a unique identifier for the instance. you
can use it in <b>with</b> statements and as object identifier. Fortunately
there are a number of variables and routines that help you locate instance id's.
<p>
<blockquote>
<tt><b>instance_count*</b></tt>
Number of instances that currently exist in the room.<br>
<tt><b>instance_id[0..n-1]*</b></tt>
The id of the particular instance. Here n is the number of instance.
</blockquote>
<p>
Note that the assignment of the instances to the instance id's changes every
step so you cannot use values from previous steps. Also please note that instances
that are deleted will remain in the list until the end of the step. So if you
are also deleting instances you need to check whether the instance still exists.
Let me give an example. Assume each unit in your game has a particular power
and you want to locate the strongest one, you could use the following code:
<p>
<blockquote>
<pre>
{
maxid = -1;
maxpower = 0;
<b>for</b> (i=0; i&lt;instance_count; i+=1)
{
iii = instance_id[i];
<b>if</b> (instance_exists(iii))
<b>if</b> (iii.object_index == unit)
{
<b>if</b> (iii.power &gt; maxpower)
{maxid = iii; maxpower = iii.power;}
}
}
}
</pre>
</blockquote>
<p>
After the loop maxid will contain the id of the unit with largest power. Of course, for this particular
situation the following code would be better:
<p>
<blockquote>
<pre>
{
maxid = -1;
maxpower = 0;
<b>with</b> (unit) <b>do</b>
{
<b>if</b> (power &gt; maxpower)
{maxid = self; maxpower = power;}
}
}
</pre>
</blockquote>
<p>
<blockquote>
<tt><b>instance_find(obj,n)</b></tt>
Returns the id of the (n+1)'th instance of type obj. obj can be an object
or the keyword all. If it does not exist, the special object noone is
returned. Note that the assignment of the instances to the instance id's
changes every step so you cannot use values from previous steps.<br>
<tt><b>instance_exists(obj)</b></tt>
Returns whether an instance of type obj exists. obj can be an object,
an instance id, or the keyword all.<br>
<tt><b>instance_number(obj)</b></tt>
Returns the number of instances of type obj. obj can be an object or
the keyword all.<br>
<tt><b>instance_position(x,y,obj)</b></tt>
Returns the id of the instance of type obj at position (x,y). When
multiple instances are at that position the first is returned. obj can
be an object or the keyword all. If it does not exist, the special object
noone is returned.<br>
<tt><b>instance_nearest(x,y,obj)</b></tt>
Returns the id of the instance of type obj nearest to (x,y). obj can be an
object or the keyword all.<br>
<tt><b>instance_furthest(x,y,obj)</b></tt>
Returns the id of the instance of type obj furthest away from (x,y). obj can
be an object or the keyword all.<br>
<tt><b>instance_place(x,y,obj)</b></tt>
Returns the id of the instance of type obj met when the current instance is
placed at position (x,y). obj can be an object or the keyword all. If it
does not exist, the special object noone is returned.<br>
</blockquote>
<p>
The following functions can be used for creating and destroying instances.
<p>
<blockquote>
<tt><b>instance_create(x,y,obj)</b></tt>
Creates an instance of obj at position (x,y). The function returns
the id of the new instance.<br>
<tt><b>instance_copy(performevent)</b></tt>
Creates a copy of the current instance. The argument indicates whether
the creation event must be executed for the copy. The function returns
the id of the new copy.<br>
<tt><b>instance_destroy()</b></tt>
Destroys the current instance.<br>
<tt><b>instance_change(obj,perf)</b></tt>
Changes the instance into obj. perf indicates whether to perform the
destroy and creation events.<br>
<tt><b>position_destroy(x,y)</b></tt>
Destroys all instances whose sprite contains position (x,y).<br>
<tt><b>position_change(x,y,obj,perf)</b></tt>
Changes all instances at (x,y) into obj. perf indicates whether to
perform the destroy and creation events.<br>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
instances
finding instances
creating instances
destroying instances
instance id
object_index
id
solid
persistent
mask_index
instance_count
instance_id
instance_find()
instance_exists()
instance_number()
instance_position()
instance_nearest()
instance_furthest()
instance_place()
instance_create()
instance_copy()
instance_change()
instance_destroy()
position_destroy()
position_change()
-->

View File

@ -1,108 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Deactivating instances</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Deactivating instances</h3>
<b><i>Please be aware that deactivating and activating instances can sometimes lead to
unexpected problems. So you are strongly advised not to use this feature except for
very simple situation like the ones described below.
The feature is mainly left in for backward compatibility.</i></b>
<p>
When you create large room, for example in platform games, with a small view,
many instances lie outside the view. Such instances though are still active
and will execute their events. Also when performing collision checks
these instances are taken into account. This can cost a lot of time, which
is often not necessary. (For example, often it is not important whether
instances outside the view move.) To solve this problem <i>Game Maker</i>
contains some functions to deactivate and activate instances. Before using
them you must though clearly understand how they work.
<p>
When you deactivate instances they are in some sense removed from the game.
They are not visible anymore nor are any events executed for them. So for
all actions and functions they don't exist anymore. This saves a lot of time
but you have to be careful. For example, when you delete all instances of a
particular type, deactivated instances are not deleted (because they don't
exist). So don't think that a key a player picks up can unlock a deactivated door.
Also persistent deactivated instances are <b>not</b> moved over to the next room (even
though they are persistent). Also make sure that after you deactivate an instance that
you no longer execute code for it. This can in particular happen when an instance
deactivates itself. In general you better never have an instance deactivate itself.
<p>
The most crucial mistake you can make is to deactivate the instance that is
responsible for the activation. To avoid this some of the routines below allow
you to insist that the calling instance should not be deactivated itself.
<p>
Here are the available routines:
<p>
<blockquote>
<tt><b>instance_deactivate_all(notme)</b></tt>
Deactivates all instances in the room. If notme is true the calling instance
is not deactivated (which is normally what you want).<br>
<tt><b>instance_deactivate_object(obj)</b></tt>
Deactivates all instances in the room of the given object. You can also use all
to indicate that all instances must be deactivated or the id of an instance to
deactivate an individual instance.<br>
<tt><b>instance_deactivate_region(left,top,width,height,inside,notme)</b></tt>
Deactivates all instances in the indicated region (that is, those whose
bounding box lies partially inside the region). If inside is false the
instances completely outside the region are deactivated. If notme is
true the calling instance is not deactivated (which is normally what you want).<br>
<tt><b>instance_activate_all()</b></tt>
Activates all instances in the room.<br>
<tt><b>instance_activate_object(obj)</b></tt>
Activates all instances in the room of the given object. You can also
use all to indicate that all instances must be activated or the id of
an instance to activate an individual instance.<br>
<tt><b>instance_activate_region(left,top,width,height,inside)</b></tt>
Activates all instances in the indicated region. If inside is false the
instances completely outside the region are activated.<br>
</blockquote>
<p>
For example, to deactivate all instances outside the view and activate the ones
inside the view, you could place the following code in the step event of the moving
character:
<p>
<blockquote>
<pre>
{
instance_activate_all();
instance_deactivate_region(view_xview[0],view_yview[0],
view_wview[0],view_hview[0],false,true);
}
</pre>
</blockquote>
<p>
In practice you might want to use a region slightly larger than the view.
<!--END-->
</body>
</html>
<!-- KEYWORDS
activating instances
deactivating instances
instance_deactivate_all()
instance_deactivate_object()
instance_deactivate_region()
instance_activate_all()
instance_activate_object()
instance_activate_region()
-->

View File

@ -1,127 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Timing</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Timing</h3>
Good games require careful timing of things happening. Fortunately
<i>Game Maker</i> does most of the timing for you. It makes sure things
happen at a constant rate. This rate is defined when defining the rooms.
But you can change it using the global variable room_speed. So for example,
you can slowly increase the speed of the game, making it more difficult,
by adding a very small amount (like 0.001) to room_speed in every step.
If your machine is slow the game speed might not be achieved. This can be
checked using the variable fps that constantly monitors the actual number
of frames per second. Finally, for some advanced timing you can use the
variable current_time that gives the number of milliseconds since the
computer was started. Here is the total collection of variables available
(only the first one can be changed):
<p>
<blockquote>
<tt><b>room_speed</b></tt>
Speed of the game in the current room (in steps per second).<br>
<tt><b>fps*</b></tt>
Number of frames that are actually drawn per second.<br>
<tt><b>current_time*</b></tt>
Number of milliseconds that have passed since the system was started.<br>
<tt><b>current_year*</b></tt>
The current year.<br>
<tt><b>current_month*</b></tt>
The current month.<br>
<tt><b>current_day*</b></tt>
The current day.<br>
<tt><b>current_weekday*</b></tt>
The current day of the week (1=sunday, ..., 7=saturday).<br>
<tt><b>current_hour*</b></tt>
The current hour.<br>
<tt><b>current_minute*</b></tt>
The current minute.<br>
<tt><b>current_second*</b></tt>
The current second.<br>
</blockquote>
<p>
Sometimes you might want to stop the game for a short while. For this, use the sleep function.
<p>
<blockquote>
<tt><b>sleep(numb)</b></tt>
Sleeps numb milliseconds.<br>
</blockquote>
<p>
As you should know, every instance has 12 different alarm clocks that you can
set. To change the values (or get the values) of the different alarm clocks
use the following variable:
<p>
<blockquote>
<tt><b>alarm[0..11]</b></tt>
Value of the indicated alarm clock. (Note that alarm clocks only get
updated when the alarm event for the object contains actions!)<br>
</blockquote>
<p>
We have seen that for complex timing issues you can use the time line resource.
Each instance can have a time line resource associated with it. The following
variables deal with this:
<p>
<blockquote>
<tt><b>timeline_index</b></tt>
Index of the time line associated with the instance. You can set this
to a particular time line to use that one. Set it to -1 to stop using
a time line for the instance. Note that this does not start the time
line. For this use the variable <tt>timeline_running</tt>.<br>
<tt><b>timeline_position</b></tt>
Current position within the time line. You can change this to skip certain
parts or to repeat parts.<br>
<tt><b>timeline_speed</b></tt>
Normally, in each step the position in the time line is increased by 1.
You can change this amount by setting this variable to a different value.
You can use real numbers like 0.5. If the value is larger than one, several
moments can happen within the same time step. They will all be performed
in the correct order, so no actions will be skipped. You can also use a negative
value to let the time line play backwards.<br>
<tt><b>timeline_running</b></tt>
Indicates whether the time line is running (true) or paused or stopped (false).
You can change this variable to run or stop the time line.<br>
<tt><b>timeline_looping</b></tt>
Indicated whether the time line is looping (true) or not (false). You can change
this variable to switch looping on or off.
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
timing
frames per second
speed
room_speed
fps
current_time
current_year
current_month
current_day
current_weekday
current_hour
current_minute
current_second
sleep()
alarm[0..11]
timeline_index
timeline_position
timeline_speed
-->

Some files were not shown because too many files have changed in this diff Show More