Any idea on how to make a simple replica template of 4pics 1 word using defold?

Hi there,…i just want to get some help from you guys out there…i want to make a new game which is like the 4 pics 1 word …but what i only wanted to learn is to how can i make those buttons?..i mean if i pressed the button it will go to the box and if i pressed the button on the box,…it will remove there and go to it’s container…can you give me a little idea?..or if someone have a sample…can i get a copy so i can study it?..thank you very much!..

(Sample of what i wanted to learn how to make:)

2 Likes

Try following the magic link tutorial, especially the parts on moving objects around and animation. The function you are looking for has the following format:

go.animate(".", “position”, go.PLAYBACK_ONCE_FORWARD, vmath.vector3(X,Y,Z), go.EASING_LINEAR, 0.2)

The first argument assumes you are dealing with the current game object (can be called remotely, see docs for details)
Second one tells us which attribute should change (this could be rotation, position, etc.)
Third specifies that the animation should only be done once and not loop
Fourth argument is perhaps the most important, you need to provide a vector with coordinates that specify where to move
Fifth one specifies the easing function, for a quick demo see https://www.bookofdefold.com/examples/DefoldEasingEquations/
The last one specifies time to finish the animation

For in-depth doc, see http://www.defold.com/manuals/properties/

Have fun

2 Likes

Hi, not sure if this will help… Here’s a link for clickable game objects. I’m on holiday in the sun and doing this on my phone and can’t find the link button, so I’m just pasting it.

2 Likes

If you want to animate boxes/buttons with one letter each you can either create theme as game objects containing sprites with the letters in an atlas or create the whole thing using gui as box and text nodes. In either case you’ll need to use the go.animate or gui.animate functions to move them.

Detecting input is easier using gui.pick_node, but it’s not very complicated to do using go either (check link in other reply).

Thanks for your reply :’)…actually, my plan is not to animate the gui nodes whenever it gets click/tap…i want it to just instantly go to the guess box whenever i click any letter(s) from the rumble letters container…i actually saw and created a replica of the game but i made it thru VB and it was easier as it supports object “Index” (same names of all object controls but only differ in object index)…




Either set the sixth argument of go.animate to zero or call the go.set_position function which accepts a vector with arguments as its sole argument from a script included in the object.