Is it possible to get return from msg.post()?

hello

I want to make a clone game from sally wizard, for my next journey on defold… the game look like the screenshoot

for now I’m using game_controller.script to create an instance enemy gameobject, and when enemy.go is init, it will create another gameobject called target_spell.go.

then if I click one of the buttons, it will send to the game_controller.script to call all instance had been created (using table), then the instance will check is first of table is same image as the button I clicked.

the question is how do I get the return value when their no one object on array(table)? or anyone have better solution for my problem?

anyway I have repository for the game

1 Like

Perhaps you have spread out your data in too many objects? Maybe it would be better to keep some information about the game in a single place (a Lua module) and manipulate the data from your various game objects.

2 Likes

ah okey2, thanks for insight.