Behind the scenes : Creation of a screen - PART 2 : The program
Let's continue our "behind the scenes" on a room creation, shall we? :)
The next step is implementing the art into the game program.
Even though I'm using a well-known software to create the game (Game Maker Studio), the game engine has been made from scratch, using the integrated GML programming language.
To define interactions, I am using elements that I've created for Demetrios, which I've named "clickers". They are clickable areas on the screen, defined either by coordinates or a sprite.
They are associated to a label (the text displayed when you hover it) and an icon. (hand, arrows, talk...)
Here's an example taken straight from the game code :
clickerconstructor(0, 916, 1920, 1080, 'PC_EXIT', "PC16_TO_PC15", ICON_BACK, PC_DEPTH - 10);
clickerspriteconstructor(gsp('pc16_tomC'), 'PC_TOM', "PC16_TOM_DIALOG", ICON_TALK, PC_DEPTH - 40);
The first clicker is the area to move to another screen, which is defined by coordinates.
The second one is Tom (a character), which is defined by a sprite.
Both have depths, in order to know which one will have priority if their areas overlap.
There can only be one clicker you can interact with at the mouse cursor position, otherwise this would cause nasty effects, such as several things happening at the same time!
These clickers appear when you ask to display hotspots in the game! (SPACE bar)
Then, we must display the graphics.
The main background covers the whole screen and is displayed directly.
The sky is another background, but this one has a lower depth (so the main background covers a part of it) and it moves at a defined speed.
Finally, we must include the animations.
Again, I have programmed elements for the needs of Demetrios, that I call "generic objects".
I give them sprites (either one frame if static, or several frames if it's an animation), a location on the screen, the animation speed, and whether the animation should stop when reaching the last frame, or repeat it.
In the next parts, I will explain the game dialogs and translations system!
Here's another interesting project on Kickstarter currently!
A beautiful hand-animated 2D RPG! 4 days left to support it! https://www.kickstarter.com/projects/plugindigitallabel/aurion-legacy-of-the-kori-odan