From c370f3576d1cac7aee1550c8f3c00c3c7e4ce1ed Mon Sep 17 00:00:00 2001 From: Andros Date: Thu, 17 May 2018 00:03:13 +0200 Subject: [PATCH] add explosion animate --- assets/sprites/explosion.png | Bin 0 -> 15610 bytes main.lua | 70 +++++++++++++++++++++++++---------- 2 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 assets/sprites/explosion.png diff --git a/assets/sprites/explosion.png b/assets/sprites/explosion.png new file mode 100644 index 0000000000000000000000000000000000000000..11a3372daf8114c7d3d2c4e32f68140de9e5baf6 GIT binary patch literal 15610 zcmcJ$bzECb_b(b;iRud z6^8~n;rYGyJ@?%6_s!>%WcIAJ*IqNTW@hbK-xZ^)t@?Kl3+YH3Q^xV!RO*}7Xp`Tboz&~yMmO4i@Q%ElS$&1?;|cXX3x zJ!NH^-Rk{5$fQm7U&7p3)I%P33RrRuw|8%A(Zl$L^e@8oI!~e>+arCg_ck&Q;s1^|9e5Ge(OvLgx&H^Zzm>=T#cbt+?xX)S^8aA|uO?`Y|Iy}uRF+h= za&@(mW)&0^5dBxl|5R&2-MqBiZJ{pzY3GA#lIpHj_E0p%-rGT%RYL4v{{KyQ?P&W@ zFDNJ~^e+XixTK;d)XLl4Q{UYkEy%;l(aoFR4Q&M?{LlFR=W%FtBp;rIevH7wm3%LyCL;JiO(!kqL}?p=Lt%|;Q0{g#>lcd@QU!ta*S z*R)Q^#LvCtcXK6AJeG;(KN z75$0%`uY(21H_TU5Z1V>Xb zlXe7PC-;{yxy}@=#_EkBnn{ceyRd@A9~!^q*Hs|1LWJ-yisURX^Fq z5ox^t65tsRHF9D9t?1;E^LM~A#d{`tFM5gn|5V2%P|-)ml9DAyo>p()&poY`oq^4b zyt#GL3Xyx@2{Y^cTPrRC0POCZ_s{F7jv}^eJZ?Ly^uTi8>qJPs;4k>mM8H=YxrmIs z6xe3BC=IFkJt@fwkhN%K{C>YR0m1a-=uW`s(pX`V|3i2s&TZwWeR}8o5#zTB^o^bI z0CH=_jpjOl{PYu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y zRBVkg&VMx!(A5c0!R0UY3gx zyk{zS0u`ZPz0Z** z&VC7HL3R#}HO*HC9ql$8D%~Ewq~l}s-u4l0cN29l90#(i)Q7pLG7jCW0z^_IQi$*% z<}$oxQa)rakxUXv@>jKt|Q2pkg)=kV6AykAhvX#G}7@L+*lAjqLqNocX zTMgKr!ikaa>*U&8V;1pKwtjmq4*rxh_qa@S977;e69AW3?|)Yprci2W>@hL-LQ%*U9>;ta0z!kSmjouz z;Gpb{CL03Ka_EfcpFT^e>da}If%RwRVj4X1av$ZMZQylpXYMHr8-&ddHJ2yXk{C#s z{0@k$`VgujI&({ZDn69CkX$jB%I8a(V!mhgjRc(=@jL9^3h>ETVWNsa7VW!`gD~u( zCF-q-6Y>y5vJ^&yWxe6(^p+hozyeZ2C}Z5Sirjdf2VhSaujjsdCdqspQGg~(c9jvU zY+eN3!q2ad%aK1UXLtmM1S4k@^akG9IYH)4Dc|>I>qq9;yOMMDCpG~U_H>I!8#%`e z$2loa^E?Q0&`*7O+3xPmcUWT>{vCS!h-aABqE|9CEgHBr21QpTd#b|FO*g#2^q z`IzJVGKB=KS_P`ny9!K>Aum}etA|eb5cy+8*oke(O7@8xw=`PDFaM@_n}LW`M}{SV z8GMtpROTt=26s(IH_}r}&*#JM4E&Vj%;K0BIYkrC#t678R zla{ot%54$-o;guc=A!E=9&A4Ja3Z?y^#K`)iDV+!(J$7Mtf?3%JUr(|hi_-Xo-9TQ zDM;xs7iIg*;EqeIX^jZ0xu;JCwgMq-@}5csEF3)&D6D*zqG7V*B4zn6xDwkx|5@NeReX!v~$#xqLA_ssaRr@x?Qa#yq}pTXpMtYg#rGKiGU zYCF`Q33O~YHHCUJS{ux9E{Qm7sUwoZ$3k}@^&eRw03Guy;vJ$Z~qs@p?L!U literal 0 HcmV?d00001 diff --git a/main.lua b/main.lua index 207ecb9..f0fbca5 100644 --- a/main.lua +++ b/main.lua @@ -48,6 +48,20 @@ function love.load() asteroid.speed = 600 asteroids[i] = asteroid end + -- Explosion + explosion = {} + explosion.img = love.graphics.newImage('assets/sprites/explosion.png') + explosion.x = 0 + explosion.y = 0 + explosion.num_frames = 12 + explosion.pos_frame = 1 + explosion.animate = false + explosion.frame_width = explosion.img:getWidth() / explosion.num_frames + explosion.frame_height = explosion.img:getHeight() + explosion.frames = {} + for i = 1, explosion.num_frames do + explosion.frames[i] = love.graphics.newQuad(explosion.frame_width * (i - 1), 0, explosion.frame_width, explosion.frame_height, explosion.img:getWidth(), explosion.img:getHeight()) + end -- Sounds sounds = {} sounds.die = love.audio.newSource('assets/sounds/die.wav', 'static') @@ -58,14 +72,6 @@ end local my_time_restart = 0 function love.update(dt) - if not game.play then - my_time_restart = my_time_restart + dt - if my_time_restart > game.time_restart then - game.play = true - game.score = 0 - my_time_restart = 0 - end - end -- Score if game.play then game.score = game.score + dt * 100 @@ -77,17 +83,41 @@ function love.update(dt) spaceship.pos_frame = 1 end -- Asteroids - for key, asteroid in pairs(asteroids) do - asteroid.x = asteroid.x - (dt * asteroid.speed) - if asteroid.x < -asteroid.img:getWidth() then - asteroid.x = game.width + math.random(0, game.width) - asteroid.pos = math.random(1, 3) - end - -- Colision - if checkCollision(spaceship.x, spaceship.y[spaceship.pos], spaceship.img:getWidth(), spaceship.img:getHeight() / spaceship.num_frames / 2, asteroid.x, asteroid.y[asteroid.pos], asteroid.img:getWidth(), asteroid.img:getHeight()) then - game.play = false - sounds.die:play() - end + if game.play then + for key, asteroid in pairs(asteroids) do + asteroid.x = asteroid.x - (dt * asteroid.speed) + if asteroid.x < -asteroid.img:getWidth() then + asteroid.x = game.width + math.random(0, game.width) + asteroid.pos = math.random(1, 3) + end + -- Colision + if checkCollision(spaceship.x, spaceship.y[spaceship.pos], spaceship.img:getWidth(), spaceship.img:getHeight() / spaceship.num_frames / 2, asteroid.x, asteroid.y[asteroid.pos], asteroid.img:getWidth(), asteroid.img:getHeight()) then + game.play = false + sounds.die:play() + explosion.animate = true + explosion.x = spaceship.x + explosion.y = spaceship.y[spaceship.pos_frame] + print(explosion.x) + print(explosion.y) + end + end + end + -- Sprite explosion + if explosion.animate and explosion.pos_frame < explosion.num_frames then + explosion.pos_frame = explosion.pos_frame + 1 + end + if explosion.pos_frame == explosion.num_frames then + explosion.pos_frame = 1 + explosion.animate = false + -- Restart game + if not game.play then + game.play = true + game.score = 0 + my_time_restart = 0 + for key, asteroid in pairs(asteroids) do + asteroid.x = game.width + math.random(0, game.width) + end + end end end @@ -107,6 +137,8 @@ function love.draw() if not game.play then love.graphics.print('Game over', game.width / 2, game.height / 2) end + -- Explosion + love.graphics.draw(explosion.img, explosion.frames[explosion.pos_frame], explosion.x, explosion.y) end -- Controls