Implemented actions widget and editing functionalities
This commit is contained in:
@ -9,9 +9,13 @@ QMAKE_CXXFLAGS += \
|
||||
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000
|
||||
|
||||
HEADERS += \
|
||||
codeeditorwidget.h \
|
||||
constantsmodel.h \
|
||||
dialogs/deletemomentsdialog.h \
|
||||
models/actionscontainermodel.h \
|
||||
widgets/actionscontainerwidget.h \
|
||||
widgets/codeeditorwidget.h \
|
||||
models/constantsmodel.h \
|
||||
dialogs/addeventdialog.h \
|
||||
dialogs/codeactiondialog.h \
|
||||
dialogs/codeeditordialog.h \
|
||||
dialogs/createspritedialog.h \
|
||||
dialogs/fontpropertiesdialog.h \
|
||||
@ -28,17 +32,16 @@ HEADERS += \
|
||||
dialogs/triggerconditiondialog.h \
|
||||
dialogs/triggersdialog.h \
|
||||
dialogs/userdefinedconstantsdialog.h \
|
||||
drawingcanvaswidget.h \
|
||||
widgets/drawingcanvaswidget.h \
|
||||
futurecpp.h \
|
||||
includedfilesmodel.h \
|
||||
models/includedfilesmodel.h \
|
||||
jshighlighter.h \
|
||||
mainwindow.h \
|
||||
objectactionsmodel.h \
|
||||
objecteventsmodel.h \
|
||||
pathpointsmodel.h \
|
||||
pathpointswidget.h \
|
||||
models/objecteventsmodel.h \
|
||||
models/pathpointsmodel.h \
|
||||
widgets/pathpointswidget.h \
|
||||
projectcontainer.h \
|
||||
projecttreemodel.h \
|
||||
models/projecttreemodel.h \
|
||||
dialogs/backgroundpropertiesdialog.h \
|
||||
dialogs/editspritedialog.h \
|
||||
dialogs/extensionpackagesdialog.h \
|
||||
@ -47,15 +50,18 @@ HEADERS += \
|
||||
dialogs/preferencesdialog.h \
|
||||
dialogs/soundpropertiesdialog.h \
|
||||
dialogs/spritepropertiesdialog.h \
|
||||
spritesmodel.h \
|
||||
timelineactionsmodel.h \
|
||||
timelinemomentsmodel.h \
|
||||
triggersmodel.h
|
||||
models/spritesmodel.h \
|
||||
models/timelinemomentsmodel.h \
|
||||
models/triggersmodel.h
|
||||
|
||||
SOURCES += main.cpp \
|
||||
codeeditorwidget.cpp \
|
||||
constantsmodel.cpp \
|
||||
dialogs/deletemomentsdialog.cpp \
|
||||
models/actionscontainermodel.cpp \
|
||||
widgets/actionscontainerwidget.cpp \
|
||||
widgets/codeeditorwidget.cpp \
|
||||
models/constantsmodel.cpp \
|
||||
dialogs/addeventdialog.cpp \
|
||||
dialogs/codeactiondialog.cpp \
|
||||
dialogs/codeeditordialog.cpp \
|
||||
dialogs/createspritedialog.cpp \
|
||||
dialogs/fontpropertiesdialog.cpp \
|
||||
@ -72,16 +78,15 @@ SOURCES += main.cpp \
|
||||
dialogs/triggerconditiondialog.cpp \
|
||||
dialogs/triggersdialog.cpp \
|
||||
dialogs/userdefinedconstantsdialog.cpp \
|
||||
drawingcanvaswidget.cpp \
|
||||
includedfilesmodel.cpp \
|
||||
widgets/drawingcanvaswidget.cpp \
|
||||
models/includedfilesmodel.cpp \
|
||||
jshighlighter.cpp \
|
||||
mainwindow.cpp \
|
||||
objectactionsmodel.cpp \
|
||||
objecteventsmodel.cpp \
|
||||
pathpointsmodel.cpp \
|
||||
pathpointswidget.cpp \
|
||||
models/objecteventsmodel.cpp \
|
||||
models/pathpointsmodel.cpp \
|
||||
widgets/pathpointswidget.cpp \
|
||||
projectcontainer.cpp \
|
||||
projecttreemodel.cpp \
|
||||
models/projecttreemodel.cpp \
|
||||
dialogs/backgroundpropertiesdialog.cpp \
|
||||
dialogs/editspritedialog.cpp \
|
||||
dialogs/extensionpackagesdialog.cpp \
|
||||
@ -90,15 +95,15 @@ SOURCES += main.cpp \
|
||||
dialogs/preferencesdialog.cpp \
|
||||
dialogs/soundpropertiesdialog.cpp \
|
||||
dialogs/spritepropertiesdialog.cpp \
|
||||
spritesmodel.cpp \
|
||||
timelineactionsmodel.cpp \
|
||||
timelinemomentsmodel.cpp \
|
||||
triggersmodel.cpp
|
||||
models/spritesmodel.cpp \
|
||||
models/timelinemomentsmodel.cpp \
|
||||
models/triggersmodel.cpp
|
||||
|
||||
FORMS += \
|
||||
dialogs/addeventdialog.ui \
|
||||
dialogs/codeeditordialog.ui \
|
||||
dialogs/createspritedialog.ui \
|
||||
dialogs/deletemomentsdialog.ui \
|
||||
dialogs/fontpropertiesdialog.ui \
|
||||
dialogs/imageeditordialog.ui \
|
||||
dialogs/includedfilesdialog.ui \
|
||||
@ -119,7 +124,8 @@ FORMS += \
|
||||
dialogs/globalgamesettingsdialog.ui \
|
||||
dialogs/preferencesdialog.ui \
|
||||
dialogs/soundpropertiesdialog.ui \
|
||||
dialogs/spritepropertiesdialog.ui
|
||||
dialogs/spritepropertiesdialog.ui \
|
||||
widgets/actionscontainerwidget.ui
|
||||
|
||||
RESOURCES += \
|
||||
resources.qrc
|
||||
|
@ -21,10 +21,12 @@ AddEventDialog::AddEventDialog(QWidget *parent) :
|
||||
|
||||
connect(m_ui->pushButtonCreate, &QAbstractButton::clicked,
|
||||
this, [this](){ m_eventType = Object::EventType::Create; accept(); });
|
||||
connect(m_ui->pushButtonStep, &QAbstractButton::clicked,
|
||||
this, [this](){ m_eventType = Object::EventType::Step; accept(); });
|
||||
connect(m_ui->pushButtonDestroy, &QAbstractButton::clicked,
|
||||
this, [this](){ m_eventType = Object::EventType::Destroy; accept(); });
|
||||
connect(m_ui->pushButtonDraw, &QAbstractButton::clicked,
|
||||
this, [this](){ m_eventType = Object::EventType::Draw; accept(); });
|
||||
connect(m_ui->pushButtonStep, &QAbstractButton::clicked,
|
||||
this, [this](){ m_eventType = Object::EventType::Step; accept(); });
|
||||
}
|
||||
|
||||
AddEventDialog::~AddEventDialog() = default;
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>265</width>
|
||||
<height>220</height>
|
||||
<height>221</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -21,6 +21,10 @@
|
||||
<property name="text">
|
||||
<string>Dra&w</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/qtgameengine/icons/event-draw.png</normaloff>:/qtgameengine/icons/event-draw.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "projectcontainer.h"
|
||||
#include "projecttreemodel.h"
|
||||
#include "models/projecttreemodel.h"
|
||||
#include "imageeditordialog.h"
|
||||
|
||||
BackgroundPropertiesDialog::BackgroundPropertiesDialog(Background &background, ProjectTreeModel &projectModel, QWidget *parent) :
|
||||
|
63
dialogs/codeactiondialog.cpp
Normal file
63
dialogs/codeactiondialog.cpp
Normal file
@ -0,0 +1,63 @@
|
||||
#include "codeactiondialog.h"
|
||||
|
||||
#include <QRadioButton>
|
||||
#include <QLabel>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "projectcontainer.h"
|
||||
|
||||
CodeActionDialog::CodeActionDialog(Action &action, QWidget *parent) :
|
||||
CodeEditorDialog{tr("Execute Code"), parent},
|
||||
m_action{action},
|
||||
m_radioButtonSelf{new QRadioButton{tr("Self"), this}},
|
||||
m_radioButtonOther{new QRadioButton{tr("Other"), this}},
|
||||
m_radioButtonObject{new QRadioButton{tr("Object"), this}}
|
||||
{
|
||||
#ifdef Q_OS_LINUX
|
||||
setWindowFlags((windowFlags() & ~Qt::Dialog) | Qt::Window);
|
||||
#endif
|
||||
setWindowFlag(Qt::WindowCloseButtonHint);
|
||||
|
||||
addToolbarWidget(new QLabel{tr("Applies to:"), this});
|
||||
addToolbarWidget(m_radioButtonSelf);
|
||||
addToolbarWidget(m_radioButtonOther);
|
||||
addToolbarWidget(m_radioButtonObject);
|
||||
|
||||
m_radioButtonSelf->setChecked(m_action.appliesTo == Action::AppliesTo::Self);
|
||||
m_radioButtonOther->setChecked(m_action.appliesTo == Action::AppliesTo::Other);
|
||||
m_radioButtonObject->setChecked(m_action.appliesTo == Action::AppliesTo::Object);
|
||||
|
||||
setScript(m_action.script);
|
||||
|
||||
connect(m_radioButtonSelf, &QRadioButton::toggled,
|
||||
this, &CodeActionDialog::changed);
|
||||
connect(m_radioButtonOther, &QRadioButton::toggled,
|
||||
this, &CodeActionDialog::changed);
|
||||
connect(m_radioButtonObject, &QRadioButton::toggled,
|
||||
this, &CodeActionDialog::changed);
|
||||
}
|
||||
|
||||
void CodeActionDialog::accept()
|
||||
{
|
||||
if (!m_unsavedChanges)
|
||||
{
|
||||
QDialog::reject();
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_radioButtonSelf->isChecked())
|
||||
m_action.appliesTo = Action::AppliesTo::Self;
|
||||
else if (m_radioButtonOther->isChecked())
|
||||
m_action.appliesTo = Action::AppliesTo::Other;
|
||||
else if (m_radioButtonObject->isChecked())
|
||||
m_action.appliesTo = Action::AppliesTo::Object;
|
||||
else
|
||||
{
|
||||
QMessageBox::warning(this, tr("No Applies To selected!"), tr("No Applies To selected!"));
|
||||
return;
|
||||
}
|
||||
|
||||
m_action.script = script();
|
||||
|
||||
CodeEditorDialog::accept();
|
||||
}
|
23
dialogs/codeactiondialog.h
Normal file
23
dialogs/codeactiondialog.h
Normal file
@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include "codeeditordialog.h"
|
||||
|
||||
class QRadioButton;
|
||||
struct Action;
|
||||
|
||||
class CodeActionDialog : public CodeEditorDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CodeActionDialog(Action &action, QWidget *parent = nullptr);
|
||||
|
||||
void accept() override;
|
||||
|
||||
private:
|
||||
Action &m_action;
|
||||
|
||||
QRadioButton * const m_radioButtonSelf;
|
||||
QRadioButton * const m_radioButtonOther;
|
||||
QRadioButton * const m_radioButtonObject;
|
||||
};
|
@ -7,6 +7,8 @@
|
||||
#include <QTextBlock>
|
||||
#include <QMessageBox>
|
||||
#include <QSignalBlocker>
|
||||
#include <QFileDialog>
|
||||
#include <QFile>
|
||||
|
||||
#include "jshighlighter.h"
|
||||
|
||||
@ -77,7 +79,7 @@ void CodeEditorDialog::reject()
|
||||
tr("Do you want to save your changes?"),
|
||||
QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel,
|
||||
QMessageBox::Save
|
||||
);
|
||||
);
|
||||
switch (result)
|
||||
{
|
||||
case QMessageBox::Save:
|
||||
@ -120,17 +122,45 @@ void CodeEditorDialog::addToolbarWidget(QWidget *widget)
|
||||
|
||||
void CodeEditorDialog::load()
|
||||
{
|
||||
const auto path = QFileDialog::getOpenFileName(this, tr("Load Code from a Text File..."));
|
||||
if (path.isEmpty())
|
||||
return;
|
||||
|
||||
QFile file{path};
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Could not open file!"), tr("Could not open file!") + "\n\n" + file.errorString());
|
||||
return;
|
||||
}
|
||||
|
||||
m_ui->codeEdit->setPlainText(QString::fromUtf8(file.readAll()));
|
||||
}
|
||||
|
||||
void CodeEditorDialog::save()
|
||||
{
|
||||
const auto path = QFileDialog::getSaveFileName(this, tr("Save Code to a Text File..."));
|
||||
if (path.isEmpty())
|
||||
return;
|
||||
|
||||
QFile file{path};
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Could not open file!"), tr("Could not open file!") + "\n\n" + file.errorString());
|
||||
return;
|
||||
}
|
||||
|
||||
auto asUtf8 = script().toUtf8();
|
||||
const auto size = asUtf8.size();
|
||||
if (const auto written = file.write(std::move(asUtf8)); written != size)
|
||||
{
|
||||
QMessageBox::warning(this, tr("Could not write file!"), tr("Could not write file!") + "\n\n" + tr("written(%0) != size(%1)") + "\n\n" + file.errorString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void CodeEditorDialog::print()
|
||||
{
|
||||
|
||||
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||
}
|
||||
|
||||
void CodeEditorDialog::updatePosition()
|
||||
|
@ -384,7 +384,7 @@
|
||||
<customwidget>
|
||||
<class>CodeEditorWidget</class>
|
||||
<extends>QPlainTextEdit</extends>
|
||||
<header>codeeditorwidget.h</header>
|
||||
<header>widgets/codeeditorwidget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
|
44
dialogs/deletemomentsdialog.cpp
Normal file
44
dialogs/deletemomentsdialog.cpp
Normal file
@ -0,0 +1,44 @@
|
||||
#include "deletemomentsdialog.h"
|
||||
#include "ui_deletemomentsdialog.h"
|
||||
|
||||
DeleteMomentsDialog::DeleteMomentsDialog(QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_ui{std::make_unique<Ui::DeleteMomentsDialog>()}
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
|
||||
DeleteMomentsDialog::DeleteMomentsDialog(int fromMoment, int tillMoment, QWidget *parent) :
|
||||
DeleteMomentsDialog{parent}
|
||||
{
|
||||
setFromMoment(fromMoment);
|
||||
setTillMoment(tillMoment);
|
||||
}
|
||||
|
||||
DeleteMomentsDialog::~DeleteMomentsDialog() = default;
|
||||
|
||||
int DeleteMomentsDialog::fromMoment() const
|
||||
{
|
||||
return m_ui->spinBoxFromMoment->value();
|
||||
}
|
||||
|
||||
void DeleteMomentsDialog::setFromMoment(int fromMoment)
|
||||
{
|
||||
m_ui->spinBoxFromMoment->setValue(fromMoment);
|
||||
}
|
||||
|
||||
int DeleteMomentsDialog::tillMoment() const
|
||||
{
|
||||
return m_ui->spinBoxTillMoment->value();
|
||||
}
|
||||
|
||||
void DeleteMomentsDialog::setTillMoment(int tillMoment)
|
||||
{
|
||||
m_ui->spinBoxTillMoment->setValue(tillMoment);
|
||||
}
|
||||
|
||||
void DeleteMomentsDialog::setFromTillMoment(int fromMoment, int tillMoment)
|
||||
{
|
||||
setFromMoment(fromMoment);
|
||||
setTillMoment(tillMoment);
|
||||
}
|
28
dialogs/deletemomentsdialog.h
Normal file
28
dialogs/deletemomentsdialog.h
Normal file
@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace Ui { class DeleteMomentsDialog; }
|
||||
|
||||
class DeleteMomentsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DeleteMomentsDialog(QWidget *parent = nullptr);
|
||||
explicit DeleteMomentsDialog(int fromMoment, int tillMoment, QWidget *parent = nullptr);
|
||||
~DeleteMomentsDialog();
|
||||
|
||||
int fromMoment() const;
|
||||
void setFromMoment(int fromMoment);
|
||||
|
||||
int tillMoment() const;
|
||||
void setTillMoment(int tillMoment);
|
||||
|
||||
void setFromTillMoment(int fromMoment, int tillMoment);
|
||||
|
||||
private:
|
||||
const std::unique_ptr<Ui::DeleteMomentsDialog> m_ui;
|
||||
};
|
102
dialogs/deletemomentsdialog.ui
Normal file
102
dialogs/deletemomentsdialog.ui
Normal file
@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DeleteMomentsDialog</class>
|
||||
<widget class="QDialog" name="DeleteMomentsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>218</width>
|
||||
<height>139</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Deleting Moments</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,0">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelFromMoment">
|
||||
<property name="text">
|
||||
<string>From moment:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>spinBoxFromMoment</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelTillMoment">
|
||||
<property name="text">
|
||||
<string>Till moment:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>spinBoxTillMoment</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="spinBoxFromMoment">
|
||||
<property name="maximum">
|
||||
<number>2147483647</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="spinBoxTillMoment">
|
||||
<property name="maximum">
|
||||
<number>2147483647</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>DeleteMomentsDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>DeleteMomentsDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
@ -4,7 +4,7 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "projectcontainer.h"
|
||||
#include "spritesmodel.h"
|
||||
#include "models/spritesmodel.h"
|
||||
#include "createspritedialog.h"
|
||||
#include "imageeditordialog.h"
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "projectcontainer.h"
|
||||
#include "projecttreemodel.h"
|
||||
#include "models/projecttreemodel.h"
|
||||
|
||||
FontPropertiesDialog::FontPropertiesDialog(Font &font, ProjectTreeModel &projectModel, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
|
@ -301,7 +301,7 @@
|
||||
<customwidget>
|
||||
<class>DrawingCanvasWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>drawingcanvaswidget.h</header>
|
||||
<header>widgets/drawingcanvaswidget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "ui_includedfilesdialog.h"
|
||||
|
||||
#include "projectcontainer.h"
|
||||
#include "includedfilesmodel.h"
|
||||
#include "models/includedfilesmodel.h"
|
||||
|
||||
IncludedFilesDialog::IncludedFilesDialog(ProjectContainer &project, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
|
@ -7,9 +7,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "projecttreemodel.h"
|
||||
#include "objecteventsmodel.h"
|
||||
#include "objectactionsmodel.h"
|
||||
#include "models/projecttreemodel.h"
|
||||
#include "models/objecteventsmodel.h"
|
||||
#include "addeventdialog.h"
|
||||
|
||||
ObjectPropertiesDialog::ObjectPropertiesDialog(Object &object, ProjectTreeModel &projectModel, QWidget *parent) :
|
||||
@ -19,7 +18,6 @@ ObjectPropertiesDialog::ObjectPropertiesDialog(Object &object, ProjectTreeModel
|
||||
m_projectModel{projectModel},
|
||||
m_events{m_object.events},
|
||||
m_eventsModel{std::make_unique<ObjectEventsModel>(m_events)},
|
||||
m_actionsModel{std::make_unique<ObjectActionsModel>()},
|
||||
m_spritesMenu{new QMenu{m_ui->toolButtonSprite}},
|
||||
m_spriteName{object.spriteName}
|
||||
{
|
||||
@ -55,6 +53,15 @@ ObjectPropertiesDialog::ObjectPropertiesDialog(Object &object, ProjectTreeModel
|
||||
connect(&m_projectModel, &ProjectTreeModel::objectNameChanged,
|
||||
this, &ObjectPropertiesDialog::objectNameChanged);
|
||||
|
||||
connect(m_eventsModel.get(), &QAbstractItemModel::modelReset,
|
||||
this, &ObjectPropertiesDialog::changed);
|
||||
connect(m_eventsModel.get(), &QAbstractItemModel::rowsInserted,
|
||||
this, &ObjectPropertiesDialog::changed);
|
||||
connect(m_eventsModel.get(), &QAbstractItemModel::dataChanged,
|
||||
this, &ObjectPropertiesDialog::changed);
|
||||
connect(m_eventsModel.get(), &QAbstractItemModel::rowsRemoved,
|
||||
this, &ObjectPropertiesDialog::changed);
|
||||
|
||||
connect(m_ui->pushButtonNewSprite, &QAbstractButton::clicked,
|
||||
this, &ObjectPropertiesDialog::newSprite);
|
||||
connect(m_ui->pushButtonEditSprite, &QAbstractButton::clicked,
|
||||
@ -81,6 +88,15 @@ ObjectPropertiesDialog::ObjectPropertiesDialog(Object &object, ProjectTreeModel
|
||||
|
||||
connect(m_spritesMenu, &QMenu::aboutToShow,
|
||||
this, &ObjectPropertiesDialog::spritesMenuAboutToShow);
|
||||
|
||||
connect(m_ui->listViewEvents->selectionModel(), &QItemSelectionModel::currentChanged,
|
||||
this, &ObjectPropertiesDialog::currentEventChanged);
|
||||
|
||||
connect(m_ui->listViewEvents, &QListView::customContextMenuRequested,
|
||||
this, &ObjectPropertiesDialog::eventsContextMenuRequested);
|
||||
|
||||
connect(m_ui->actionsWidget, &ActionsContainerWidget::changed,
|
||||
this, &ObjectPropertiesDialog::changed);
|
||||
}
|
||||
|
||||
ObjectPropertiesDialog::~ObjectPropertiesDialog() = default;
|
||||
@ -162,22 +178,43 @@ void ObjectPropertiesDialog::addEvent()
|
||||
AddEventDialog dialog{this};
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
if (!m_events.contains(dialog.eventType()))
|
||||
{
|
||||
m_eventsModel->beginResetModel();
|
||||
m_events[dialog.eventType()];
|
||||
m_eventsModel->endResetModel();
|
||||
m_unsavedChanges = true;
|
||||
}
|
||||
if (!m_eventsModel->addEvent(dialog.eventType()))
|
||||
QMessageBox::warning(this, tr("Could not add Event!"), tr("Could not add Event!"));
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectPropertiesDialog::deleteEvent()
|
||||
{
|
||||
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||
const auto index = m_ui->listViewEvents->currentIndex();
|
||||
if (!index.isValid())
|
||||
return;
|
||||
|
||||
if (QMessageBox::question(this, tr("Confirm"), tr("Are you sure, that you really want to remove the event with all its actions?")) != QMessageBox::Yes)
|
||||
return;
|
||||
|
||||
if (!m_eventsModel->removeRow(index.row()))
|
||||
QMessageBox::warning(this, tr("Could not delete Event!"), tr("Could not delete Event!"));
|
||||
}
|
||||
|
||||
void ObjectPropertiesDialog::replaceEvent()
|
||||
{
|
||||
const auto index = m_ui->listViewEvents->currentIndex();
|
||||
if (!index.isValid())
|
||||
return;
|
||||
|
||||
const auto event = m_eventsModel->getEvent(index);
|
||||
if (!event)
|
||||
return;
|
||||
|
||||
AddEventDialog dialog{this};
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
if (!m_eventsModel->changeEvent(event->first, dialog.eventType()))
|
||||
QMessageBox::warning(this, tr("Could not change Event!"), tr("Could not change Event!"));
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectPropertiesDialog::duplicateEvent()
|
||||
{
|
||||
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||
}
|
||||
@ -215,6 +252,35 @@ void ObjectPropertiesDialog::spritesMenuAboutToShow()
|
||||
[&sprite,this](){ setSprite(sprite); });
|
||||
}
|
||||
|
||||
void ObjectPropertiesDialog::currentEventChanged(const QModelIndex &index)
|
||||
{
|
||||
if (index.isValid())
|
||||
{
|
||||
if (auto event = m_eventsModel->getEvent(index))
|
||||
m_ui->actionsWidget->setActionsContainer(&event->second);
|
||||
else
|
||||
goto none;
|
||||
}
|
||||
else
|
||||
{
|
||||
none:
|
||||
m_ui->actionsWidget->setActionsContainer(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectPropertiesDialog::eventsContextMenuRequested(const QPoint &pos)
|
||||
{
|
||||
const auto index = m_ui->listViewEvents->indexAt(pos);
|
||||
auto event = index.isValid() ? m_eventsModel->getEvent(index) : nullptr;
|
||||
|
||||
QMenu menu{this};
|
||||
menu.addAction(tr("&Add Event"), this, &ObjectPropertiesDialog::addEvent);
|
||||
menu.addAction(tr("&Change Event"), this, &ObjectPropertiesDialog::replaceEvent)->setEnabled(event);
|
||||
menu.addAction(tr("&Duplicate Event"), this, &ObjectPropertiesDialog::duplicateEvent)->setEnabled(event);
|
||||
menu.addAction(tr("D&elete Event"), this, &ObjectPropertiesDialog::deleteEvent)->setEnabled(event);
|
||||
menu.exec(m_ui->listViewEvents->viewport()->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
void ObjectPropertiesDialog::clearSprite()
|
||||
{
|
||||
m_ui->labelSpritePreview->setPixmap(QPixmap{});
|
||||
|
@ -11,7 +11,6 @@ class QMenu;
|
||||
namespace Ui { class ObjectPropertiesDialog; }
|
||||
class ProjectTreeModel;
|
||||
class ObjectEventsModel;
|
||||
class ObjectActionsModel;
|
||||
|
||||
class ObjectPropertiesDialog : public QDialog
|
||||
{
|
||||
@ -31,12 +30,15 @@ private slots:
|
||||
void addEvent();
|
||||
void deleteEvent();
|
||||
void replaceEvent();
|
||||
void duplicateEvent();
|
||||
|
||||
void changed();
|
||||
|
||||
void objectNameChanged(const Object &object);
|
||||
|
||||
void spritesMenuAboutToShow();
|
||||
void currentEventChanged(const QModelIndex &index);
|
||||
void eventsContextMenuRequested(const QPoint &pos);
|
||||
|
||||
void clearSprite();
|
||||
void setSprite(const Sprite &sprite);
|
||||
@ -49,10 +51,9 @@ private:
|
||||
Object &m_object;
|
||||
ProjectTreeModel &m_projectModel;
|
||||
|
||||
std::map<Object::EventType, QString> m_events;
|
||||
Object::events_container_t m_events;
|
||||
|
||||
const std::unique_ptr<ObjectEventsModel> m_eventsModel;
|
||||
const std::unique_ptr<ObjectActionsModel> m_actionsModel;
|
||||
|
||||
QMenu * const m_spritesMenu;
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>794</width>
|
||||
<height>466</height>
|
||||
<width>894</width>
|
||||
<height>496</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -17,7 +17,7 @@
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/qtgameengine/icons/object-file.png</normaloff>:/qtgameengine/icons/object-file.png</iconset>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,0,1,0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,0,1">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
@ -355,6 +355,15 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -394,61 +403,18 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelActions">
|
||||
<property name="text">
|
||||
<string>Actions:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>listViewActions</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListView" name="listViewActions">
|
||||
<property name="toolTip">
|
||||
<string>Drag actions here</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolBox" name="toolBox">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>68</width>
|
||||
<height>390</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
<string>Page 1</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>68</width>
|
||||
<height>390</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
<string>Page 2</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="ActionsContainerWidget" name="actionsWidget" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ActionsContainerWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>widgets/actionscontainerwidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
|
@ -7,8 +7,8 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "projectcontainer.h"
|
||||
#include "projecttreemodel.h"
|
||||
#include "pathpointsmodel.h"
|
||||
#include "models/projecttreemodel.h"
|
||||
#include "models/pathpointsmodel.h"
|
||||
|
||||
PathPropertiesDialog::PathPropertiesDialog(Path &path, ProjectTreeModel &projectModel, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
|
@ -617,7 +617,7 @@
|
||||
<customwidget>
|
||||
<class>PathPointsWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>pathpointswidget.h</header>
|
||||
<header>widgets/pathpointswidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <QDebug>
|
||||
|
||||
#include "projectcontainer.h"
|
||||
#include "projecttreemodel.h"
|
||||
#include "models/projecttreemodel.h"
|
||||
|
||||
ScriptPropertiesDialog::ScriptPropertiesDialog(Script &script, ProjectTreeModel &projectModel, QWidget *parent) :
|
||||
CodeEditorDialog{tr("Script Properties: %0").arg(script.name), parent},
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <QFileInfo>
|
||||
|
||||
#include "projectcontainer.h"
|
||||
#include "projecttreemodel.h"
|
||||
#include "models/projecttreemodel.h"
|
||||
|
||||
SoundPropertiesDialog::SoundPropertiesDialog(Sound &sound, ProjectTreeModel &projectModel, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <QSignalBlocker>
|
||||
|
||||
#include "projectcontainer.h"
|
||||
#include "projecttreemodel.h"
|
||||
#include "models/projecttreemodel.h"
|
||||
#include "editspritedialog.h"
|
||||
#include "maskpropertiesdialog.h"
|
||||
|
||||
|
@ -3,19 +3,22 @@
|
||||
|
||||
#include <QDebug>
|
||||
#include <QMessageBox>
|
||||
#include <QInputDialog>
|
||||
#include <QMenu>
|
||||
|
||||
#include "projectcontainer.h"
|
||||
#include "projecttreemodel.h"
|
||||
#include "timelinemomentsmodel.h"
|
||||
#include "timelineactionsmodel.h"
|
||||
#include <limits>
|
||||
|
||||
#include "models/projecttreemodel.h"
|
||||
#include "models/timelinemomentsmodel.h"
|
||||
#include "dialogs/deletemomentsdialog.h"
|
||||
|
||||
TimeLinePropertiesDialog::TimeLinePropertiesDialog(TimeLine &timeLine, ProjectTreeModel &projectModel, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_ui{std::make_unique<Ui::TimeLinePropertiesDialog>()},
|
||||
m_timeLine{timeLine},
|
||||
m_projectModel{projectModel},
|
||||
m_momentsModel{std::make_unique<TimelineMomentsModel>(this)},
|
||||
m_actionsModel{std::make_unique<TimelineActionsModel>(this)}
|
||||
m_moments{timeLine.moments},
|
||||
m_momentsModel{std::make_unique<TimelineMomentsModel>(m_moments, this)}
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@ -30,32 +33,51 @@ TimeLinePropertiesDialog::TimeLinePropertiesDialog(TimeLine &timeLine, ProjectTr
|
||||
|
||||
m_ui->listViewMoments->setModel(m_momentsModel.get());
|
||||
|
||||
m_ui->listViewActions->setModel(m_actionsModel.get());
|
||||
|
||||
connect(&m_projectModel, &ProjectTreeModel::timeLineNameChanged,
|
||||
this, &TimeLinePropertiesDialog::timeLineNameChanged);
|
||||
|
||||
connect(m_momentsModel.get(), &QAbstractItemModel::modelReset,
|
||||
this, &TimeLinePropertiesDialog::changed);
|
||||
connect(m_momentsModel.get(), &QAbstractItemModel::rowsInserted,
|
||||
this, &TimeLinePropertiesDialog::changed);
|
||||
connect(m_momentsModel.get(), &QAbstractItemModel::dataChanged,
|
||||
this, &TimeLinePropertiesDialog::changed);
|
||||
connect(m_momentsModel.get(), &QAbstractItemModel::rowsRemoved,
|
||||
this, &TimeLinePropertiesDialog::changed);
|
||||
|
||||
connect(m_ui->lineEditName, &QLineEdit::textChanged,
|
||||
this, &TimeLinePropertiesDialog::changed);
|
||||
|
||||
connect(m_ui->pushButtonAdd, &QAbstractButton::clicked,
|
||||
this, &TimeLinePropertiesDialog::add);
|
||||
this, &TimeLinePropertiesDialog::addMoment);
|
||||
connect(m_ui->pushButtonChange, &QAbstractButton::clicked,
|
||||
this, &TimeLinePropertiesDialog::change);
|
||||
this, &TimeLinePropertiesDialog::changeMoment);
|
||||
connect(m_ui->pushButtonDelete, &QAbstractButton::clicked,
|
||||
this, &TimeLinePropertiesDialog::delete_);
|
||||
this, &TimeLinePropertiesDialog::deleteMoments);
|
||||
connect(m_ui->pushButtonClear, &QAbstractButton::clicked,
|
||||
this, &TimeLinePropertiesDialog::clear);
|
||||
this, &TimeLinePropertiesDialog::clearMoments);
|
||||
connect(m_ui->pushButtonShift, &QAbstractButton::clicked,
|
||||
this, &TimeLinePropertiesDialog::shift);
|
||||
this, &TimeLinePropertiesDialog::shiftMoments);
|
||||
connect(m_ui->pushButtonDuplicate, &QAbstractButton::clicked,
|
||||
this, &TimeLinePropertiesDialog::duplicate);
|
||||
this, &TimeLinePropertiesDialog::duplicateMoments);
|
||||
connect(m_ui->pushButtonSpread, &QAbstractButton::clicked,
|
||||
this, &TimeLinePropertiesDialog::spread);
|
||||
this, &TimeLinePropertiesDialog::spreadMoments);
|
||||
connect(m_ui->pushButtonMerge, &QAbstractButton::clicked,
|
||||
this, &TimeLinePropertiesDialog::merge);
|
||||
this, &TimeLinePropertiesDialog::mergeMoments);
|
||||
connect(m_ui->pushButtonShowInformation, &QAbstractButton::clicked,
|
||||
this, &TimeLinePropertiesDialog::showInformation);
|
||||
|
||||
connect(m_ui->listViewMoments->selectionModel(), &QItemSelectionModel::currentChanged,
|
||||
this, &TimeLinePropertiesDialog::currentMomentChanged);
|
||||
connect(m_momentsModel.get(), &QAbstractItemModel::modelAboutToBeReset,
|
||||
m_ui->listViewMoments, [listView=m_ui->listViewMoments](){
|
||||
listView->setCurrentIndex(QModelIndex{});
|
||||
});
|
||||
connect(m_ui->listViewMoments, &QListView::customContextMenuRequested,
|
||||
this, &TimeLinePropertiesDialog::momentsContextMenuRequested);
|
||||
|
||||
connect(m_ui->actionsWidget, &ActionsContainerWidget::changed,
|
||||
this, &TimeLinePropertiesDialog::changed);
|
||||
}
|
||||
|
||||
TimeLinePropertiesDialog::~TimeLinePropertiesDialog() = default;
|
||||
@ -77,7 +99,7 @@ void TimeLinePropertiesDialog::accept()
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
m_timeLine.moments = m_moments;
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
@ -134,42 +156,92 @@ void TimeLinePropertiesDialog::timeLineNameChanged(const TimeLine &timeLine)
|
||||
updateTitle();
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::add()
|
||||
void TimeLinePropertiesDialog::addMoment()
|
||||
{
|
||||
TimeLine::moment_key_t newMoment{};
|
||||
for (const auto &moment : m_moments)
|
||||
if (moment.first >= newMoment)
|
||||
newMoment = moment.first + 1;
|
||||
|
||||
bool ok;
|
||||
const auto moment = QInputDialog::getInt(this, tr("Adding a Moment"), tr("Indicate the moment:"), newMoment, 0, std::numeric_limits<TimeLine::moment_key_t>::max(), 1, &ok);
|
||||
if (!ok)
|
||||
return;
|
||||
|
||||
if (!m_momentsModel->addMoment(moment))
|
||||
QMessageBox::warning(this, tr("Could not add Moment!"), tr("Could not add Moment!"));
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::changeMoment()
|
||||
{
|
||||
const auto index = m_ui->listViewMoments->currentIndex();
|
||||
if (!index.isValid())
|
||||
return;
|
||||
|
||||
const auto moment = m_momentsModel->getMoment(index);
|
||||
if (!moment)
|
||||
return;
|
||||
|
||||
bool ok;
|
||||
const auto newMoment = QInputDialog::getInt(this, tr("Changing a Moment"), tr("Indicate the moment:"), moment->first, 0, std::numeric_limits<TimeLine::moment_key_t>::max(), 1, &ok);
|
||||
if (!ok)
|
||||
return;
|
||||
|
||||
if (!m_momentsModel->changeMoment(moment->first, newMoment))
|
||||
QMessageBox::warning(this, tr("Could not change Moment!"), tr("Could not change Moment!"));
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::deleteMoments()
|
||||
{
|
||||
if (m_moments.empty())
|
||||
return;
|
||||
|
||||
std::optional<TimeLine::moment_key_t> momentKey;
|
||||
|
||||
if (const auto index = m_ui->listViewMoments->currentIndex(); index.isValid())
|
||||
if (const auto moment = m_momentsModel->getMoment(index); moment)
|
||||
momentKey = moment->first;
|
||||
|
||||
DeleteMomentsDialog dialog = momentKey ? DeleteMomentsDialog{*momentKey, *momentKey, this} : DeleteMomentsDialog{this};
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
if (dialog.fromMoment() > dialog.tillMoment())
|
||||
{
|
||||
QMessageBox::warning(this, tr("Invalid input!"), tr("Invalid input!") + "\n\n" + tr("From moment cannot be greater than Till moment!"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_momentsModel->removeRows(dialog.fromMoment(), dialog.tillMoment() - dialog.fromMoment() + 1))
|
||||
QMessageBox::warning(this, tr("Could not remove Moments!"), tr("Could not remove Moments!"));
|
||||
}
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::clearMoments()
|
||||
{
|
||||
if (m_moments.empty())
|
||||
return;
|
||||
if (QMessageBox::question(this, tr("Confirm"), tr("Are you sure, that you really want to remove all Moments?")) != QMessageBox::Yes)
|
||||
return;
|
||||
if (!m_momentsModel->clearMoments())
|
||||
QMessageBox::warning(this, tr("Could not clear Moments!"), tr("Could not clear Moments!"));
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::shiftMoments()
|
||||
{
|
||||
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::change()
|
||||
void TimeLinePropertiesDialog::duplicateMoments()
|
||||
{
|
||||
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::delete_()
|
||||
void TimeLinePropertiesDialog::spreadMoments()
|
||||
{
|
||||
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::clear()
|
||||
{
|
||||
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::shift()
|
||||
{
|
||||
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::duplicate()
|
||||
{
|
||||
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::spread()
|
||||
{
|
||||
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::merge()
|
||||
void TimeLinePropertiesDialog::mergeMoments()
|
||||
{
|
||||
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||
}
|
||||
@ -179,6 +251,39 @@ void TimeLinePropertiesDialog::showInformation()
|
||||
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::currentMomentChanged(const QModelIndex &index)
|
||||
{
|
||||
qDebug() << index.isValid() << index.row();
|
||||
|
||||
if (index.isValid())
|
||||
{
|
||||
if (auto moment = m_momentsModel->getMoment(index))
|
||||
m_ui->actionsWidget->setActionsContainer(&moment->second);
|
||||
else
|
||||
goto none;
|
||||
}
|
||||
else
|
||||
{
|
||||
none:
|
||||
m_ui->actionsWidget->setActionsContainer(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::momentsContextMenuRequested(const QPoint &pos)
|
||||
{
|
||||
const auto index = m_ui->listViewMoments->indexAt(pos);
|
||||
auto moment = index.isValid() ? m_momentsModel->getMoment(index) : nullptr;
|
||||
|
||||
QMenu menu{this};
|
||||
menu.addAction(tr("&Add Moment"), this, &TimeLinePropertiesDialog::addMoment);
|
||||
menu.addAction(tr("&Change Moment"), this, &TimeLinePropertiesDialog::changeMoment)->setEnabled(moment);
|
||||
menu.addAction(tr("&Delete Moment"), this, &TimeLinePropertiesDialog::deleteMoments)->setEnabled(moment);
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("&Shift Moments"), this, &TimeLinePropertiesDialog::shiftMoments)->setEnabled(moment);
|
||||
menu.addAction(tr("&Merge Moments"), this, &TimeLinePropertiesDialog::mergeMoments)->setEnabled(moment);
|
||||
menu.exec(m_ui->listViewMoments->viewport()->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
void TimeLinePropertiesDialog::updateTitle()
|
||||
{
|
||||
setWindowTitle(tr("Time Line Properties: %0%1")
|
||||
|
@ -4,11 +4,11 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "projectcontainer.h"
|
||||
|
||||
namespace Ui { class TimeLinePropertiesDialog; }
|
||||
struct TimeLine;
|
||||
class ProjectTreeModel;
|
||||
class TimelineMomentsModel;
|
||||
class TimelineActionsModel;
|
||||
|
||||
class TimeLinePropertiesDialog : public QDialog
|
||||
{
|
||||
@ -26,16 +26,19 @@ private slots:
|
||||
|
||||
void timeLineNameChanged(const TimeLine &timeLine);
|
||||
|
||||
void add();
|
||||
void change();
|
||||
void delete_();
|
||||
void clear();
|
||||
void shift();
|
||||
void duplicate();
|
||||
void spread();
|
||||
void merge();
|
||||
void addMoment();
|
||||
void changeMoment();
|
||||
void deleteMoments();
|
||||
void clearMoments();
|
||||
void shiftMoments();
|
||||
void duplicateMoments();
|
||||
void spreadMoments();
|
||||
void mergeMoments();
|
||||
void showInformation();
|
||||
|
||||
void currentMomentChanged(const QModelIndex &index);
|
||||
void momentsContextMenuRequested(const QPoint &pos);
|
||||
|
||||
private:
|
||||
void updateTitle();
|
||||
|
||||
@ -44,8 +47,9 @@ private:
|
||||
TimeLine &m_timeLine;
|
||||
ProjectTreeModel &m_projectModel;
|
||||
|
||||
TimeLine::moments_container_t m_moments;
|
||||
|
||||
const std::unique_ptr<TimelineMomentsModel> m_momentsModel;
|
||||
const std::unique_ptr<TimelineActionsModel> m_actionsModel;
|
||||
|
||||
bool m_unsavedChanges{};
|
||||
};
|
||||
|
@ -17,7 +17,7 @@
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/qtgameengine/icons/timeline-file.png</normaloff>:/qtgameengine/icons/timeline-file.png</iconset>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,1,0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,1">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
@ -257,66 +257,26 @@
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelActions">
|
||||
<property name="text">
|
||||
<string>Actions:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>listViewActions</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListView" name="listViewActions">
|
||||
<property name="toolTip">
|
||||
<string>Drag actions here</string>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolBox" name="toolBox">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>68</width>
|
||||
<height>457</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
<string>Page 1</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>68</width>
|
||||
<height>457</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
<string>Page 2</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="ActionsContainerWidget" name="actionsWidget" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ActionsContainerWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>widgets/actionscontainerwidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "projectcontainer.h"
|
||||
#include "triggersmodel.h"
|
||||
#include "models/triggersmodel.h"
|
||||
#include "triggerconditiondialog.h"
|
||||
|
||||
TriggersDialog::TriggersDialog(ProjectContainer &project, QWidget *parent) :
|
||||
@ -67,6 +67,10 @@ TriggersDialog::~TriggersDialog() = default;
|
||||
void TriggersDialog::openCodeEditor()
|
||||
{
|
||||
TriggerConditionDialog dialog{this};
|
||||
dialog.setScript(m_ui->plainTextEdit->toPlainText());
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
m_ui->plainTextEdit->setPlainText(dialog.script());
|
||||
// changed();
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "projectcontainer.h"
|
||||
#include "constantsmodel.h"
|
||||
#include "models/constantsmodel.h"
|
||||
|
||||
UserDefinedConstantsDialog::UserDefinedConstantsDialog(ProjectContainer &project, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
|
BIN
help/Game_Maker.qch
Normal file
BIN
help/Game_Maker.qch
Normal file
Binary file not shown.
2881
help/Game_Maker.qhp
Normal file
2881
help/Game_Maker.qhp
Normal file
File diff suppressed because it is too large
Load Diff
46
help/files/100_index.html
Normal file
46
help/files/100_index.html
Normal file
@ -0,0 +1,46 @@
|
||||
<!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>
|
96
help/files/101_00_introduction.html
Normal file
96
help/files/101_00_introduction.html
Normal file
@ -0,0 +1,96 @@
|
||||
<!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
|
||||
-->
|
80
help/files/102_00_installation.html
Normal file
80
help/files/102_00_installation.html
Normal file
@ -0,0 +1,80 @@
|
||||
<!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
|
||||
-->
|
123
help/files/103_00_pro.html
Normal file
123
help/files/103_00_pro.html
Normal file
@ -0,0 +1,123 @@
|
||||
<!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
|
||||
-->
|
127
help/files/104_00_idea.html
Normal file
127
help/files/104_00_idea.html
Normal file
@ -0,0 +1,127 @@
|
||||
<!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
|
||||
-->
|
212
help/files/106_00_interface.html
Normal file
212
help/files/106_00_interface.html
Normal file
@ -0,0 +1,212 @@
|
||||
<!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
|
||||
-->
|
99
help/files/107_00_sprites.html
Normal file
99
help/files/107_00_sprites.html
Normal file
@ -0,0 +1,99 @@
|
||||
<!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
|
||||
-->
|
52
help/files/108_00_sounds.html
Normal file
52
help/files/108_00_sounds.html
Normal file
@ -0,0 +1,52 @@
|
||||
<!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
|
||||
-->
|
65
help/files/109_00_backgrounds.html
Normal file
65
help/files/109_00_backgrounds.html
Normal file
@ -0,0 +1,65 @@
|
||||
<!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
|
||||
-->
|
87
help/files/110_00_objects.html
Normal file
87
help/files/110_00_objects.html
Normal file
@ -0,0 +1,87 @@
|
||||
<!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
|
||||
|
||||
-->
|
302
help/files/111_00_events.html
Normal file
302
help/files/111_00_events.html
Normal file
@ -0,0 +1,302 @@
|
||||
<!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 <Alt> 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 <Del> key) or copy and paste actions. (You can
|
||||
select multiple actions for cutting, copying, or deleting by holding the
|
||||
<Shift> key of <Ctrl> key. Press <Ctrl><A> 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
|
||||
<No key>. This event happens in each step when no key is pressed. The second one
|
||||
is called <Any key> 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 <NumLock> 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 "controller" 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
|
||||
-->
|
87
help/files/112_00_actions.html
Normal file
87
help/files/112_00_actions.html
Normal file
@ -0,0 +1,87 @@
|
||||
<!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 <Alt> 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 <Del> 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
|
||||
-->
|
161
help/files/112_01_move.html
Normal file
161
help/files/112_01_move.html
Normal file
@ -0,0 +1,161 @@
|
||||
<!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
|
||||
-->
|
167
help/files/112_02_main1.html
Normal file
167
help/files/112_02_main1.html
Normal file
@ -0,0 +1,167 @@
|
||||
<!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
|
||||
-->
|
81
help/files/112_03_main2.html
Normal file
81
help/files/112_03_main2.html
Normal file
@ -0,0 +1,81 @@
|
||||
<!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
|
||||
-->
|
198
help/files/112_04_control.html
Normal file
198
help/files/112_04_control.html
Normal file
@ -0,0 +1,198 @@
|
||||
<!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
|
||||
-->
|
117
help/files/112_05_score.html
Normal file
117
help/files/112_05_score.html
Normal file
@ -0,0 +1,117 @@
|
||||
<!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 "no more lives" 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
|
||||
-->
|
130
help/files/112_06_draw.html
Normal file
130
help/files/112_06_draw.html
Normal file
@ -0,0 +1,130 @@
|
||||
<!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
|
||||
-->
|
74
help/files/112_07_variables.html
Normal file
74
help/files/112_07_variables.html
Normal file
@ -0,0 +1,74 @@
|
||||
<!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 < (smaller than), >, 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
|
||||
-->
|
169
help/files/113_00_rooms.html
Normal file
169
help/files/113_00_rooms.html
Normal file
@ -0,0 +1,169 @@
|
||||
<!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 <Alt> 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 <Shift> 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 <Ctrl> 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 <Alt> for precise positioning.)
|
||||
|
||||
<p>
|
||||
If you hold the <Ctrl> 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
|
||||
-->
|
64
help/files/114_00_distributing.html
Normal file
64
help/files/114_00_distributing.html
Normal file
@ -0,0 +1,64 @@
|
||||
<!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
|
||||
-->
|
45
help/files/200_index.html
Normal file
45
help/files/200_index.html
Normal file
@ -0,0 +1,45 @@
|
||||
<!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>
|
170
help/files/201_00_advanced.html
Normal file
170
help/files/201_00_advanced.html
Normal file
@ -0,0 +1,170 @@
|
||||
<!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
|
||||
-->
|
194
help/files/201_01_preferences.html
Normal file
194
help/files/201_01_preferences.html
Normal file
@ -0,0 +1,194 @@
|
||||
<!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
|
||||
-->
|
144
help/files/202_00_sprites.html
Normal file
144
help/files/202_00_sprites.html
Normal file
@ -0,0 +1,144 @@
|
||||
<!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
|
||||
-->
|
||||
|
331
help/files/202_01_editing.html
Normal file
331
help/files/202_01_editing.html
Normal file
@ -0,0 +1,331 @@
|
||||
<!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
|
||||
-->
|
86
help/files/202_02_strips.html
Normal file
86
help/files/202_02_strips.html
Normal file
@ -0,0 +1,86 @@
|
||||
<!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
|
||||
-->
|
248
help/files/202_03_individual.html
Normal file
248
help/files/202_03_individual.html
Normal file
@ -0,0 +1,248 @@
|
||||
<!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 <Shift> when starting to paint you only paint horizontal or
|
||||
vertical lines. When holding the <Ctrl> 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 <Shift> when starting to spray you only paint horizontal or
|
||||
vertical lines. When holding the <Ctrl> 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 <Shift> 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 <Shift> 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 <Esc> key.
|
||||
When holding <Shift> 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 <Shift> you can draw a square.
|
||||
When holding <Ctrl> 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 <Shift> you can draw a circle.
|
||||
When holding <Ctrl> 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 <Shift> you can draw a square.
|
||||
When holding <Ctrl> 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 <Shift> key. Also you can remove parts by holding the <Ctrl> 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 <Del> key. You can end the selection using the
|
||||
<Esc> 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 <Shift> key. Also you can remove parts by holding the <Ctrl> 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 <Ctrl> 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
|
||||
-->
|
97
help/files/203_00_sounds.html
Normal file
97
help/files/203_00_sounds.html
Normal file
@ -0,0 +1,97 @@
|
||||
<!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
|
||||
-->
|
64
help/files/204_00_backgrounds.html
Normal file
64
help/files/204_00_backgrounds.html
Normal file
@ -0,0 +1,64 @@
|
||||
<!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
|
||||
-->
|
123
help/files/205_00_objects.html
Normal file
123
help/files/205_00_objects.html
Normal file
@ -0,0 +1,123 @@
|
||||
<!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 "override" 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 "inherited" 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
|
||||
-->
|
38
help/files/206_00_actions.html
Normal file
38
help/files/206_00_actions.html
Normal file
@ -0,0 +1,38 @@
|
||||
<!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>
|
||||
|
74
help/files/206_01_move.html
Normal file
74
help/files/206_01_move.html
Normal file
@ -0,0 +1,74 @@
|
||||
<!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
|
||||
-->
|
157
help/files/206_02_main.html
Normal file
157
help/files/206_02_main.html
Normal file
@ -0,0 +1,157 @@
|
||||
<!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
|
||||
-->
|
35
help/files/206_03_control.html
Normal file
35
help/files/206_03_control.html
Normal file
@ -0,0 +1,35 @@
|
||||
<!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
|
||||
-->
|
31
help/files/206_04_draw.html
Normal file
31
help/files/206_04_draw.html
Normal file
@ -0,0 +1,31 @@
|
||||
<!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
|
||||
-->
|
164
help/files/206_05_particles.html
Normal file
164
help/files/206_05_particles.html
Normal file
@ -0,0 +1,164 @@
|
||||
<!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
|
||||
-->
|
65
help/files/206_06_extra.html
Normal file
65
help/files/206_06_extra.html
Normal file
@ -0,0 +1,65 @@
|
||||
<!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
|
||||
-->
|
71
help/files/207_00_constants.html
Normal file
71
help/files/207_00_constants.html
Normal file
@ -0,0 +1,71 @@
|
||||
<!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
|
||||
-->
|
138
help/files/208_00_triggers.html
Normal file
138
help/files/208_00_triggers.html
Normal file
@ -0,0 +1,138 @@
|
||||
<!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 >= 3) && (n <= 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
|
||||
-->
|
125
help/files/209_00_include.html
Normal file
125
help/files/209_00_include.html
Normal file
@ -0,0 +1,125 @@
|
||||
<!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
|
||||
-->
|
60
help/files/210_00_rooms.html
Normal file
60
help/files/210_00_rooms.html
Normal file
@ -0,0 +1,60 @@
|
||||
<!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 <Ctrl> 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>
|
69
help/files/210_01_advanced.html
Normal file
69
help/files/210_01_advanced.html
Normal file
@ -0,0 +1,69 @@
|
||||
<!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 <Ctrl> 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
|
||||
-->
|
117
help/files/210_02_tiles.html
Normal file
117
help/files/210_02_tiles.html
Normal file
@ -0,0 +1,117 @@
|
||||
<!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 <Shift> key to add multiple
|
||||
tiles. And hold the <Ctrl> key to move tiles to a new place. The
|
||||
<Alt> key will avoid snapping to the gird. Also there is again a pop-
|
||||
up menu when you hold the <Ctrl> 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 <Alt> 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
|
||||
<Shift> 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 <Ctrl> key rather than the <Shift> 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
|
||||
-->
|
75
help/files/210_03_views.html
Normal file
75
help/files/210_03_views.html
Normal file
@ -0,0 +1,75 @@
|
||||
<!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
|
||||
-->
|
66
help/files/211_00_fonts.html
Normal file
66
help/files/211_00_fonts.html
Normal file
@ -0,0 +1,66 @@
|
||||
<!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
|
||||
-->
|
203
help/files/212_00_paths.html
Normal file
203
help/files/212_00_paths.html
Normal file
@ -0,0 +1,203 @@
|
||||
<!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 <Shift> 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 <Alt> 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
|
||||
-->
|
94
help/files/213_00_timelines.html
Normal file
94
help/files/213_00_timelines.html
Normal file
@ -0,0 +1,94 @@
|
||||
<!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
|
||||
-->
|
347
help/files/214_00_scripts.html
Normal file
347
help/files/214_00_scripts.html
Normal file
@ -0,0 +1,347 @@
|
||||
<!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 <Ctrl> + Z for undo and <Ctrl> + <Shift> + 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 <Ctrl> with
|
||||
the left and right arrow key to move to the beginning of the previous
|
||||
or next word. Use <Ctrl> with the up and down key to also scroll
|
||||
the text. Hold the <Shift> 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 <Ctrl> they move to the start and end of the
|
||||
script. Hold the <Shift> key to select text.</li>
|
||||
<li>You can scroll through the text with the mouse wheel.
|
||||
With <Ctrl> the cursor scrolls with the text. Hold the <Shift> 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 <Ctrl> + I to indent selected lines and <Shift> +
|
||||
<Ctrl> + I to unindent selected lines.</li>
|
||||
<li>Hold <Ctrl> 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 <Ctrl> 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 <Ctrl> + 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
|
||||
-->
|
76
help/files/215_00_extensions.html
Normal file
76
help/files/215_00_extensions.html
Normal file
@ -0,0 +1,76 @@
|
||||
<!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
|
||||
-->
|
153
help/files/216_00_import.html
Normal file
153
help/files/216_00_import.html
Normal file
@ -0,0 +1,153 @@
|
||||
<!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
|
||||
-->
|
35
help/files/300_index.html
Normal file
35
help/files/300_index.html
Normal file
@ -0,0 +1,35 @@
|
||||
<!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>
|
||||
|
64
help/files/301_00_information.html
Normal file
64
help/files/301_00_information.html
Normal file
@ -0,0 +1,64 @@
|
||||
<!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 <F1> 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
|
||||
-->
|
54
help/files/302_00_settings.html
Normal file
54
help/files/302_00_settings.html
Normal file
@ -0,0 +1,54 @@
|
||||
<!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
|
||||
-->
|
102
help/files/302_01_graphics.html
Normal file
102
help/files/302_01_graphics.html
Normal file
@ -0,0 +1,102 @@
|
||||
<!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
|
||||
-->
|
75
help/files/302_02_resolution.html
Normal file
75
help/files/302_02_resolution.html
Normal file
@ -0,0 +1,75 @@
|
||||
<!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
|
||||
-->
|
77
help/files/302_03_various.html
Normal file
77
help/files/302_03_various.html
Normal file
@ -0,0 +1,77 @@
|
||||
<!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 <Esc> 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 <Esc> 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 <F1> show the game information</b><br>
|
||||
When checked pressing the F1 key will display the game information.
|
||||
|
||||
<p>
|
||||
<b>Let <F4> switch between screen modes</b><br>
|
||||
When checked the F4 key will switch between fullscreen and windowed mode.
|
||||
|
||||
<p>
|
||||
<b>Let <F5> save the game and <F6> load a game</b><br>
|
||||
When checked the player can use <F5> to store the current game situation
|
||||
and <F6> 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 <F9> take a screenshot of a game</b><br>
|
||||
When checked the player can use <F9> 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
|
||||
-->
|
56
help/files/302_04_loading.html
Normal file
56
help/files/302_04_loading.html
Normal file
@ -0,0 +1,56 @@
|
||||
<!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
|
||||
-->
|
50
help/files/302_05_errors.html
Normal file
50
help/files/302_05_errors.html
Normal file
@ -0,0 +1,50 @@
|
||||
<!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
|
||||
-->
|
27
help/files/302_06_info.html
Normal file
27
help/files/302_06_info.html
Normal file
@ -0,0 +1,27 @@
|
||||
<!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
|
||||
-->
|
77
help/files/303_00_speed.html
Normal file
77
help/files/303_00_speed.html
Normal file
@ -0,0 +1,77 @@
|
||||
<!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
|
||||
-->
|
50
help/files/400_index.html
Normal file
50
help/files/400_index.html
Normal file
@ -0,0 +1,50 @@
|
||||
<!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>
|
80
help/files/401_00_language.html
Normal file
80
help/files/401_00_language.html
Normal file
@ -0,0 +1,80 @@
|
||||
<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
|
||||
|
||||
-->
|
41
help/files/401_01_program.html
Normal file
41
help/files/401_01_program.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!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>
|
||||
{
|
||||
<statement>;
|
||||
<statement>;
|
||||
...
|
||||
}
|
||||
</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
|
||||
-->
|
36
help/files/401_02_variables.html
Normal file
36
help/files/401_02_variables.html
Normal file
@ -0,0 +1,36 @@
|
||||
<!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
|
||||
-->
|
31
help/files/401_03_assignments.html
Normal file
31
help/files/401_03_assignments.html
Normal file
@ -0,0 +1,31 @@
|
||||
<!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><variable> = <expression>;</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 |=, &\, or ^=.
|
||||
|
||||
<!--END-->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- KEYWORDS
|
||||
assignements
|
||||
-->
|
92
help/files/401_04_expressions.html
Normal file
92
help/files/401_04_expressions.html
Normal file
@ -0,0 +1,92 @@
|
||||
<!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 “hello”) 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>&& || ^^: combine Boolean values (&& = and, || = or,
|
||||
^^ = xor)</li>
|
||||
<li>< <= == != > >=: comparisons, result in true (1) or
|
||||
false (0)</li>
|
||||
<li>| & ^: bitwise operators (| = bitwise or, & = bitwise and, ^
|
||||
= bitwise xor)</li>
|
||||
<li><< >>: bitwise operators (<< = shift left, >
|
||||
> = 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 << 2;
|
||||
x = 23*((2+4) / sin(y));
|
||||
str = 'hello' + " world";
|
||||
b = (x < 5) && !(x==2 || x==4);
|
||||
}
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<!--END-->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- KEYWORDS
|
||||
hexadecimal numbers
|
||||
expressions
|
||||
operators
|
||||
binary operators
|
||||
unary operators
|
||||
bitwise operators
|
||||
boolean operators
|
||||
logical operators
|
||||
-->
|
90
help/files/401_05_extra.html
Normal file
90
help/files/401_05_extra.html
Normal file
@ -0,0 +1,90 @@
|
||||
<!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> <varname1>,<varname2>,<varname3>, ... ;</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> <varname1>,<varname2>,<varname3>, ... ;</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
|
||||
-->
|
133
help/files/401_06_addressing.html
Normal file
133
help/files/401_06_addressing.html
Normal file
@ -0,0 +1,133 @@
|
||||
<!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 "objects".
|
||||
|
||||
<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
|
||||
-->
|
43
help/files/401_07_arrays.html
Normal file
43
help/files/401_07_arrays.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!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 < 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
|
||||
-->
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user