Skip to content

Handy Dandy Guide to Actors

sleepinghungry edited this page Jan 17, 2017 · 10 revisions

Handy Dandy Guide to Actors

Step-By-Step Guide

To create a new actor

  1. Use the Actor command:
          Actor()
    Example:
          Actor()

  2. Insert the name of your new character:
          Actor("name of character")
    Example:
          Actor("angry elf")

  3. Store your new character in a variable:       actor_variable = Actor("name of character")
    Example:
          angry_elf = Actor("angry elf")

To set your new characters starting location:

  1. Type in the actor variable:       actor_variable
    Example:
          angry_elf

  2. Attach the set_location command to it:
          actor_variable**.set_location()**
    Example:
          angry_elf.set_location()

  3. Add the location_variable of the starting location:
          actor_variable.set_location(location_variable)
    Example:
          angry_elf.set_location(playground)

To add an in-game command for an actor:

  1. Choose what actor variable you want to attach a special command to:
          actor_variable
    Example:
          angry_elf

  2. Attach the add_phrase command to it:       actor_variable**.add_phrase()**
    Example:
          angry_elf.add_phrase()

  3. Add the in-game command as the first piece of info needed by the add_phrase command:
          actor_variable.add_phrase("in-game command")
    Example:
          angry_elf.add_phrase("chat")

  4. Add what the game says when the in-game command is used (THERE ARE TWO END PARENTHESES!!!):
          actor_variable.add_phrase("in-game command", Say("What the game will say."))
    Example:
          angry_elf.add_phrase("chat", Say("The angry elf glares at you as you attempt to start a conversation."))

To add the character to the game:

  1. Use the game variable:       game_variable
    Example:
          game

  2. Add the add_actor command to it:
          game_variable**.add_actor()**
    Example:
          game.add_actor()

  3. Add the actor variable as the actor to be added to the game:       game_variable.add_actor(actor_variable)
    Example:
          game.add_actor(angry_elf)

BWX Game Engine pages

Python Pages

Step By Step Guides

Building Conditionals

Lectures

Explaining Conditionals

Assignments

I Am Thinking of a Number...

Clone this wiki locally