Update to Crystal 1.0.0 #1

Merged
karchnu merged 2 commits from olivier/naka-chan-dayo:master into master 2021-04-21 17:57:15 +02:00
3 changed files with 12 additions and 4 deletions
Showing only changes of commit 6a4f1edb5e - Show all commits

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