Closed supercrafter100 closed 3 months ago
Oh I love this! In terms of incorporating any sound in the state manager should I merge #88 first and then incorporate those sample effects in the state manager (then I can refine and add more sound effects later?)
It might be easier doing it the other way around? Otherwise this PR will feature stuff from the sound stuff which probably isn't ideal? You can then just merge these changes into the sounds PR and immediately implement them there.
This is working well, merging and will work on incorporating sound effects next!
This PR features the following:
src/util/statemachine/State.js
that is used for classes that can be a type of state.src/util/statemachine/StateMachine.js
which handles storing state for a class that extends it. This is used by ourAgent.js
to keep track of its statesrc/lib/agent/states/*
state files for each state the agent has. All actions that have to be executed when this state is activated are located in theonActivate()
method. You can see what methods are supported by looking in theState.js
abstract class.Agent.js
file to use the new state manager and move some stuff to the appropriate state.