+ 2
How my game over if red box hits yellow box
2 Answers
+ 1
Add collision testing in upo() and downo()
If posX > posY && posX < posY + yHeight
then do something.
If posY > posX && posY < posX + x Height
then do something
0
You must check videos related collision detection on YouTube.