My goal for this lesson was to make an area that would kill platform sprites that entered the area to stop them updating.



Here I have created a “deathZone” sprite by using my ground texture but scaling the image to appear as a straight invisible line. I also had to disable gravity as each time I would load my game, the “deathZone” would fall out of the map. In line 81 I added an overlap between the objects that runs “destroyPlat” and passes in the two objects as its parameters.

The result with the debug option enabled looks like this: