Permalink
Browse files

Merge branch 'master' of github.com:LOVE-Party/LD24_Jam

  • Loading branch information...
2 parents f640c3c + ed893b7 commit f5ef5f68e202aa9e5133dc8ae418546d0b2749d3 @Textmode Textmode committed Aug 27, 2012
Showing with 24 additions and 5 deletions.
  1. BIN gfx/GUI_ScoreBar.png
  2. +1 −1 ship.lua
  3. +22 −4 space.lua
  4. +1 −0 weapon.lua
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -87,7 +87,7 @@ function ship:update(dt, level)
-- Hit things
for _, ship in next, Gamestate.space.enemies do
if entity:testcollision(ship) then
- ship:dohit(10)
+ ship:dohit(entity.damage)
self.entities[i] = nil
end
end
View
@@ -19,10 +19,11 @@ local BKG = love.graphics.newImage("gfx/BKG.png")
local Planet = love.graphics.newImage("gfx/Planet.png")
--GUI
-local GUI = love.graphics.newImage("gfx/GUI.png")
-local GUI_Top = love.graphics.newImage("gfx/GUI_Top.png")
-local GUI_BarBack = love.graphics.newImage("gfx/GUI_EmbossedBar.png")
-local GUI_GradientBar = love.graphics.newImage("gfx/GUI_GradientBar.png")
+local GUI = love.graphics.newImage("gfx/GUI.png")
+local GUI_Top = love.graphics.newImage("gfx/GUI_Top.png")
+local GUI_BarBack = love.graphics.newImage("gfx/GUI_EmbossedBar.png")
+local GUI_GradientBar = love.graphics.newImage("gfx/GUI_GradientBar.png")
+local GUI_Hull_Critical = love.graphics.newImage("gfx/Hull_Critical.png")
-- SFX
state.music = love.audio.newSource("sfx/BGM.ogg", 'stream') -- long audio files should be streamed
@@ -33,6 +34,8 @@ state.player = Ship.new {name = 'player';
npc = false;
}
+state.gui_hull_critical_timer = 0
+
function state.player:die(...)
Ship.die(self, ...)
@@ -207,6 +210,12 @@ function state:update(dt)
end
end
end
+
+ -- Flash GUI stuff
+ self.gui_hull_critical_timer = self.gui_hull_critical_timer + dt
+ if self.gui_hull_critical_timer >= 1 then
+ self.gui_hull_critical_timer = 0
+ end
end
function state:keypressed(key)
@@ -220,6 +229,8 @@ end
function state:draw()
local level = self.level
+ love.graphics.setColor(255, 255, 255, 255)
+
love.graphics.draw(BKG, - level.x / 2 % 800, 0)
love.graphics.draw(BKG, - level.x / 2 % 800 - 800, 0)
@@ -240,6 +251,13 @@ function state:draw()
love.graphics.draw(GUI_BarBack,3,3)
local HealthBarWidth = self.player.shield / self.player.shieldmax
love.graphics.drawq(GUI_GradientBar, HealthBarQuadCache[HealthBarWidth],3,3)
+
+ if HealthBarWidth <= 0.2 then
+ if self.gui_hull_critical_timer <= 0.5 then
+ love.graphics.setColor(255, 255, 255, 64)
+ end
+ love.graphics.draw(GUI_Hull_Critical, 32, 490, 0, 1.0, 0.73)
+ end
end
function state:drawlevel()
View
@@ -1,6 +1,7 @@
Bullet = {
speed = 200;
radius = 1;
+ damage = 10;
}
local MT = {__index = Bullet}

0 comments on commit f5ef5f6

Please sign in to comment.