Title: Challenge 2 - Push A Bear
Course: Game Design and Development I

Game Maker Challenge - Push a Bear

You need to set the direction of the object that is doing the pushing. Set the direction variable for the left, right, up and down arrows. Then you can run tests (if statements) to push the bear in the correct direction conditional on whether the bear has a free place to go to.

It's best to place code the bear colliding with the pushing object (and not the other way around) because it's easier to check whether there is a place free for the bear to be pushed in a given direction.

The code is just shown for moving east

Information about object: objBear

Collision Event with object objGhost:

if expression objGhost.direction=0 is true // moving east

if relative position (24,0) is collision free for Only solid objects

move relative to position (24,0)

play sound sndBoink2; looping: false