Added small animations when bullets hit something
This commit is contained in:
parent
7cc7ec207d
commit
aa11cbbb2e
6 changed files with 11 additions and 0 deletions
|
@ -1,8 +1,10 @@
|
|||
Class = require 'hump.class'
|
||||
require 'entities/physicsentity'
|
||||
require 'entities/animation'
|
||||
require 'settings'
|
||||
|
||||
local TINYSHOT_SOUND = love.audio.newSource("resources/audio/chaingun.mp3", "static")
|
||||
local explosionFrames = AnimationFrames("resources/graphics/miniexplosion-%04d.png", 4, 15)
|
||||
|
||||
TinyShot = Class{
|
||||
__includes = Rectangle,
|
||||
|
@ -34,6 +36,10 @@ TinyShot = Class{
|
|||
end
|
||||
end;
|
||||
|
||||
wasHit = function(self)
|
||||
Animation(self.body:getX(), self.body:getY(), self.level, explosionFrames)
|
||||
end;
|
||||
|
||||
draw = function(self)
|
||||
love.graphics.setColor({255, 0, 0, 255})
|
||||
Rectangle.draw(self)
|
||||
|
|
|
@ -3,6 +3,7 @@ require 'entities/physicsentity'
|
|||
require 'settings'
|
||||
|
||||
local VICKERS_SOUND = love.audio.newSource("resources/audio/vickers77.mp3", "static")
|
||||
local explosionFrames = AnimationFrames("resources/graphics/miniexplosion-%04d.png", 4, 15)
|
||||
|
||||
Vickers77 = Class{
|
||||
__includes = Rectangle,
|
||||
|
@ -35,6 +36,10 @@ Vickers77 = Class{
|
|||
end
|
||||
end;
|
||||
|
||||
wasHit = function(self)
|
||||
Animation(self.body:getX(), self.body:getY(), self.level, explosionFrames)
|
||||
end;
|
||||
|
||||
draw = function(self)
|
||||
Rectangle.draw(self)
|
||||
end;
|
||||
|
|
BIN
resources/graphics/miniexplosion-0000.png
Normal file
BIN
resources/graphics/miniexplosion-0000.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 551 B |
BIN
resources/graphics/miniexplosion-0001.png
Normal file
BIN
resources/graphics/miniexplosion-0001.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 683 B |
BIN
resources/graphics/miniexplosion-0002.png
Normal file
BIN
resources/graphics/miniexplosion-0002.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 702 B |
BIN
resources/graphics/miniexplosion-0003.png
Normal file
BIN
resources/graphics/miniexplosion-0003.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 872 B |
Loading…
Reference in a new issue