External Exam Download Resources Web Applications Games Recycle Bin

Movement

1. set up room with ghost sprite and object, put ghost in middle of room:

2. code keydown left event of objGhost:

3. work out right, up, down yourself (up and down are Y Coordinate)

4. to keep object from going outside the room, use Add Event → Other → Intersect Boundary to check if the object has hit the inside edge of the room:

both xprevious and yprevious are the last place the object was located. you can hit the 'plus' on the left to set 2 Instance Variables in 1 block.