src/doc: introduce option --no-render in HTML phase.
[nit.git] / examples / mnit_dino / src / game_logic.nit
index b148778..6fa0d3f 100644 (file)
@@ -15,7 +15,7 @@
 # limitations under the License.
 
 # Entire game logic for the Dino game
-# Depends only on Nit standard library
+# Depends only on Nit `core` library
 module game_logic
 
 interface Turnable
@@ -34,7 +34,7 @@ class Game
 
        var over_since = 0
 
-       var score: Container[Int]
+       var score: Ref[Int]
 
        var random_radius_min = 200
        var random_radius_max = 400
@@ -43,7 +43,7 @@ class Game
 
        var entities_sorter = new EntitiesSorter
 
-       init( cavemen_nbr : Int, score: Container[Int] )
+       init( cavemen_nbr : Int, score: Ref[Int] )
        do
                srand_from(cavemen_nbr)
 
@@ -182,7 +182,7 @@ end
 class MovingEntity
        super Entity
 
-       var going_to : nullable GamePos writable = null
+       var going_to : nullable GamePos = null is writable
 
        fun speed : Int is abstract
 
@@ -386,7 +386,8 @@ class Bush super Entity end
 
 # Sort entities on screen in order of Y, entities in the back are drawn first
 class EntitiesSorter
-       super AbstractSorter[Entity]
+       super Comparator
+       redef type COMPARED: Entity
 
        redef fun compare(a, b) do return b.pos.y <=> a.pos.y
 end