Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix String#[] on 1.8 #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/roflbalt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,13 @@ def char rx, ry, ticks
' @ ',
'\+/',
' \\\\',
][ry][rx]
][ry][rx..rx]
elsif !@walking
[
' O/',
'/| ',
'/ >',
][ry][rx]
][ry][rx..rx]
else
[
[
Expand All @@ -346,7 +346,7 @@ def char rx, ry, ticks
',|\\',
' >\\',
],
][ticks / 4 % 2][ry][rx]
][ticks / 4 % 2][ry][rx..rx]
end
end
def acceleration
Expand Down Expand Up @@ -410,7 +410,7 @@ def template
]
end
def pixel x, y, rx, ry, ticks
Pixel.new template[ry][rx], 244, 234
Pixel.new template[ry][rx..rx], 244, 234
end
end

Expand All @@ -430,7 +430,7 @@ def template
]
end
def pixel x, y, rx, ry, ticks
Pixel.new template[ry][rx], FG, BG
Pixel.new template[ry][rx..rx], FG, BG
end
end

Expand Down Expand Up @@ -470,7 +470,7 @@ def pixel x, y, rx, ry, ticks
Pixel.new char(rx, ry, ticks), 246, @background.color(x, y)
end
def char rx, ry, ticks
@frames[ticks % 2][ry][rx] || " "
@frames[ticks % 2][ry][rx..rx] || " "
rescue
" " # Roflcopter crashes from time to time..
end
Expand Down
Empty file added test/.gitkeep
Empty file.