How to set conditions dictating which of two actors appear post-collision?

johnsheerin215johnsheerin215 Member, BASIC Posts: 20

Actor A collides with actor B, destroying A and simultaneously lowering the score by 1. I now need to build in a condition where, if the score is now 0, actor C (a game over message) spawns, but if the score is still greater than or equal to 1, actor D (warning message) spawns.

Any advice on how to tie a given character's spawning to the score?

All help greatly appreciated.

Comments

  • IceboxIcebox Member Posts: 1,485

    I think you answered yourself ..

    if the score is now 0, actor C (a game over message) spawns, but if the score is still >greater than or equal to 1, actor D (warning message) spawns.

    If game.score is <= 0
    spawn game over message
    otherwise
    spawn warning message

  • johnsheerin215johnsheerin215 Member, BASIC Posts: 20

    @Icebox said:
    I think you answered yourself ..

    if the score is now 0, actor C (a game over message) spawns, but if the score is still >greater than or equal to 1, actor D (warning message) spawns.

    If game.score is <= 0
    spawn game over message
    otherwise
    spawn warning message

    I know I'm on the right track but, being very new to all of this, I'm unclear as to how I establish such rules. A rule, a behavior? And I apply the condition to the actor who represents the scoreboard, or to the actor who, when destroyed, lowers the score?

    Sorry if these questions aren't detailed enough...

  • johnsheerin215johnsheerin215 Member, BASIC Posts: 20

    Bumping this in case anyone has an idea. Thanks!

  • johnsheerin215johnsheerin215 Member, BASIC Posts: 20

    @johnsheerin215 said:

    @Icebox said:
    I think you answered yourself ..

    if the score is now 0, actor C (a game over message) spawns, but if the score is still >greater than or equal to 1, actor D (warning message) spawns.

    If game.score is <= 0
    spawn game over message
    otherwise
    spawn warning message

    I know I'm on the right track but, being very new to all of this, I'm unclear as to how I establish such rules. A rule, a behavior? And I apply the condition to the actor who represents the scoreboard, or to the actor who, when destroyed, lowers the score?

    Sorry if these questions aren't detailed enough...

    I took your advice and tinkered with the "otherwise" element and that worked. Thanks!

Sign In or Register to comment.