As a pseudo point and click, our game obviously needs an action menu. We haven't had a concept meeting with our art director about this yet, but I can already start working on the engine, no? ;)
For now, our scene looks like this:
Some elements can already be qualified as "interactive elements". As their name indicates, these are elements with which our dwarves can interact.
Some of them, like the logs or the potatoes, are meant to be taken. Others, like the frame or the oven, are meant to be used.
Let's start with the log!
The first step is to create this "InteractiveElement".
In fact, it's just a classic animated element. The only differences are:
- It must be attached to a milestone that our dwarf will move towards before interacting
- It must be able to propose a list of routines to perform (TAKE for the elements that can be taken, USE for the elements that can be used, ...)
- It must propose a list of conditions to be respected for the menu to be displayed.
- It must be attached to a list of triggers. That is to say, external elements that will still display the action menu for our element. This allows to reduce the difficulty if needed (for example for our log, we can click on the log or on the log basket)
So we have our basic element, now we have to extend it!
In reality, most of the work is already done... We just need to define the routines.
It's easy! If the conditions of appearances are true, you send me a lambda ordering the character to move to the milestone and take the object.
It is the same principle for the "usable elements" like the oven.
The only difference is the adaptation of the routine and the addition of a "use" method which will allow to define an action to execute in case of use.
So, we have our takeable and usable elements. All that remains is to develop the component that allows us to take and use them!
Don't worry, it's a lot of talk for not much =). For the moment, for more simplicity, our menu will be simply a series of texts, placed one above the other.
To represent this, we will use a "group" composed of different "text elements". Only two of these actions will be fixed and displayed no matter what happens, the first and last routine: "Go to" and "Cancel".
All that's left is to use all these new tools and by magic, our scene comes to life =)!
So, it's the end! I hope you enjoyed this article! If you liked it and would like us to make more, please let us know! Subscribe, comment it, share it, show us that you are there, it will encourage us a lot!
You can also make a donation on our ko-fi page, to support us and finance the development of our next game: 'Les Nains du Nord"!
Thank you! ♥