External Exam Download Resources Web Applications Games Recycle Bin

The Simplest Bounce

There used to be a block called 'Bounce' in older versions of GameMaker. It no longer exists, but can easily be re-created with 1 line of code.

1. set up room with ball and wall objects:

2. Code objBall Create event to randomize direction every time the game is replayed:

3. Code objBall Collision event with objWall to simply bounce using 1 line of code - write this into line 1 of the code box:

move_bounce_all(false);