Sunday, 11 May 2014

Stencyl custom events


Today I focused on creating custom events. These events are for creating a set of instructions that will be set off by a trigger that the developer can specify. The tutorial I used is from the Stencyl textbook on page 126 to 127. For this exercise I made a custom event called Relocate actor and this will be started by event called Restartlevel (Caps and no spaces is important to remember).
It is very vital make sure the event name is typed exactly the same as it in the custom event. If this isn't done, then the trigger won't happen.
Technically in the custom block it states "When RestartLevel happens" two blocks with the contents "set x or y to the coordinates in the scene for self". So in other words it's another method to make an actor restart from the level start after death.
Before this I had to make a behavior called health which the event "RestartLevel" must trigger in for the actor.
For this activity I used the stencyl platformer template, which I've been using for experimenting with different behaviors, events and attributes.
Therefore, I gained a new understanding of custom events, which I never tried last year. For now on, I'll be using custom events in developing games.

No comments:

Post a Comment