Update to Crystal 1.0.0

pull/1/head
Olivier DOSSMANN 2021-04-19 22:10:53 +02:00
parent 1c454fd523
commit 6a4f1edb5e
3 changed files with 12 additions and 4 deletions

6
shard.lock Normal file
View File

@ -0,0 +1,6 @@
version: 2.0
shards:
sdl:
git: https://github.com/ysbaddaden/sdl.cr.git
version: 0.1.0+git.commit.d7b2a9b754660ca7f4a03dd3dbe6f3d9395da7d6

View File

@ -102,7 +102,9 @@ class Naka::Map
end
def get(x, y)
get_chunk(x / CHUNK_SIZE, y / CHUNK_SIZE).get(x % CHUNK_SIZE, y % CHUNK_SIZE)
x_value = x / CHUNK_SIZE
y_value = y / CHUNK_SIZE
get_chunk(x_value.to_i, y_value.to_i).get(x % CHUNK_SIZE, y % CHUNK_SIZE)
end
end

View File

@ -88,14 +88,14 @@ class Naka::Timer
getter last_update
def initialize
@start = Time.now
@start = Time.local
@last_update = @start
end
def step
now = Time.now
now = Time.local
dt = now.epoch_ms - @last_update.epoch_ms
dt = now.to_unix_ms - @last_update.to_unix_ms
@last_update = now