| | | |
| - - Titles in Boodler start with a capital letter, | | - - Titles in Boodler start with a capital letter, |
| but do not capitalize each word after that. | | but do not capitalize each word after that. |
| | | |
| - Add these lines: | | - Add these lines: |
| | | |
| n | from boopak.package import * | n | `from boopak.package import *` |
| from boodle import agent, builtin | | `from boodle import agent, builtin` |
| | | |
| - Make sure your Agent classes are defined as | | - Make sure your Agent classes are defined as |
| | | |
| n | class MyAgentName(agent.Agent): | n | class MyAgentName(agent.Agent): |
| | | |
| - - If you really want to use the `class MyAgentNa | | - - If you really want to use the `class MyAgentNa |
| me(agent.Agent):` format, add an import line of th | | me(agent.Agent):` format, add an import line of th |
| e form `from boodle.agent import Agent`. | | e form `from boodle.agent import Agent`. |
| | | |
| - Call `bimport()` for each package you want to im | | - Call `bimport()` for each package you want to im |
| port. | | port. |
| | | |
| - - All sound sample files live in packages now, s | | - - All sound sample files live in packages now, s |
| o you'll have to import them this way. | | o you'll have to import them this way. |
| | | |
| - - Sounds that used to be in the Boodler sound li | | - - Sounds that used to be in the Boodler sound li |
| brary are now mostly in `org.boodler.old...` packa | | brary are now mostly in `org.boodler.old...` packa |
| ges. For example, you might do this: | | ges. For example, you might do this: |
| | | |
| n | water = bimport('org.boodler.old.water') | n | water = bimport('org.boodler.old.water') |
| | | |
| - Instead of referring to a sound as a string, ref | | - Instead of referring to a sound as a string, ref |
| er directly to the object in the imported package. | | er directly to the object in the imported package. |
| For example: | | For example: |
| | | |
| n | # replace this:
| n | \# replace this:
|
| self.sched_note('environ/rain-heavy.aiff') | | self.sched_note('environ/rain-heavy.aiff') |
| | | |
| # with this:
| | \# with this:
|
| self.sched_note(water.rain_heavy) | | self.sched_note(water.rain_heavy) |
| | | |
| - - No quotes, no `.aiff` suffix, and dashes have | | - - No quotes, no `.aiff` suffix, and dashes have |
| generally turned into underscores. Examine the pac | | generally turned into underscores. Examine the pac |
| kage contents to see the exact names of the sound | | kage contents to see the exact names of the sound |
| files. | | files. |
| | | |
| - Built-in agents like `FadeOutAgent`, `FadeInOutA | | - Built-in agents like `FadeOutAgent`, `FadeInOutA |
| gent`, `StopAgent` are now in the `builtin` module | | gent`, `StopAgent` are now in the `builtin` module |
| . You will have to say, for example: | | . You will have to say, for example: |
| | | |
| n | self.sched_agent(builtin.StopAgent()) | n | self.sched_agent(builtin.StopAgent()) |
| | | |
| - Change all `__init__()` functions in your agent | | - Change all `__init__()` functions in your agent |
| classes to `init()`. Remove this line wherever it | | classes to `init()`. Remove this line wherever it |
| appears: | | appears: |
| | | |
| t | # no longer needed: | t | \# no longer needed: |
| Agent.__init__(self) | | Agent.__init__(self) |
| | | |
| - Make sure the arguments to `init()` are the righ | | - Make sure the arguments to `init()` are the righ |
| t types. Don't use an integer for a default value | | t types. Don't use an integer for a default value |
| if you want the user to be able specify a float. F | | if you want the user to be able specify a float. F |
| or list arguments, you should declare an `_args` f | | or list arguments, you should declare an `_args` f |
| ield to specify the list type. | | ield to specify the list type. |
| | | |
| - Remove the `float(...)`, `int(...)`, etc casts f | | - Remove the `float(...)`, `int(...)`, etc casts f |
| rom your `init()` method. Those conversations now | | rom your `init()` method. Those conversations now |
| occur automatically. | | occur automatically. |
| | | |