Creating the kit for creating

Reading Time: 2 minutes

Last week we’ve created the very basis of the entity-tree to enhance the workflow of adding the various beings into the world. Our next goal is to add a little bit even more important part of the mechanics: interacting with items. Especially: picking up stuff from the ground.

For this we’ve created some new items:

A dagger, a hammer and a chest.

The first thing I planned to achieve is to be able to click on a pickup item so the player can move to its location, and pick up the item itself. As a start, after the pickup happens the item gets destroyed. Step one is to identify somehow if the clicked entity is a pickup item we’ll check if it’s close or far away. If needed, the character will be instructed to move closer. Once the character is close enough, the pickup mechanism should be triggered. Since we want to preserve the option that NPC’s can also interact with objects, this functionality will be done in the main ancestor, LivingEntity which we created last week.

To keep things simple for now I’ve applied the Pickup logic for the hammer and the dagger, but for the chest, I kept a loose end as it will be serving its purpose when we’re creating a kind of inventory or storage. Still for the chest, the logic of getting closer before interacting is still being applied. Future me will express his thankfulness for it. 🙂

After this was done I was starting to think on having the items being highlighted. The first rough idea is to create a new shader for having the highlight effect on each of the items, and when the player moves the cursor above the object the code will switch between the original and the highlight. After implementing I’ve realised, there are other ways which might be more interesting and flexible. I’ll come back to this topic later I think, for now it’s good enough to have the interaction flow going.

So far these steps resulted in the extremely short video below:

After these steps I started to implement some Debug Tools for ourselves, but that’s for a later post 🙂

Related

Every start is hard

Hi there, and welcome to our Developer Blog. Some of you may already know us from our previous game, Saving Mikey. If you haven't yet, you can check out the game by clicking on the link, the game is available for FREE on iOS and Android!. Mikey is a text-based adventure game about our little hero who needs your assistance to survive. Creating the game…

Read More

Leave a Reply

Your email address will not be published. Required fields are marked *