This content has been marked as final. Show 1 reply
I donot think you need the coordinates. I would implement it something like this:
- Use TilePane or GridPane for the grid, and put somekind of clickable control inside it -- ImageView will work for this, but perhaps a Button is better
- When you detect the click, you can determine which grid cell that was; using the size of the Pane divided by the number of cells it is high, you can find the height of an individual cell, let's say 100 pixels
- Now to animate the coin being dropped in, simply put the correct picture in the cell as if it appears there instantly... but also start a Timeline. This timeline will change the TranslateY property from -100 * number_of_cells_to_drop to 0. This will make it seem that the coin is dropped in from the top.