diff --git a/shard.lock b/shard.lock new file mode 100644 index 0000000..8f5dc10 --- /dev/null +++ b/shard.lock @@ -0,0 +1,6 @@ +version: 2.0 +shards: + sdl: + git: https://github.com/ysbaddaden/sdl.cr.git + version: 0.1.0+git.commit.d7b2a9b754660ca7f4a03dd3dbe6f3d9395da7d6 + diff --git a/src/naka/map.cr b/src/naka/map.cr index 42209af..44e1c5c 100644 --- a/src/naka/map.cr +++ b/src/naka/map.cr @@ -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 diff --git a/src/naka/naka.cr b/src/naka/naka.cr index e795f8d..48105a6 100644 --- a/src/naka/naka.cr +++ b/src/naka/naka.cr @@ -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