dedalus 0.2.16 → 0.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/dedalus/elements/image_grid.rb +1 -1
- data/lib/dedalus/elements/sprite_field.rb +5 -5
- data/lib/dedalus/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a564e0fa9aed68458bbb167c6053a36c50b6e3a
|
4
|
+
data.tar.gz: cd0d299e22bf39581965ab93fb6b19a055969483
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3b94e4f1c6477bd2c4e4cefc6111339bc5d1c356fa505720a9ce2a912d6f26dea3b7bb60fcf805dd968e52977d9bffc01e513b6d6b8f117285fa5b09dda303d
|
7
|
+
data.tar.gz: f6a38d03481e8055f54e0378302d47c2dfbcd71ddd59bed4653ab70e5d6764cfb936d4bf615aa3346e7ecdaa0ffe22589c8f4160990d9083c722402d068ccf2c
|
@@ -3,7 +3,6 @@ module Dedalus
|
|
3
3
|
class SpriteField < Dedalus::Organism
|
4
4
|
attr_accessor :grid, :sprite_map, :scale, :camera_location
|
5
5
|
attr_accessor :tile_width, :tile_height, :tiles_path
|
6
|
-
# TODO tiles path and width/height as attrs
|
7
6
|
|
8
7
|
def show
|
9
8
|
layers
|
@@ -12,7 +11,7 @@ module Dedalus
|
|
12
11
|
def camera_offset
|
13
12
|
if camera_location
|
14
13
|
cx,cy = *camera_location
|
15
|
-
[-cx *
|
14
|
+
[-cx * (tile_width*scale), -cy * (tile_height*scale)]
|
16
15
|
else
|
17
16
|
[0,0]
|
18
17
|
end
|
@@ -42,7 +41,7 @@ module Dedalus
|
|
42
41
|
|
43
42
|
def image_grid
|
44
43
|
ImageGrid.new(
|
45
|
-
tiles_path: tiles_path,
|
44
|
+
tiles_path: tiles_path,
|
46
45
|
grid: grid,
|
47
46
|
tile_width: tile_width,
|
48
47
|
tile_height: tile_height,
|
@@ -53,13 +52,14 @@ module Dedalus
|
|
53
52
|
end
|
54
53
|
|
55
54
|
def to_screen_coordinates(location:)
|
55
|
+
w,h = tile_width, tile_height
|
56
56
|
x,y = *location
|
57
57
|
cx,cy = *camera_offset
|
58
|
-
[(x *
|
58
|
+
[(x * w * scale) + cx, (y * h * scale) + cy]
|
59
59
|
end
|
60
60
|
|
61
61
|
def background_image
|
62
|
-
Image.new(path: "media/images/cosmos.jpg", z_order: -1
|
62
|
+
Image.new(path: "media/images/cosmos.jpg", z_order: -1)
|
63
63
|
end
|
64
64
|
|
65
65
|
def self.description
|
data/lib/dedalus/version.rb
CHANGED