Browse Source

More rainbowshits;

bjorn 10 years ago
parent
commit
dcc6193b71
3 changed files with 11 additions and 7 deletions
  1. 1 1
      game.lua
  2. 4 2
      hud.lua
  3. 6 4
      pigeon.lua

+ 1 - 1
game.lua

@@ -96,7 +96,7 @@ function Game:keypressed(key)
     local world
     local world
     local index
     local index
     if ctx.map.name == 'kingdumb' and ctx.map.index == 3 then
     if ctx.map.name == 'kingdumb' and ctx.map.index == 3 then
-      -- Menu
+      Context:add(Menu)
       return
       return
     elseif ctx.map.name == 'dinoland' and ctx.map.index == 3 then
     elseif ctx.map.name == 'dinoland' and ctx.map.index == 3 then
       world = 'Kingdumb'
       world = 'Kingdumb'

+ 4 - 2
hud.lua

@@ -303,7 +303,9 @@ function Hud:gui()
     g.print('Your score:', x - g.getFont():getWidth('Your score:') / 2 + 2, yy + 2)
     g.print('Your score:', x - g.getFont():getWidth('Your score:') / 2 + 2, yy + 2)
     g.setColor(255, 255, 255)
     g.setColor(255, 255, 255)
     g.print('Your score:', x - g.getFont():getWidth('Your score:') / 2, yy)
     g.print('Your score:', x - g.getFont():getWidth('Your score:') / 2, yy)
-    yy = yy + g.getFont():getHeight() + 10
+    yy = yy + g.getFont():getHeight() + 15
+
+    g.setFont('media/fonts/handDrawnShapes.ttf', 48)
     g.setColor(0, 0, 0)
     g.setColor(0, 0, 0)
     g.print(str, x - g.getFont():getWidth(str) / 2 + 2, yy + 2)
     g.print(str, x - g.getFont():getWidth(str) / 2 + 2, yy + 2)
     g.setColor(255, 255, 255)
     g.setColor(255, 255, 255)
@@ -441,7 +443,7 @@ function Hud:addScore(amount, kind, cause)
 
 
   if kind == 'person' then
   if kind == 'person' then
     self.rainbowShitCounter = self.bubble.multiplier --self.rainbowShitCounter + 1
     self.rainbowShitCounter = self.bubble.multiplier --self.rainbowShitCounter + 1
-    if self.rainbowShitCounter == Pigeon.rainbowShitThreshold then
+    if self.rainbowShitCounter % 50 == 0 then
       --self.rainbowShitCounter = 0
       --self.rainbowShitCounter = 0
       ctx.pigeon:activateRainbowShit()
       ctx.pigeon:activateRainbowShit()
     end
     end

+ 6 - 4
pigeon.lua

@@ -431,12 +431,14 @@ function Pigeon:updateFeet()
 end
 end
 
 
 function Pigeon:activateRainbowShit()
 function Pigeon:activateRainbowShit()
-  self.rainbowShitTimer = self.rainbowShitTimer + 5
+  self.rainbowShitTimer = 5--self.rainbowShitTimer + 5
   self.rainbowShits = self.rainbowShits + 1
   self.rainbowShits = self.rainbowShits + 1
   ctx.backgroundSound:pause()
   ctx.backgroundSound:pause()
-  self.rainbowShitSound = ctx.sound:loop('disco', function(sound)
-    sound:setVolume(1)
-  end)
+  if not self.rainbowShitSound or self.rainbowShitSound:isStopped() then
+    self.rainbowShitSound = ctx.sound:loop('disco', function(sound)
+      sound:setVolume(1)
+    end)
+  end
   flux.to(self.animation, .2, {scale = 1}, 'elasticout')
   flux.to(self.animation, .2, {scale = 1}, 'elasticout')
 end
 end