Skip to content

Warrior jumps to other end while behaving as if still at first end #73

Description

@auno

In level 7, the following code will cause the warrior to seemingly jump to the other end of the level, while still taking damage and attacking as if it's still back at the first end.

class Player
  def play_turn(warrior)
    @counter ||= 0

    case @counter
    when 0
      warrior.pivot! :backward
    when 1
      warrior.pivot! :forward
    when 2
      warrior.walk!
    else
      warrior.attack!
    end

    @counter += 1
  end
end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions