Object collision can be done in several ways depending on the complexity of the game.
The simplest method is to track the entire field in a 2d or 3d matrix and if the user moves into the same coordinates as an obtainable object remove the object and increment the score. This has obvious issues when it comes to large maps or complex systems that would run the hardware out of memory. So this works for something like a chess/checkers board but not a driving simulation.
The second method is to keep a linked list of objects visible on the field with it's central coordinates and it drawing directions. The objects might look like coords (1007.2053, 489.2111) shape (box)
. Where box is a function that generates all the border coordinates. Then detect collisions by checking if primary target overlaps any of the object in the list. You'll probably have to write a collision function for each shape. The simpler the shape the easier the collision function. For more complex object it's often easier just to simplify the shape to a box no mater what it looks like. This is why 3d games often have clipping errors and why you could shoot the edge of an object in a fps and still not be considered to hit it.
Your question is too broad for a better answer but Here is a very basic article that discusses the second method.
More Info. The game is apparently a 2d endless runner.
So you could set up a 2d matrix that acts as a queue. Say your board is 3 high so your character can walk, jump, or high jump.
highjump
jump
walk
This would be a simple matrix like board 10 X 3 (x, y)
With each frame the board removes the front column and adds a new column to the back. Think front of matix is left side, back is right side. When adding to back you randomly decide which box to put the coin in. In each frame the user must be in one of the 3 positions. if his position is the same as the object collect it and gain points. Or if the object is undesirable lose a life and start game over, etc.
more links
Information specific to endless runners here and another stack overflow question similar to yours here