# 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
var over_since = 0
- var score: Container[Int]
+ var score: Ref[Int]
var random_radius_min = 200
var random_radius_max = 400
var entities_sorter = new EntitiesSorter
- init( cavemen_nbr : Int, score: Container[Int] )
+ init( cavemen_nbr : Int, score: Ref[Int] )
do
srand_from(cavemen_nbr)
# 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