Merge pull request 'Update to Crystal 1.0.0' (#1) from olivier/naka-chan-dayo:master into master

Reviewed-on: #1
master
karchnu 2021-04-21 17:57:13 +02:00
commit 0369842a8b
4 changed files with 14 additions and 4 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
map-test-01
lib

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