Commit 35820c9dfe698c2956db8ddfc936efe9291b3b38
1 parent
cd9681f5
Paré pour distribution
Showing
3 changed files
with
12 additions
and
37 deletions
Show diff stats
game/main.lua
@@ -23,8 +23,6 @@ function love.load() | @@ -23,8 +23,6 @@ function love.load() | ||
23 | require "asteroid" | 23 | require "asteroid" |
24 | require "bullet" | 24 | require "bullet" |
25 | require "bird" | 25 | require "bird" |
26 | - require "socket.http" | ||
27 | - require "socket.url" | ||
28 | 26 | ||
29 | changegamestate("menu") | 27 | changegamestate("menu") |
30 | end | 28 | end |
game/menu.lua
@@ -74,7 +74,6 @@ function menu_load() | @@ -74,7 +74,6 @@ function menu_load() | ||
74 | 74 | ||
75 | bgmusic = love.audio.newSource("audio/trosong.ogg") | 75 | bgmusic = love.audio.newSource("audio/trosong.ogg") |
76 | bgmusic:setLooping(true) | 76 | bgmusic:setLooping(true) |
77 | - bgmusic:setVolume(0) | ||
78 | lasersound = love.audio.newSource("audio/laser.wav") | 77 | lasersound = love.audio.newSource("audio/laser.wav") |
79 | bigexplosionsound = love.audio.newSource("audio/bigexplosion.ogg") | 78 | bigexplosionsound = love.audio.newSource("audio/bigexplosion.ogg") |
80 | explosionsound = love.audio.newSource("audio/explosion.wav") | 79 | explosionsound = love.audio.newSource("audio/explosion.wav") |
@@ -87,7 +86,6 @@ function menu_load() | @@ -87,7 +86,6 @@ function menu_load() | ||
87 | credits = love.audio.newSource("audio/credits.ogg") | 86 | credits = love.audio.newSource("audio/credits.ogg") |
88 | approach = love.audio.newSource("audio/approach.ogg") | 87 | approach = love.audio.newSource("audio/approach.ogg") |
89 | credits:setLooping(true) | 88 | credits:setLooping(true) |
90 | - credits:setVolume(0) | ||
91 | 89 | ||
92 | skipupdate = true | 90 | skipupdate = true |
93 | shakeamount = 0 | 91 | shakeamount = 0 |
@@ -114,8 +112,6 @@ function menu_load() | @@ -114,8 +112,6 @@ function menu_load() | ||
114 | reallaserdelay = 0.4 | 112 | reallaserdelay = 0.4 |
115 | starttimer = 0 | 113 | starttimer = 0 |
116 | 114 | ||
117 | - pseudo = "" | ||
118 | - | ||
119 | rockets = nil | 115 | rockets = nil |
120 | jumped = nil | 116 | jumped = nil |
121 | landing = nil | 117 | landing = nil |
@@ -142,7 +138,7 @@ function menu_load() | @@ -142,7 +138,7 @@ function menu_load() | ||
142 | playerx = 10 | 138 | playerx = 10 |
143 | -- 1 2 3 4 5 6 7 | 139 | -- 1 2 3 4 5 6 7 |
144 | startactions = {2.3, 4.6, 7, 8.20, 9.20, 10.20, 11.20} | 140 | startactions = {2.3, 4.6, 7, 8.20, 9.20, 10.20, 11.20} |
145 | - starti = -1 | 141 | + starti = 0 |
146 | 142 | ||
147 | end | 143 | end |
148 | 144 | ||
@@ -221,14 +217,9 @@ function menu_draw() | @@ -221,14 +217,9 @@ function menu_draw() | ||
221 | draw(titleimg, 50, 23, math.sin(sini)/10, (math.sin(sini2)+1)/5+0.7, (math.sin(sini2)+1)/5+0.7, 50, 13) | 217 | draw(titleimg, 50, 23, math.sin(sini)/10, (math.sin(sini2)+1)/5+0.7, (math.sin(sini2)+1)/5+0.7, 50, 13) |
222 | 218 | ||
223 | love.graphics.setColor(255, 0, 0) | 219 | love.graphics.setColor(255, 0, 0) |
224 | - if starti >= -1 then | ||
225 | - properprint("tape ton pseudo", 18, 40+textpos[0], scale/2) | ||
226 | - properprint(pseudo, 20, 50+textpos[0], scale/2) | ||
227 | - end | ||
228 | - | ||
229 | - -- if starti >= 0 then | ||
230 | - -- properprint("directed by maurice", 13, 40+textpos[0], scale/2) | ||
231 | - -- end | 220 | + if starti >= 0 then |
221 | + properprint("directed by maurice", 13, 40+textpos[0], scale/2) | ||
222 | + end | ||
232 | if starti >= 1 then | 223 | if starti >= 1 then |
233 | properprint("utilise les fleches", 11, 40+textpos[1], scale/2) | 224 | properprint("utilise les fleches", 11, 40+textpos[1], scale/2) |
234 | end | 225 | end |
@@ -254,22 +245,3 @@ function menu_draw() | @@ -254,22 +245,3 @@ function menu_draw() | ||
254 | love.graphics.setColor(255, 255, 255) | 245 | love.graphics.setColor(255, 255, 255) |
255 | end | 246 | end |
256 | 247 | ||
257 | -function menu_keypressed(key, unicode) | ||
258 | - if starti == -1 then | ||
259 | - if string.len(pseudo) < 16 then | ||
260 | - if string.sub(key, 1, 2) == 'kp' then | ||
261 | - key = string.sub(key, 3, 3) | ||
262 | - end | ||
263 | - if string.len(key) == 1 and string.find(fontglyphs, key, 1, true) then | ||
264 | - pseudo = pseudo .. key | ||
265 | - end | ||
266 | - end | ||
267 | - if key == 'backspace' then | ||
268 | - pseudo = string.sub(pseudo, 1, -2) | ||
269 | - end | ||
270 | - if key == 'return' and string.len(pseudo) > 3 then | ||
271 | - starttimer = startactions[1] | ||
272 | - starti = 1 | ||
273 | - end | ||
274 | - end | ||
275 | -end |
game/scene6.lua
@@ -107,8 +107,6 @@ function scene6_update(dt) | @@ -107,8 +107,6 @@ function scene6_update(dt) | ||
107 | end | 107 | end |
108 | 108 | ||
109 | if starttimer >= 15.7 and starttimer -dt < 15.7 then | 109 | if starttimer >= 15.7 and starttimer -dt < 15.7 then |
110 | - print("SCORE|" .. scoretot .. "|" .. pseudo) | ||
111 | - socket.http.request("http://" .. arg[2] .. "/addScore?score=" .. scoretot .. "&name=" .. socket.url.escape(pseudo)) | ||
112 | ended = true | 110 | ended = true |
113 | staralpha = 1 | 111 | staralpha = 1 |
114 | 112 | ||
@@ -122,7 +120,10 @@ function scene6_update(dt) | @@ -122,7 +120,10 @@ function scene6_update(dt) | ||
122 | v:update(dt) | 120 | v:update(dt) |
123 | end | 121 | end |
124 | 122 | ||
125 | - if starttimer >= 20 and starttimer -dt < 20 then | 123 | +end |
124 | + | ||
125 | +function scene6_keypressed(key, unicode) | ||
126 | + if ended then | ||
126 | credits:pause() | 127 | credits:pause() |
127 | changegamestate("menu") | 128 | changegamestate("menu") |
128 | end | 129 | end |
@@ -182,4 +183,8 @@ function scene6_draw() | @@ -182,4 +183,8 @@ function scene6_draw() | ||
182 | love.graphics.setColor(255, 255, 255) | 183 | love.graphics.setColor(255, 255, 255) |
183 | end | 184 | end |
184 | 185 | ||
186 | + if ended and starttimer % (5/12) > (5/24) then | ||
187 | + properprint("appuie sur espace pour recommencer", 15, 50, scale/4) | ||
188 | + end | ||
189 | + | ||
185 | end | 190 | end |