This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "app/continuebox.rb" | |
class StoryBox | |
# descriptor format: | |
# StoryBox.new({ | |
# body: {x: 310, y: 230, w: 60, h: 7, font: "font/euler.otf"}, | |
# name: {x: 310, y: 280, font: "font/euler.otf"} | |
# }) | |
# body has the font, x and y coordinates of the text box, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ContinueBox | |
attr_accessor :x, :y, :w, :h, :text, :lines, :page, :line_height | |
def initialize box, font=nil | |
@x = box.x | |
@y = box.y | |
# W and H are in characters, not pixels | |
# Make sure the H you set leaves room for the "..." at the bottom | |
@w = box.w |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Array | |
def each_onto_all &block | |
self.each_index do |i| | |
self.each_index do |j| | |
if(i != j) | |
yield(self.at(i), self.at(j)) | |
end | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22222222222222223333333333333333444444444444444455555555555555556666666666666666777777777777777 | |
0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE | |
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
facts: | |
<>Warbride enemies Yarrow | |
<>Yarrow enemies GoldenYarrow | |
<>GoldenYarrow allies YellowClay | |
YellowClay enemies SouthernAlliance | |
WhiteShale member SouthernAlliance | |
IronBrick member SouthernAlliance | |
GodGiven member SouthernAlliance | |
<>NorthernKingdoms allies Yarrow | |
<>FoothillTribes allies YellowClay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def tick args | |
if(args.state.tick_count == 0) | |
args.state.debug_messages = [] | |
end | |
if(args.state.tick_count % 5 == 0) | |
debug_log args, ("working: " + args.state.tick_count.to_s) | |
end | |
debug_display args | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The text from the gist has been loaded. | |
# Click the Run game! button to execute the code. | |
# http://fiddle.dragonruby.org?share=https://gist.github.com/amirrajan/2f63f4d2fc97a81b087e6b4e6bd5bd92 | |
def tick args | |
xa = 100 + ((args.state.tick_count) % 300) | |
xb = 550 + ((args.state.tick_count/2) % 357) | |
xc = 440 + ((args.state.tick_count) % 413) | |
xd = 1000 - ((args.state.tick_count / 3) % 988) |