Skip to content

Commit

Permalink
Version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Stabyourself committed Nov 30, 2015
0 parents commit bcca692
Show file tree
Hide file tree
Showing 81 changed files with 3,660 additions and 0 deletions.
Binary file added 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added accent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions backgroundblock.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
backgroundblock = class:new()

function backgroundblock:init(x, y, width, height, dir, speed)
self.x = x
self.y = y
self.width = width
self.height = height
self.dir = dir
self.speed = speed
self.r = 0
end

function backgroundblock:update(dt)
if self.dir == "hor" then
self.x = self.x + self.speed*dt
if self.x < -screenwidth-self.width or self.x > screenwidth*2+self.width then
self.x, self.y, self.width, self.height, self.dir, self.speed = unpack(newBox())
end
else
self.y = self.y + self.speed*dt
if self.y < -screenheight-self.height or self.y > screenheight*2+self.height then
self.x, self.y, self.width, self.height, self.dir, self.speed = unpack(newBox())
end
end
end

function backgroundblock:draw()
if self.x+self.width >= -menuoffsetx and self.x < -menuoffsetx+screenwidth and self.y+self.height >= -menuoffset and self.y < -menuoffset+screenheight then
fillR, fillG, fillB = unpack(fillcolor)
if self.dir == "hor" then
fillR = fillR * (1-self.width/100)
fillG = fillG * (1-self.width/100)
fillB = fillB * (1-self.width/100)
else
fillR = fillR * (1-self.height/100)
fillG = fillG * (1-self.height/100)
fillB = fillB * (1-self.height/100)
end
drawblock(self.x+menuoffsetx, self.y+menuoffset, self.width, self.height, {fillR, fillG, fillB}, outlinecolor, self.r)
end
end
141 changes: 141 additions & 0 deletions block.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
block = class:new()

function block:init(x, y, z, i)
self.x = x
self.y = y
self.z = z
self.tilenum = i
-- 1 2 3 4 top
self.facevisible = {true, true, true, true, true}

self.facecolor = {}
self.facecolor[1] = {255, 0, 0}
self.facecolor[2] = {0, 255, 0}
self.facecolor[3] = {0, 0, 255}
self.facecolor[4] = {255, 255, 0}
self.facecolor[5] = {255, 255, 255}


self.gridcolor = {}
self.gridcolor[1] = {100, 100, 100}
self.gridcolor[2] = {150, 150, 150}
end

function block:updatevisiblefaces()
--side1
if self.z == mapdepth then
self.facevisible[1] = true
elseif map[self.x][self.y][self.z+1].tilenum ~= 1 then
self.facevisible[1] = false
else
self.facevisible[1] = true
end

--side2
if self.x == mapwidth then
self.facevisible[2] = true
elseif map[self.x+1][self.y][self.z].tilenum ~= 1 then
self.facevisible[2] = false
else
self.facevisible[2] = true
end

--side3
if self.z == 1 then
self.facevisible[3] = true
elseif map[self.x][self.y][self.z-1].tilenum ~= 1 then
self.facevisible[3] = false
else
self.facevisible[3] = true
end

--side4
if self.x == 1 then
self.facevisible[4] = true
elseif map[self.x-1][self.y][self.z].tilenum ~= 1 then
self.facevisible[4] = false
else
self.facevisible[4] = true
end

--top
if self.y == mapheight then
self.facevisible[5] = true
elseif map[self.x][self.y+1][self.z].tilenum ~= 1 then
self.facevisible[5] = false
else
self.facevisible[5] = true
end
end

----------------------------------

menublock = class:new()

function menublock:init(x, y, z, i)
self.x = x
self.y = y
self.z = z
self.tilenum = i
-- 1 2 3 4 top
self.facevisible = {true, true, true, true, true}

self.facecolor = {}
self.facecolor[1] = {255, 0, 0}
self.facecolor[2] = {0, 255, 0}
self.facecolor[3] = {0, 0, 255}
self.facecolor[4] = {255, 255, 0}
self.facecolor[5] = {255, 255, 255}


self.gridcolor = {}
self.gridcolor[1] = {100, 100, 100}
self.gridcolor[2] = {150, 150, 150}
end

function menublock:updatevisiblefaces()
--side1
if self.z == menumapdepth then
self.facevisible[1] = true
elseif menumap[self.x][self.y][self.z+1].tilenum ~= 1 then
self.facevisible[1] = false
else
self.facevisible[1] = true
end

--side2
if self.x == menumapwidth then
self.facevisible[2] = true
elseif menumap[self.x+1][self.y][self.z].tilenum ~= 1 then
self.facevisible[2] = false
else
self.facevisible[2] = true
end

--side3
if self.z == 1 then
self.facevisible[3] = true
elseif menumap[self.x][self.y][self.z-1].tilenum ~= 1 then
self.facevisible[3] = false
else
self.facevisible[3] = true
end

--side4
if self.x == 1 then
self.facevisible[4] = true
elseif menumap[self.x-1][self.y][self.z].tilenum ~= 1 then
self.facevisible[4] = false
else
self.facevisible[4] = true
end

--top
if self.y == menumapheight then
self.facevisible[5] = true
elseif menumap[self.x][self.y+1][self.z].tilenum ~= 1 then
self.facevisible[5] = false
else
self.facevisible[5] = true
end
end
34 changes: 34 additions & 0 deletions blocks.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
griddarkenfactor = 0.7

--Colors for .png loading
tilecolors = {}
tilecolors[1] = {255, 255, 255}
tilecolors[2] = { 0, 0, 0}
tilecolors[3] = {255, 0, 0}
tilecolors[4] = { 0, 255, 0}
tilecolors[5] = {255, 0, 255}

specialcolors = {}
specialcolors[1] = { 0, 0, 255} --PLAYER
specialcolors[2] = {255, 255, 0} --COIN

--BLOCK COLORS
blockcolors = {} --First 4 are sides (I think they go clockwise(viewed from top)), 5 is top.
blockcolors[1] = {}
blockcolors[2] = {{220, 220, 220}, {220, 220, 220}, {220, 220, 220}, {220, 220, 220}, {220, 220, 220}}
blockcolors[3] = {{220, 0, 0}, {220, 0, 0}, {220, 0, 0}, {220, 0, 0}, {220, 0, 0}}
blockcolors[4] = {{ 0, 220, 0}, { 0, 220, 0}, { 0, 220, 0}, { 0, 220, 0}, { 0, 220, 0}}
blockcolors[5] = {{190, 206, 248}, {190, 206, 248}, {190, 206, 248}, {190, 206, 248}, {190, 206, 248}}

--grid colors
gridcolors = {}
for i = 2, #blockcolors do
gridcolors[i] = {}
for j = 1, 2 do
gridcolors[i][j] = {}
for k = 1, 3 do
gridcolors[i][j][k] = blockcolors[i][6-j][k] * griddarkenfactor
end
gridcolors[i][j][4] = 255
end
end
44 changes: 44 additions & 0 deletions class.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
--[[
Copyright (c) 2009 Bart Bes
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
]]

__HAS_SECS_COMPATIBLE_CLASSES__ = true

local class_mt = {}

function class_mt:__index(key)
return self.__baseclass[key]
end

class = setmetatable({ __baseclass = {} }, class_mt)

function class:new(...)
local c = {}
c.__baseclass = self
setmetatable(c, getmetatable(self))
if c.init then
c:init(...)
end
return c
end
Binary file added clock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coinglow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coinsback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions conf.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function love.conf(t)
t.title = "Ortho Robot"
t.identity = "ortho_robot"
t.author = "Maurice"
t.screen.vsync = true
t.screen.fsaa = 16
t.screen.width = 1024
t.screen.height = 768
end
Binary file added font.ttf
Binary file not shown.
Loading

0 comments on commit bcca692

Please sign in to comment.