nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
contrib/asteronits: add sound effects
[nit.git]
/
contrib
/
asteronits
/
src
/
game_logic.nit
diff --git
a/contrib/asteronits/src/game_logic.nit
b/contrib/asteronits/src/game_logic.nit
index
8d45e54
..
b7ec3f4
100644
(file)
--- a/
contrib/asteronits/src/game_logic.nit
+++ b/
contrib/asteronits/src/game_logic.nit
@@
-83,6
+83,7
@@
class World
if object == ship then
# The ship is invincible
# TODO health and losing
if object == ship then
# The ship is invincible
# TODO health and losing
+ ship.hit
else
object.destroy
end
else
object.destroy
end
@@
-197,6
+198,9
@@
class Ship
world.objects.add bullet
world.bullets.add bullet
end
world.objects.add bullet
world.bullets.add bullet
end
+
+ # Something hits the ship
+ fun hit do end
end
# Asteroid, the main obstacle in this game
end
# Asteroid, the main obstacle in this game