forked from hacketyhack/hacketyhack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDuel.rb
More file actions
37 lines (33 loc) · 993 Bytes
/
Copy pathDuel.rb
File metadata and controls
37 lines (33 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
waists = ["<|\\/|>\n",
"<|--|>\n",
"<|/\\|>\n"]
legs = ["/ \\/ \\",
" |\\ |\\"]
insults = ["You shriveled\nsack of donuts!",
"En guarde,\nvile hound!",
"\nUncouth!",
"Nice going,\n Gus!",
"Your fly\nis down.",
"Get away,\ncurs-ed janitor!"]
window :width => 400, :height => 400 do
background black
@swords = stack :top => 80, :left => 0 do
para @insult = span("\n\n"),
:font => "Lacuna",
:stroke => white, :size => 14, :margin => 0
para "~o o~\n",
@waist = span("<|\\/|>\n"),
@leg = "/ \\/ \\", :font => "Liberation Mono",
:stroke => white, :size => 24
end
animate do |i|
if i % 30 == 0
@insult.replace(insults[(0..insults.length).rand],
(i % 60) == 0 ? "\n /" : "\n \\")
end
@waist.replace waists[i % 3]
@leg.replace legs[i % 2]
x = (Math.sin(i * 0.22) * 100) + 140
@swords.left = x.to_i
end
end