Example Project - Grisgram/gml-raptor GitHub Wiki
The repository contains a folder named example_project
.
It contains a very small demo application showing a main menu (hover over the items to see tooltips!) and you can even start a small game, that... to be honest... doesn't make any sense as a game itself, but demonstrates the use of the StateMachine and Animation systems quite well.
Also included is a small demonstration of Race (The Random Content Engine) with a simple RaceTable
and some settings where you can tweak chances and enable/disable items.
The main topics demonstrated in this project are:
- Using the UI Subsystem (Buttons, ImageButtons, InputBox, Label, Tooltip)
- Using the data from the
version.json
file - LG Localization
- UI Themes and UI Skins
- Locale hotswapping in the running game (The flag buttons in the top right corner)
- Usage of the Savegame System to load/save your profile name as you enter it in the InputBox - plain text and encryption are shown
The game is a very simple thing that shows a spawner object in the middle of the screen and your character. You move with WASD keys. The spawner is an ever-rotating... thing... that spits out enemies now and then. They have a yellow scanner range showing their field of vision.
If you happen to get into their range, you die. To kill enemies, you need to touch them from the side or behind without entering their field of vision. Just try to survive as long as possible!
Starting tip: DON'T MOVE! Wait for the first three enemies to appear.
-
StateMachine
- Definition of states (The
Spawner
, theEnemy
and thePlayer
object act purely based on StateMachine and Animation). - Receiving events in states
- State transitions (One state leads to another)
- Definition of states (The
-
Animation
- Spawning, Despawning
- Rotation
- Death
The Race
demo is really simple - what you should do here is study the source code to see how this is done. You will be surprised how little code is necessary to create such a random board with Race
. Don't forget, it's a weighted randomizer and you have full control with lots of flags for dropping items.
I encourage you, again, to read the Race
documentation in the wiki. There are some great examples including a more complex RaceTable
system with tables and sub-tables, references, and more that has been used in a game I made. Race
can do much much more than shown in this short example. This is just a starter for you.
The main topics in this demo are:
- Derived
raptor
controls (a simple Checkbox made from a button and a custom InputBox - RACE (The Random Content Engine)
The game is a very simple thing that shows a spawner object in the middle of the screen and your character.
This is a quite complex demo of the new UI Subsystem, that has been released with version 3.0
of raptor
.
The demo covers these topics of the UI system:
- Aligning, Docking, Anchoring, Positioning of Controls through the new ControlTree
- Showing full custom dialogs designed with the ControlTree
- (This does also include a demonstration of read-back from entered data in a dialog)
- Showing simple MessageBoxes
The new UI system is an almost full rewrite of the UI capabilities of raptor
. I strongly recommend, that you read the entire section of the UI Subsystem and especially the ControlTree documentation in the wiki!
Open the project, start it, and look at the source code. The most important parts of raptor
are covered here in a few lines of code -- and this is exactly, what raptor
is made for: Creating astounding results by combining objects that work well together quickly, easily, and with very little code!
Don't forget to look at the Variable Definitions
of the objects in the Room Editor
!
raptor
uses many Variables which allows you to get half of the content done by simply setting some flags on the objects. This is especially true for the UI and the controls.
Enjoy - I hope, you like raptor
as much as I do
Yours, Mike
PS: Don't hesitate to ask questions or provide suggestions for raptor
!
I'll happily discuss any ideas!