diff --git a/assets/tutorial-1.png b/assets/tutorial-1.png index 4c088f1..0030676 100644 Binary files a/assets/tutorial-1.png and b/assets/tutorial-1.png differ diff --git a/assets/tutorial-2.png b/assets/tutorial-2.png index a03d627..7cc1f1b 100644 Binary files a/assets/tutorial-2.png and b/assets/tutorial-2.png differ diff --git a/assets/tutorial-3.png b/assets/tutorial-3.png index 59888d5..70a1ea0 100644 Binary files a/assets/tutorial-3.png and b/assets/tutorial-3.png differ diff --git a/assets/tutorial-4.png b/assets/tutorial-4.png index e24dd34..febe315 100644 Binary files a/assets/tutorial-4.png and b/assets/tutorial-4.png differ diff --git a/assets/tutorial-5.png b/assets/tutorial-5.png index 1629046..8dd39cb 100644 Binary files a/assets/tutorial-5.png and b/assets/tutorial-5.png differ diff --git a/assets/tutorial-7.png b/assets/tutorial-7.png index 73cf44c..daa10b4 100644 Binary files a/assets/tutorial-7.png and b/assets/tutorial-7.png differ diff --git a/flyers.lua b/flyers.lua index 0b34fbf..e292f11 100644 --- a/flyers.lua +++ b/flyers.lua @@ -63,7 +63,7 @@ function newFlyer (location, fixedDestination, origin, destination, color) else love.graphics.setColor(self.color.r, self.color.g, self.color.b) end - love.graphics.circle('fill', self.location.x*ZOOM, self.location.y*ZOOM, UNIT_RADIUS*0.8*ZOOM, SEGMENTS) + drawFilledCircle(self.location.x, self.location.y, UNIT_RADIUS*0.8) end function f:setVelocityTo (location) diff --git a/main.lua b/main.lua index 1b2c05f..fb1790f 100644 --- a/main.lua +++ b/main.lua @@ -22,7 +22,7 @@ FPS = 60 TURN_TIME = 30.0 ZOOM = 0.5 UNIT_RADIUS = 5 -SEGMENTS = 30 +SEGMENTS = 60 UNIVERSE_SIZE = 10 WORLD_SIZE = {width = 0, height = 0} @@ -40,9 +40,10 @@ function love.load() -- Setup window love.window.setTitle("Prospora") - love.window.setMode(600, 600, {fsaa=16}) + love.window.setMode(600, 600) love.graphics.setBackgroundColor(51, 51, 51) love.graphics.setLineStyle('smooth') + love.graphics.setPointStyle('rough') -- setup fonts font = love.graphics.newFont('assets/furore.otf', 20) @@ -139,4 +140,12 @@ end function adjustOffset () OFFSET.x = math.min(0, math.max(-WORLD_SIZE.width * ZOOM + love.graphics.getWidth(), OFFSET.x)) OFFSET.y = math.min(0, math.max(-WORLD_SIZE.height * ZOOM + love.graphics.getHeight(), OFFSET.y)) -end \ No newline at end of file +end + +-- + +function drawFilledCircle(x, y, r) + love.graphics.circle('fill', x*ZOOM, y*ZOOM, r*ZOOM-.5, SEGMENTS) + love.graphics.setLineWidth(1) + love.graphics.circle('line', x*ZOOM, y*ZOOM, r*ZOOM-.5, SEGMENTS) +end diff --git a/maths.lua b/maths.lua index fede73e..69b543a 100644 --- a/maths.lua +++ b/maths.lua @@ -46,4 +46,22 @@ function tableSize(t) count = count + 1 end return count +end + +-- + +function HSL(h, s, l, a) + if s<=0 then return l,l,l,a end + h, s, l = h/256*6, s/255, l/255 + local c = (1-math.abs(2*l-1))*s + local x = (1-math.abs(h%2-1))*c + local m,r,g,b = (l-.5*c), 0,0,0 + if h < 1 then r,g,b = c,x,0 + elseif h < 2 then r,g,b = x,c,0 + elseif h < 3 then r,g,b = 0,c,x + elseif h < 4 then r,g,b = 0,x,c + elseif h < 5 then r,g,b = x,0,c + else r,g,b = c,0,x + end + return (r+m)*255, (g+m)*255, (b+m)*255, a end \ No newline at end of file diff --git a/memes.lua b/memes.lua index edfa3b9..3430351 100644 --- a/memes.lua +++ b/memes.lua @@ -5,10 +5,20 @@ function newMeme () m.con = randomRealBetween(0, 1) m.fec = randomRealBetween(0, 1) - m.color = {r = randomIntegerBetween(55, 255), + local hue = randomRealBetween(0,240) + if hue>180 then hue=hue+120 end + hue = hue*255/360 + local sat = randomRealBetween(100,255) + local lit = randomRealBetween(100,200) + + m.color = {} + m.color.r, m.color.g, m.color.b = HSL(hue, sat, lit) + + --[[m.color = { + r = randomIntegerBetween(55, 255), g = randomIntegerBetween(55, 255), b = randomIntegerBetween(55, 255) - } + }]]-- function m:adjustGenes () local t = m.agg + m.con + m.fec @@ -124,16 +134,14 @@ function newUnit (planet, meme) end function u:draw () - local l = vMul(self.location, ZOOM) self.meme:setToMyColor() - local r = UNIT_RADIUS * ZOOM if self.growing then - love.graphics.circle('fill', l.x, l.y, r * self.animationCounter, SEGMENTS) + drawFilledCircle(self.location.x, self.location.y, UNIT_RADIUS * self.animationCounter) elseif self.dying then love.graphics.setColor(255, 255, 255, 255 * (1 - self.animationCounter)) - love.graphics.circle('fill', l.x, l.y, r * self.animationCounter * 4, SEGMENTS) + drawFilledCircle(self.location.x, self.location.y, UNIT_RADIUS * self.animationCounter * 4) self.meme:setToMyColor() - love.graphics.circle('fill', l.x, l.y, r * (1 - self.animationCounter), SEGMENTS) + drawFilledCircle(self.location.x, self.location.y, UNIT_RADIUS * (1 - self.animationCounter)) -- alert player to attacks on their home planet if self.planet == human.homeWorld and self.meme == human.meme then @@ -146,11 +154,11 @@ function newUnit (planet, meme) elseif self.flying and self.flyer ~= nil then if self.flyer.attackDrone then - love.graphics.circle('fill', l.x, l.y, r, SEGMENTS) + drawFilledCircle(self.location.x, self.location.y, UNIT_RADIUS) end self.flyer:draw() elseif not self.waiting then - love.graphics.circle('fill', l.x, l.y, r, SEGMENTS) + drawFilledCircle(self.location.x, self.location.y, UNIT_RADIUS) end end diff --git a/planets.lua b/planets.lua index 00e8be9..d84d6f5 100644 --- a/planets.lua +++ b/planets.lua @@ -94,7 +94,7 @@ function newPlanet (id, sun, unitSpaces, isHomeWorld, meme) else love.graphics.setColor(100, 100, 100) end - love.graphics.circle('fill', self.location.x*ZOOM, self.location.y*ZOOM, self.radius*ZOOM, SEGMENTS) + drawFilledCircle(self.location.x, self.location.y, self.radius) -- draw memes drawUnits(self) diff --git a/players.lua b/players.lua index 99f1cdc..2a2f615 100644 --- a/players.lua +++ b/players.lua @@ -4,7 +4,7 @@ function newPlayer () local p = {} p.meme = newMeme() - p.meme.color = {r=255, g=255, b=255} + p.meme.color = { r=50, g=186, b=250 } p.selectedPlanet = nil p.homeWorld = nil p.homeUnderAttack = false @@ -34,7 +34,7 @@ function drawHalo () d = vNormalize(d) d = vMul(d, haloRadius) d = vAdd(d, p.location) - love.graphics.circle('fill', d.x * ZOOM, d.y * ZOOM, UNIT_RADIUS, SEGMENTS) + drawFilledCircle(d.x, d.y, UNIT_RADIUS/ZOOM) end else diff --git a/screenMode-game.lua b/screenMode-game.lua index 2ef79e2..bcdb974 100644 --- a/screenMode-game.lua +++ b/screenMode-game.lua @@ -111,7 +111,7 @@ function gameMode:draw () else love.graphics.setColor(0, 170, 250, 150) end - love.graphics.circle('fill', self.handlePause.x, self.handlePause.y, 20, SEGMENTS) + drawFilledCircle(self.handlePause.x/ZOOM, self.handlePause.y/ZOOM, 20/ZOOM) love.graphics.setColor(255, 255, 255) love.graphics.setLineWidth(5) love.graphics.line(self.handlePause.x-6, self.handlePause.y-9, self.handlePause.x-6, self.handlePause.y+9) diff --git a/stars.lua b/stars.lua index bedb982..192c289 100644 --- a/stars.lua +++ b/stars.lua @@ -32,7 +32,8 @@ function newStar () function s:draw () love.graphics.setColor(self.glitter, self.glitter, self.glitter) - love.graphics.circle('fill', self.location.x*ZOOM, self.location.y*ZOOM, 0.5) + --love.graphics.circle('fill', self.location.x*ZOOM, self.location.y*ZOOM, 1) + love.graphics.point(self.location.x*ZOOM, self.location.y*ZOOM) end return s diff --git a/suns.lua b/suns.lua index 840c69e..5266c9b 100644 --- a/suns.lua +++ b/suns.lua @@ -54,9 +54,9 @@ function newSun (location, radius) function s:draw () love.graphics.setColor(255, 255, 255, 177) - love.graphics.circle('fill', self.location.x*ZOOM, self.location.y*ZOOM, (self.radius+self.corona)*ZOOM, SEGMENTS*2) + drawFilledCircle(self.location.x, self.location.y, self.radius+self.corona) love.graphics.setColor(255, 255, 255, 255) - love.graphics.circle('fill', self.location.x*ZOOM, self.location.y*ZOOM, self.radius*ZOOM, SEGMENTS*2) + drawFilledCircle(self.location.x, self.location.y, self.radius) end s.newOrbit = function (self)