Hello.
After many frustrating days of trial and error and several deinstallations and reinstallations of Defold, I decided to do one last try before giving up at all.
I’m trying to create a point-and-click adventure. In my opinion this type of game is just a background image with one or more hotspots. If the player clicks on a hotspot, one or more actions will be executed (e.g. walk to a given position, say something, take an object and put it into the inventory).
I was able to create the following collection:
As you can see there are two hotspots (which are game objects with a collision component). Then there is the pointer game object (which has also a collision component). The hotspots and the pointer have a Type of Trigger.
The pointer has the following script. If the pointer and a hotspot collide, the label beside the pointer shows the description of the hotspot.
The problem is now that this is not efficient at all. In a real point-and-click adventure there could be hundreds of hotspots. I shouldn’t use hundreds of if-else statements just to show the description of a hotspot. And don’t forget the problem that I am not able to handle the click on a hotspot at this time. I just don’t know how to do that.
Another problem is that the real game would have dozens of scenes. I think it would be a good idea to use a collection for every scene (scene 1 = scene1.collection, scene 17 = scene17.collection, …). Then I could add the hotspots for every scene as game objects with a collision component.
But does all of that really work with the pointer script above?
I just feel really overwhelmed.
Thanks in advance for your help.