dedalus 0.2.16 → 0.2.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 286d1852f478b0aaad4b369d83e57dece8f9b402
4
- data.tar.gz: 75c2ba7b46528bc270ca98b42a3f54eb0d851fd0
3
+ metadata.gz: 5a564e0fa9aed68458bbb167c6053a36c50b6e3a
4
+ data.tar.gz: cd0d299e22bf39581965ab93fb6b19a055969483
5
5
  SHA512:
6
- metadata.gz: 0bc826ffa2f0c693a4f9c9541bf1b8f458f75425fbbefaa2a05dcd110e1cba7faae98c2895ef9b6e7185317d9d2ce4e2017d5eb9d839c386932e22b372f4eecd
7
- data.tar.gz: d7c99c66dfe448ee777059e0c8ee81d675ed25013bcc1f365e2cbeeec16f14a7650a9ed6a0ce161106026c0b6b1e82c33cb6df9b645bcd62efbb6081f0a2075c
6
+ metadata.gz: a3b94e4f1c6477bd2c4e4cefc6111339bc5d1c356fa505720a9ce2a912d6f26dea3b7bb60fcf805dd968e52977d9bffc01e513b6d6b8f117285fa5b09dda303d
7
+ data.tar.gz: f6a38d03481e8055f54e0378302d47c2dfbcd71ddd59bed4653ab70e5d6764cfb936d4bf615aa3346e7ecdaa0ffe22589c8f4160990d9083c722402d068ccf2c
@@ -29,7 +29,7 @@ module Dedalus
29
29
  end
30
30
 
31
31
  def record?
32
- !grid.empty?
32
+ grid && !grid.empty?
33
33
  end
34
34
 
35
35
  def width
@@ -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 * 64, -cy * 64]
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, #'media/images/tiles.png',
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 * tile_width + cx), (y * tile_height + cy)]
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, scale: self.scale)
62
+ Image.new(path: "media/images/cosmos.jpg", z_order: -1)
63
63
  end
64
64
 
65
65
  def self.description
@@ -1,4 +1,4 @@
1
1
  module Dedalus
2
2
  # dedalus version
3
- VERSION = "0.2.16"
3
+ VERSION = "0.2.17"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dedalus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.16
4
+ version: 0.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Weissman