Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save alexyoung/89142 to your computer and use it in GitHub Desktop.
@segments.reverse.each_with_index do |segment, i|
if i + 1 == length
segment.move_by @direction_x, @direction_y
else
next_segment = @segments.reverse[i + 1]
segment.move_to next_segment.x, next_segment.y
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment