X-Git-Url: http://nitlanguage.org diff --git a/examples/mnit_dino/src/game_logic.nit b/examples/mnit_dino/src/game_logic.nit index 1df0119..6fa0d3f 100644 --- a/examples/mnit_dino/src/game_logic.nit +++ b/examples/mnit_dino/src/game_logic.nit @@ -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) @@ -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