From 35820c9dfe698c2956db8ddfc936efe9291b3b38 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 27 Apr 2016 16:30:49 +0200 Subject: [PATCH] Paré pour distribution --- game/main.lua | 2 -- game/menu.lua | 36 ++++-------------------------------- game/scene6.lua | 11 ++++++++--- 3 files changed, 12 insertions(+), 37 deletions(-) diff --git a/game/main.lua b/game/main.lua index 272a89c..0c79ff8 100644 --- a/game/main.lua +++ b/game/main.lua @@ -23,8 +23,6 @@ function love.load() require "asteroid" require "bullet" require "bird" - require "socket.http" - require "socket.url" changegamestate("menu") end diff --git a/game/menu.lua b/game/menu.lua index f8daaf8..7d6a612 100644 --- a/game/menu.lua +++ b/game/menu.lua @@ -74,7 +74,6 @@ function menu_load() bgmusic = love.audio.newSource("audio/trosong.ogg") bgmusic:setLooping(true) - bgmusic:setVolume(0) lasersound = love.audio.newSource("audio/laser.wav") bigexplosionsound = love.audio.newSource("audio/bigexplosion.ogg") explosionsound = love.audio.newSource("audio/explosion.wav") @@ -87,7 +86,6 @@ function menu_load() credits = love.audio.newSource("audio/credits.ogg") approach = love.audio.newSource("audio/approach.ogg") credits:setLooping(true) - credits:setVolume(0) skipupdate = true shakeamount = 0 @@ -114,8 +112,6 @@ function menu_load() reallaserdelay = 0.4 starttimer = 0 - pseudo = "" - rockets = nil jumped = nil landing = nil @@ -142,7 +138,7 @@ function menu_load() playerx = 10 -- 1 2 3 4 5 6 7 startactions = {2.3, 4.6, 7, 8.20, 9.20, 10.20, 11.20} - starti = -1 + starti = 0 end @@ -221,14 +217,9 @@ function menu_draw() draw(titleimg, 50, 23, math.sin(sini)/10, (math.sin(sini2)+1)/5+0.7, (math.sin(sini2)+1)/5+0.7, 50, 13) love.graphics.setColor(255, 0, 0) - if starti >= -1 then - properprint("tape ton pseudo", 18, 40+textpos[0], scale/2) - properprint(pseudo, 20, 50+textpos[0], scale/2) - end - - -- if starti >= 0 then - -- properprint("directed by maurice", 13, 40+textpos[0], scale/2) - -- end + if starti >= 0 then + properprint("directed by maurice", 13, 40+textpos[0], scale/2) + end if starti >= 1 then properprint("utilise les fleches", 11, 40+textpos[1], scale/2) end @@ -254,22 +245,3 @@ function menu_draw() love.graphics.setColor(255, 255, 255) end -function menu_keypressed(key, unicode) - if starti == -1 then - if string.len(pseudo) < 16 then - if string.sub(key, 1, 2) == 'kp' then - key = string.sub(key, 3, 3) - end - if string.len(key) == 1 and string.find(fontglyphs, key, 1, true) then - pseudo = pseudo .. key - end - end - if key == 'backspace' then - pseudo = string.sub(pseudo, 1, -2) - end - if key == 'return' and string.len(pseudo) > 3 then - starttimer = startactions[1] - starti = 1 - end - end -end diff --git a/game/scene6.lua b/game/scene6.lua index cdee7c9..28b6b8e 100644 --- a/game/scene6.lua +++ b/game/scene6.lua @@ -107,8 +107,6 @@ function scene6_update(dt) end if starttimer >= 15.7 and starttimer -dt < 15.7 then - print("SCORE|" .. scoretot .. "|" .. pseudo) - socket.http.request("http://" .. arg[2] .. "/addScore?score=" .. scoretot .. "&name=" .. socket.url.escape(pseudo)) ended = true staralpha = 1 @@ -122,7 +120,10 @@ function scene6_update(dt) v:update(dt) end - if starttimer >= 20 and starttimer -dt < 20 then +end + +function scene6_keypressed(key, unicode) + if ended then credits:pause() changegamestate("menu") end @@ -182,4 +183,8 @@ function scene6_draw() love.graphics.setColor(255, 255, 255) end + if ended and starttimer % (5/12) > (5/24) then + properprint("appuie sur espace pour recommencer", 15, 50, scale/4) + end + end -- libgit2 0.21.2