Skip to content

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

@auno

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

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