mirror of
https://github.com/libretro/lutro-iyfct.git
synced 2024-11-23 07:59:43 +00:00
Added hit and coffe sfx.
This commit is contained in:
parent
938db12208
commit
3b5875df63
37
main.lua
37
main.lua
@ -182,22 +182,6 @@ function love.draw()
|
||||
end
|
||||
end
|
||||
|
||||
function loadResources()
|
||||
imgSprites = love.graphics.newImage("gfx/sprites.png")
|
||||
imgSprites:setFilter("nearest","nearest")
|
||||
|
||||
imgTrains = love.graphics.newImage("gfx/trains.png")
|
||||
imgTrains:setFilter("nearest","nearest")
|
||||
|
||||
imgTerrain = love.graphics.newImage("gfx/terrain.png")
|
||||
imgTerrain:setFilter("nearest","nearest")
|
||||
|
||||
fontimg = love.graphics.newImage("gfx/imgfont.png")
|
||||
fontimg:setFilter("nearest","nearest")
|
||||
imgfont = love.graphics.newImageFont(fontimg," abcdefghijklmnopqrstuvwxyz0123456789.!'-")
|
||||
imgfont:setLineHeight(2)
|
||||
end
|
||||
|
||||
function love.keypressed(key,unicode)
|
||||
if key == ' ' then -- will be space most of the time
|
||||
return -- avoid unnecessary checks
|
||||
@ -227,3 +211,24 @@ function updateScale()
|
||||
SCRNHEIGHT = HEIGHT*SCALE
|
||||
love.graphics.setMode(SCRNWIDTH,SCRNHEIGHT,false)
|
||||
end
|
||||
|
||||
function loadResources()
|
||||
-- Load images
|
||||
imgSprites = love.graphics.newImage("gfx/sprites.png")
|
||||
imgSprites:setFilter("nearest","nearest")
|
||||
|
||||
imgTrains = love.graphics.newImage("gfx/trains.png")
|
||||
imgTrains:setFilter("nearest","nearest")
|
||||
|
||||
imgTerrain = love.graphics.newImage("gfx/terrain.png")
|
||||
imgTerrain:setFilter("nearest","nearest")
|
||||
|
||||
fontimg = love.graphics.newImage("gfx/imgfont.png")
|
||||
fontimg:setFilter("nearest","nearest")
|
||||
imgfont = love.graphics.newImageFont(fontimg," abcdefghijklmnopqrstuvwxyz0123456789.!'-")
|
||||
imgfont:setLineHeight(2)
|
||||
|
||||
-- Load sound effects
|
||||
auCoffee = love.audio.newSource("sfx/coffee.wav","static")
|
||||
auHit = love.audio.newSource("sfx/hit.wav","static")
|
||||
end
|
||||
|
@ -99,6 +99,8 @@ function Player:kill(status)
|
||||
end
|
||||
|
||||
scrn_shake = 0.25
|
||||
auHit:stop()
|
||||
auHit:play()
|
||||
|
||||
if coffee >= 5 then
|
||||
self.invul = true
|
||||
@ -152,6 +154,7 @@ function Player:collideWithTrain()
|
||||
train.hasCoffee = false
|
||||
coffee = coffee + 1
|
||||
if coffee > 5 then coffee = 5 end
|
||||
auCoffee:stop() auCoffee:play()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
BIN
sfx/coffee.wav
Normal file
BIN
sfx/coffee.wav
Normal file
Binary file not shown.
BIN
sfx/hit.wav
Normal file
BIN
sfx/hit.wav
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user