Code: Platform Saw

Create a New Event Sheet for the Platform Saw

Add a Group called Player Collision

When the Platform Saw collides with the Player, call the Hit function

Add a Group called Initialize Variables

Code Explanation

When the level loads

For every platform saw in the level

Set Instance variable PosTLx & PosTLy to current x and y position of the saw (top left corner)

Set Instance variable PosTRx & PosTRy to calculated position of the top right corner

Set Instance variable PosBRx & PosBRy to calculated position of the bottom right corner

Set Instance variable PosBLx & PosBLy to calculated position of the bottom left corner

Add a Group called Move Saw Around Platform

BE CAREFUL AS THE TL (TOP LEFT) TR(TOP RIGHT) etc NAMING SCHEME CAN BE CONFUSING!

Code Explanation

For every platform saw in the level

IF the X and Y Position are TOP LEFT CORNER

IF the X and Y Position are TOP RIGHT CORNER

IF the X and Y Position are BOTTOM RIGHT CORNER

IF the X and Y Position are BOTTOM LEFT CORNER



Move to TOP RIGHT CORNER


Move to BOTTOM RIGHT CORNER


Move to BOTTOM LEFT CORNER


Move to TOP LEFT CORNER