10/11/22 Removing platforms


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

creation of the deathzone and managing its properties

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.

“destroyPlat” function

The result with the debug option enabled looks like this:


Leave a Reply

Your email address will not be published.