Apr 292019
 

Broadcasting messages is a useful way of passing information between sprites.  An example of this is when a level finishes maybe because a character gets to the end point – sprites might need to hide/show, return to start points, background change…

In our game, a key point is when the time runs out, eg darkness comes.  Lots of things need to happen at this point, eg air raid siren, planes, bombs, main sprite – no more movement…

Ideas

  1. Call a message “night” or “darkness”
  2. Desice what needs to happen when sprites/backgrounds receive this message
    1. Main sprite could  when it receives “night”
    2. Bomb/plane code starts with “when I receive” instead of green flag

 

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.