From ca002ea116e45f6809919900c3ce584279153193 Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Sun, 6 Nov 2016 01:58:12 +0100 Subject: [PATCH] Add first version --- assets/sprites/asteroid_1.png | Bin 0 -> 1428 bytes assets/sprites/background.jpg | Bin 0 -> 25959 bytes assets/sprites/spaceship.png | Bin 0 -> 6511 bytes main.lua | 84 ++++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 assets/sprites/asteroid_1.png create mode 100644 assets/sprites/background.jpg create mode 100644 assets/sprites/spaceship.png create mode 100644 main.lua diff --git a/assets/sprites/asteroid_1.png b/assets/sprites/asteroid_1.png new file mode 100644 index 0000000000000000000000000000000000000000..01d97dfd8167f39e60c552e59219fe4332818c25 GIT binary patch literal 1428 zcmV;F1#9|=P){?4mTvr%AGmh`^fr6+(VwjLkkhsdKpbHnZ#Z4lDNy(yZAc4?kkv3UnErbw| zEDA{=khWCNxDYg(L50*!HwmVKX`LD*DvII@-;aFXWzKMOJ$LTo+#!(850^W+I`^FK z{NMNe|2Z*qbaW&>hX{+$B(gxVKr$4Opk6dOI(l+(aq;Jhii+aH!^1{C!~I-p#lqp& z$@{CEoSc90@mW(-)4QO?59zvAe}Dh&xw*OPYinyKqtU3SudjFYz1-Yf0YHC7B9W)f z&CQQL8IX~Yk?&__X6_~ui8@TkcovJrL`g}BH*SZ+A}=rRH2^)-0ptrvJRa}e+1a@W z>WGDf1%Ygc;^JaaQ&Z#W`@6fl0*fG4R#sBaxB$pzyt1kXn!dkstdxXeF~lFi*IMfdEMg zJ0=1O0;#I1GC)8NAAy0;jY|d=?+h|{Ut8?7Sn%}`-6`lGg_f6>g?u+NQB+iSWCk2R`3O2ZG|Hc-Pn0KeAG;a$Q|riYBVy?^IV;I|AnToCiKW_LY%=fq{Ft-3o<5 zcJ5--kaR(sxUKXqisp|kEiK)iH3D5+va`v_$w@~L(rTG4-C$NWHa2eh5<48DR`r|{ z+uGVXR>&w~URIvF0qiEQu&0KGh8j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WK#;MMdwdME>L!RoToh`JvDUP7BoD7j0~E05!(i3C*J5y^|Et&S(Jnlg((01!AHBGLg9BTTHZyG`>PpJ&x&lqp@_h0b1v2KDnH} z-G!8c@-#9H>K%irQ2d~e+oS;JLfVDUcn#mLDTtVLstn9?1ZYDqAf6}+cgX`4Oo`Li zp#MYvyP#;DZsU7cIloADaE5!liH8 zwrzdJ_71z`TfT(Hl_y4+xs^ns{vj`Q9AkLOTz5(j7Z53)6nFJFB)-G=NI&L9*&gZ zo1NX^9WZC?7}iyRoxNm1uTL$p%@q zYXu^N1!8BhcmWW82{tK><}DugV(~*b%{cR(KfbRdu?3Yy!gDQlWPs-}oWcTH**}00 GhyM?BVH6qw literal 0 HcmV?d00001 diff --git a/assets/sprites/spaceship.png b/assets/sprites/spaceship.png new file mode 100644 index 0000000000000000000000000000000000000000..6a8e78dcdf142e6d57d9523eaa45cd5ba74ff600 GIT binary patch literal 6511 zcmV-#8Ib0QP)JAp#egd%7TO>=0h zBv7CyrxEm=ra2+Sw0RVIY6~3Fl=2X1AaFt&nb5?90x~ACjg66vjV&2TD`};D&P?w& zb7wU(JNuGkX;yrn&-Jc$XJ>cj{^q;?``z!}5fnuMGBPqUGBPr<>6qIIKSFqXcN2SP zn#Mj7Ts7#wXdHh!n@{1Xz4 zjXlp^`zHoT4^?+b7_mS`Opp-|BqXL`rw3S-mjRTO&3s=jkwF#|)dFxWgX9|F#iu4A zGVyIlBp;ygmcxx$AR{Koh=-Cf!3oKh!sEMlu!kqGO2OsQ;K0g7P(+vZh^D_jU6W*B zkjM~=JqI5Q-85f-u;UFCvH6E;T#r~F7KjOAf_Nw`9t5Y%+F&Q^i|pZ_RXFl0NY|7S z)d4b^4pX2!`#zFM1tunc!xZO@%GPW8XW{p^u?LK`H8uDHZB-sm!(cqtT` zVy8Uc?Z+{(Z?I=4Q6YLnu_Yvcu|O;k6T}4Z;BX!U zC$4PC;MmO`ZqY(Xk~YS5t^w(P4;m!}`mVmg(HBnO$wy&QN)@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x^#eai!YD+Ir!_EG<}tNhhnB#%WwRHD8ulnad5OV4)?; zwM=AG-B|HY4fDye1gR8;6xW|iCy`Bna#49Nk6w)O$1j7n*i}aX4ue=& z7%cSg&c(i&hzMe$w3*<(K9qxlQOI)BFXF+uJh-O;0`@H0c_ywN-t5k?eK!wCR3uQ>?S4_J`=oy zVdNmhBNWf@2xTAnh|=Prpd5+WGDG$)3X49w=^UMpbn9xO9bM;8@)K7z`)kQyIp3k`PXRQq{8SY)q0q z&473rO4x`6Vu6?-CWr^;^Dw7EqChb4V7AOyP2zYE0^zbzrKe}M7$dBM5nUp zcBhzHjg-6G6)r(==Yj^O5$RKcFiRJw?O3fhJOo4Wcj z)3M2iW;)l~fewOLAQp%TVuE-m0UjJ9B-jZ@W%ml;SeKn*#7f7aKQ|=4 z7#hK8EIo4=a%(cYr2fs6Yguzem1%VlR?#IhtlK0NkSqDE?1el3Kyy^e_8PWSZ!offzi>EFdq5yxdMWWSRf-N$cTpz zlR0S)OBpO(qAmC_UBgw%@WvwJ;}b9z>4sG5YYT0R_(NjE0vRzuMm&&^DAIyeXBiYr zOt0b86v=X@Kv_ybG=>>5SR|N?4uBw>Vz2!#B$GIOsE=SMaU&MUhzT;{frLcSHahk` z9Q+-Eq2K)xm*&LzDZTt}EIoW{s{Dm)!~z*HK}I~3j5%)lCm9(T85tQ_>Dd1ZFaSny VJ~oqZcGLg>002ovPDHLkV1l1iIEerN literal 0 HcmV?d00001 diff --git a/main.lua b/main.lua new file mode 100644 index 0000000..8971278 --- /dev/null +++ b/main.lua @@ -0,0 +1,84 @@ +function love.load() + math.randomseed(os.time()) + game = {} + game.width = 800 + game.height = 480 + love.window.setMode(game.width, game.height) + -- Background + background = {} + background.img = love.graphics.newImage('assets/sprites/background.jpg') + background.x = 0 + background.y = 0 + -- Spaceship + spaceship = {} + spaceship.img = love.graphics.newImage('assets/sprites/spaceship.png') + spaceship.x = game.height / 8 + spaceship.num_frames = 4 + spaceship.pos_frame = 1 + spaceship.frame_width = spaceship.img:getWidth() / spaceship.num_frames + spaceship.y = { + (game.height / 4) - (spaceship.img:getHeight() / 2), + 2 * (game.height / 4) - (spaceship.img:getHeight() / 2), + 3 * (game.height / 4) - (spaceship.img:getHeight() / 2), + } + spaceship.pos = 2 + spaceship.frames = { + love.graphics.newQuad(spaceship.frame_width * 0, 0, spaceship.frame_width, spaceship.img:getHeight(), spaceship.img:getWidth(), spaceship.img:getHeight()), + love.graphics.newQuad(spaceship.frame_width * 1, 0, spaceship.frame_width, spaceship.img:getHeight(), spaceship.img:getWidth(), spaceship.img:getHeight()), + love.graphics.newQuad(spaceship.frame_width * 2, 0, spaceship.frame_width, spaceship.img:getHeight(), spaceship.img:getWidth(), spaceship.img:getHeight()), + love.graphics.newQuad(spaceship.frame_width * 3, 0, spaceship.frame_width, spaceship.img:getHeight(), spaceship.img:getWidth(), spaceship.img:getHeight()) + } + -- Asteroids + num_asteroids = 3 + asteroids = {} + for i = 1, num_asteroids do + asteroid = {} + asteroid.img = love.graphics.newImage('assets/sprites/asteroid_1.png') + asteroid.x = game.width + asteroid.y = { + (game.height / 4) - (asteroid.img:getHeight() / 2), + 2 * (game.height / 4) - (asteroid.img:getHeight() / 2), + 3 * (game.height / 4) - (asteroid.img:getHeight() / 2), + } + asteroid.pos = 2 + asteroid.speed = 100 + asteroids[i] = asteroid + end +end + +function love.update(dt) + -- Sprite spaceship + if spaceship.pos_frame ~= spaceship.num_frames then + spaceship.pos_frame = spaceship.pos_frame + 1 + else + 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 + end +end + +function love.draw() + love.graphics.draw(background.img, background.x, background.y) + love.graphics.draw(spaceship.img, spaceship.frames[spaceship.pos_frame], spaceship.x, spaceship.y[spaceship.pos]) + for key, asteroid in pairs(asteroids) do + love.graphics.draw(asteroid.img, asteroid.x, asteroid.y[asteroid.pos]) + end +end + +-- Controls +function love.keypressed(key, scancode, isrepeat) + if key == 'escape' then + love.event.push('quit') + end + if key == 'up' and spaceship.pos > 1 then + spaceship.pos = spaceship.pos - 1 + elseif key == 'down' and spaceship.pos < 3 then + spaceship.pos = spaceship.pos + 1 + end +end \ No newline at end of file