Skip to content

Instantly share code, notes, and snippets.

@alexyoung
Created April 2, 2009 11:07
Show Gist options
  • Select an option

  • Save alexyoung/89140 to your computer and use it in GitHub Desktop.

Select an option

Save alexyoung/89140 to your computer and use it in GitHub Desktop.
def change_direction(direction)
@direction = direction
case direction
when :up
@direction_x = 0
@direction_y = -1
when :down
@direction_x = 0
@direction_y = 1
when :left
@direction_x = -1
@direction_y = 0
when :right
@direction_x = 1
@direction_y = 0
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment