Bläddra i källkod

People; Zoom;

bjorn 10 år sedan
förälder
incheckning
0e6c548ace
4 ändrade filer med 9 tillägg och 1 borttagningar
  1. 3 0
      deps/view.lua
  2. 1 1
      dinoland.lua
  3. 4 0
      hud.lua
  4. 1 0
      person.lua

+ 3 - 0
deps/view.lua

@@ -215,6 +215,9 @@ function View:follow()
   self.x = x - self.width * margin
   self.y = ctx.map.height - self.height
   self.scale = self.frame.height / self.height
+
+  local extra = ctx.hud.deathBulge > 5 and (ctx.hud.deathBulge * -.01) or 0
+  self.scale = math.lerp(self.scale, self.scale + extra, 8 * ls.tickrate)
 end
 
 function View:contain()

+ 1 - 1
dinoland.lua

@@ -121,7 +121,7 @@ function Dinoland:spawnHuts()
     ctx.enemies:add(Caveman, {x = 3500 + love.math.random() * 900, y = self.height - self.ground.height - 150})
   end
 
-  for i = 1, 20 do
+  for i = 1, 25 do
     ctx.enemies:add(Caveman, {x = 5100 + love.math.random() * 400, y = self.height - self.ground.height})
   end
 end

+ 4 - 0
hud.lua

@@ -37,6 +37,8 @@ function Hud:init()
   self.win.height = 500
   self.win.x = -400
   self.win.prevx = self.win.x
+
+  self.deathBulge = 0
 end
 
 function Hud:update()
@@ -66,6 +68,8 @@ function Hud:update()
   self.rainbowShitDisplay = math.lerp(self.rainbowShitDisplay, self.rainbowShitCounter, 8 * ls.tickrate)
 
   self.scoreDisplay = math.lerp(self.scoreDisplay, self.score, 5 * ls.tickrate)
+
+  self.deathBulge = math.lerp(self.deathBulge, 0, 4 * ls.tickrate)
 end
 
 function Hud:gui()

+ 1 - 0
person.lua

@@ -115,6 +115,7 @@ end
 ----------------
 Person.dead = {}
 function Person.dead:enter()
+  ctx.hud.deathBulge = ctx.hud.deathBulge + 1
   self.body:setFixedRotation(false)
   self.fixture:setCategory(ctx.categories.debris)
   self.fixture:setFriction(0.25)