# 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)
var x : Int
var y : Int
- init ( x, y : Int )
- do
- self.x = x
- self.y = y
- end
-
init copy( src : GamePos )
do
- x = src.x
- y = src.y
+ init(src.x, src.y)
end
fun squared_dist_with( other : GamePos ) : Int