X Tutup
Skip to content

Commit a5f4502

Browse files
committed
intro and outro
1 parent 03e06a5 commit a5f4502

File tree

4 files changed

+31
-7
lines changed

4 files changed

+31
-7
lines changed

enemy.moon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,11 @@ class HugeSlime extends RedSlime
360360
@box = Box @box.x, @box.y, @w, @h
361361
super dt
362362

363+
take_hit: (...) =>
364+
super ...
365+
if @life < 0
366+
@world\goto_next_level!
367+
363368
make_ai: =>
364369
@ai = MoveSequence ->
365370
player = @world.game.player

img/floor9.png

-7 Bytes
Loading

levels/all.moon

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,12 @@ class Floor8 extends Level
273273

274274
class Floor9 extends Level
275275
map_file: "img/floor9.png"
276-
next_level: ->
277-
error "umm"
276+
goto_next_level: =>
277+
@game.player.locked = true
278+
@game.effect = ViewportFade @game.viewport, "out", ->
279+
@game.player.locked = false
280+
@game.dispatch\push Outro!
281+
282+
278283

279284

main.moon

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class Player extends Entity
8888
@weapon\try_attack! unless @stunned
8989

9090
take_hit: (enemy) =>
91-
return if @hit
91+
return if @hit or @locked
9292
sfx\play "player_is_hit"
9393
@world.game.viewport\shake!
9494

@@ -205,10 +205,10 @@ class Game
205205

206206
class Intro
207207
text: {
208-
"Slimes!\n\nThey're everywhere!",
209-
"They've invaded the castle,\n and are living in\n the catacombs.",
210-
"They're attacking our\n soldiers.\n\nThey've stolen our princess.",
211-
"You must get them! ",
208+
"Slimes!\n\nthey're everywhere!"
209+
"they've invaded the castle,\n and are living in\n the catacombs."
210+
"they're attacking our\n soldiers.\n\nthey've stolen our princess."
211+
"you must get them! "
212212
}
213213

214214
onload: (@dispatch) => sfx.music\stop!
@@ -219,6 +219,7 @@ class Intro
219219
@effect = ViewportFade @viewport, "in"
220220

221221
begin: =>
222+
@dispatch\pop!
222223
@dispatch\push Game!
223224

224225
update: (dt) =>
@@ -250,6 +251,19 @@ class Intro
250251
@effect\draw! if @effect
251252
@viewport\pop!
252253

254+
255+
export class Outro extends Intro
256+
text: {
257+
"Upon slaying the Huge Slime,\n you discover the castle\n toilets."
258+
"Excrement falls down and\n festers in a pile.\n\nWhat is this!?"
259+
"The slimes have eveolved\n from our own waste.\n\nAnd now they torment us."
260+
"What will become of this\n kingdom?",
261+
"The slimes are at last dead.\n\n\nBut at what cost?"
262+
}
263+
264+
begin: =>
265+
@dispatch\pop 2
266+
253267
class Title
254268
onload: (@dispatch) => sfx\play_music "slime_title"
255269
new: =>

0 commit comments

Comments
 (0)
X Tutup