This file contains hidden or 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
Arena = class() | |
function Arena:init(l, b, r, t) | |
-- you can accept and set parameters here | |
self.frame = Frame(l, b, r, t) | |
self.panel = Frame(l + 1, b + 1, r - 1, b + 108) | |
self.stop = Frame(r - 70, b + 35, r - 30, b + 75) | |
self.robots = {} | |
self.timer = 0 | |
end |
This file contains hidden or 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
Socket = class() | |
function Socket:init(code, x, y) | |
self.code = code | |
self.x = x | |
self.y = y | |
self.frame = Frame(x, y, x + 145, y + 32) | |
self.value = 1 | |
end |
This file contains hidden or 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
Arena = class() | |
function Arena:init(l, b, r, t) | |
self:sizeFrames(l, b, r, t) | |
self.robots = {} | |
self.timer = 0 | |
end | |
function Arena:sizeFrames(l, b, r, t) | |
self.frame = Frame(l, b, r, t) |
This file contains hidden or 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
Robot = class() | |
function Robot:init(x, y) | |
self.x = x | |
self.y = y | |
self.hp = 10 | |
self.direction = 0 | |
self.program = {} | |
self.step = 1 | |
self.wins = 0 |
This file contains hidden or 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
Arena = class() | |
function Arena:init(l, b, r, t) | |
self:sizeFrames(l, b, r, t) | |
self.robots = {} | |
self.timer = 0 | |
self.tourney = false | |
self.gameOver = false | |
self.game = 1 | |
self.pulse = 0 |
This file contains hidden or 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
OpenBtn = class() | |
function OpenBtn:init(t, x, y) | |
self.frame = Frame(x, y, x + 100, y + 30) | |
self.text = t | |
self.selected = false | |
end | |
function OpenBtn:draw() | |
pushStyle() |
This file contains hidden or 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
VColorSlider = class() | |
function VColorSlider:init(x, y) | |
self.frame = Frame(x - 30, y - 328, x + 60, y + 56) | |
self.previousY = 0 | |
self.pots = {} | |
for i = 0, 15 do | |
self.pots[i + 1] = Frame(self.frame.left, | |
self.frame.top - i * 24 - 24, | |
self.frame.right, self.frame.top - i * 24) |
This file contains hidden or 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
Arena = class() | |
function Arena:init(l, b, r, t) | |
self.robots = {} | |
self.timer = 0 | |
self.tourney = false | |
self.gameOver = false | |
self.game = 1 | |
self.pulse = 0 | |
self.pulseDirection = 2 |
This file contains hidden or 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
Frame = class() | |
-- Frame | |
-- ver. 1.0 | |
-- a simple rectangle for holding controls. | |
-- ==================== | |
function Frame:init(left, bottom, right, top) | |
self.left = left | |
self.right = right |
This file contains hidden or 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
TokenTray = class() | |
function TokenTray:init(x, y) | |
-- you can accept and set parameters here | |
self.x = x | |
self.y = y | |
self.frame = Frame(x, y, x + 200, y + 850) | |
self.selected = 0 | |
self.tokens = {} | |
self.tokens[1] = Token(codes[1], 30, 0, 1) |