Added a state machine class and applied it to Block_sprite.