CS110 Chapter Notes - Chapter 5: Finite-State Machine, Arrow Keys, Frame Rate
Document Summary
In this document, another application of fsm is examined. To be specific, moore machine is used because the output (i. e. behavior of playable character depends purely on its state) The list of quadruplets that represent the graphic animation sequence is as follows: The same is done for walk, jump up, jump down, dash, saber type 1 and saber type 2 cycles: the behaviors of the playable character include its position (x and y), health point, state, x-direction velocity, y-direction velocity. Afterward, (when init changes to zero) the y-velocity iteratively halves until reaching zero. At this point, the state is changed into jump down state and init is set to one again. 4: similarly, when jump down loop is initialized, the y-velocity is 10 downwards; afterward (as init becomes zero) the y-velocity increases by 50% until the character"s bottom point intersects with the ground rect (handled by collideg function).