gosu_tiled 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00bc74fe8d1bdea3996a255a4d88eda976f3ef4e
4
- data.tar.gz: 7aa04c20004d37cd961689b8845490e10d986364
3
+ metadata.gz: 1356ea783b4bd01004bf80c1b8f5ded281022e4c
4
+ data.tar.gz: 8452f3152de816ecf7f35dbccd2d35923618e93b
5
5
  SHA512:
6
- metadata.gz: d5c787058770680df7741054d66ce9be7b0ed910076ad5af568a3ee50e934aac634b9e25b6baa22e4403493d39f1a400c7017ef7227f0e1dcec88c3e797f1a27
7
- data.tar.gz: c53327e4653a6c3c65cde33e923f03b0df497b75379e9c955e509e627101e768becdde13ea1448d3017f7888242a22a7753118953378bd749f46d595d94a39af
6
+ metadata.gz: 730d1822d21da213461506073c984e9f288a71d00c65411e285e11e9041a9b407386dcce5788410e9c049b73e5934580359ce0c6d7db9a9ecf15251e947b4981
7
+ data.tar.gz: 692cf87bebdf0780eac99ac1a73a2e2989801e870a5e144bbdf290def8bee129716840518697c9867f220c8c2c62ff2a87a2ad79b7ccfe299f9cbcdd8de0b03f
data/README.md CHANGED
@@ -1,10 +1,19 @@
1
1
  # gosu-tiled
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/gosu_tiled.svg)](http://badge.fury.io/rb/gosu_tiled)
4
+ [![Code Climate](https://codeclimate.com/github/spajus/gosu-tiled.png)](https://codeclimate.com/github/spajus/gosu-tiled)
5
+
3
6
  [Tiled](http://www.mapeditor.org/) map loader for [Gosu](http://www.libgosu.org) game development library.
4
7
 
5
- # How to use it?
8
+ ## How to use it?
9
+
10
+ Install the gem:
11
+
12
+ ```console
13
+ gem install gosu_tiled
14
+ ```
6
15
 
7
- First, download [Tiled](http://www.mapeditor.org/) and create yourself a map.
16
+ Create yourself a game map with [Tiled](http://www.mapeditor.org/):
8
17
 
9
18
  ![Tiled Map](https://raw.githubusercontent.com/spajus/gosu-tiled/master/examples/screenshots/tiled.png)
10
19
 
@@ -19,14 +28,14 @@ class GameWindow < Gosu::Window
19
28
  super(800, 600, false)
20
29
  @map = Gosu::Tiled.load_json(self, 'path/to/map.json')
21
30
  @x = @y = 0
31
+ @speed = 3
22
32
  end
23
33
 
24
34
  def update
25
- @factor = 3
26
- @x -= @factor if button_down?(Gosu::KbLeft)
27
- @x += @factor if button_down?(Gosu::KbRight)
28
- @y -= @factor if button_down?(Gosu::KbUp)
29
- @y += @factor if button_down?(Gosu::KbDown)
35
+ @x -= @speed if button_down?(Gosu::KbLeft)
36
+ @x += @speed if button_down?(Gosu::KbRight)
37
+ @y -= @speed if button_down?(Gosu::KbUp)
38
+ @y += @speed if button_down?(Gosu::KbDown)
30
39
  end
31
40
 
32
41
  def draw
@@ -43,6 +52,10 @@ Run it and enjoy your game map:
43
52
 
44
53
  See [full example code](https://github.com/spajus/gosu-tiled/blob/master/examples/panorama.rb).
45
54
 
55
+ ## TODO
56
+
57
+ - Caching and other performance improvements
58
+
46
59
  ## Contributing
47
60
 
48
61
  0. Read [CONTRIBUTING.md](https://github.com/spajus/gosu-tiled/blob/master/CONTRIBUTING.md)
@@ -14,14 +14,14 @@ class GameWindow < Gosu::Window
14
14
  json_path = File.join(ROOT_DIR, 'spec', 'files', 'tiled_map.json')
15
15
  @map = Gosu::Tiled.load_json(self, json_path)
16
16
  @x = @y = 0
17
+ @speed = 3
17
18
  end
18
19
 
19
20
  def update
20
- @factor = 3
21
- @x -= @factor if button_down?(Gosu::KbLeft)
22
- @x += @factor if button_down?(Gosu::KbRight)
23
- @y -= @factor if button_down?(Gosu::KbUp)
24
- @y += @factor if button_down?(Gosu::KbDown)
21
+ @x -= @speed if button_down?(Gosu::KbLeft) && @x > 0
22
+ @x += @speed if button_down?(Gosu::KbRight) && @x < @map.width - WIDTH
23
+ @y -= @speed if button_down?(Gosu::KbUp) && @y > 0
24
+ @y += @speed if button_down?(Gosu::KbDown) && @y < @map.height - HEIGHT
25
25
  self.caption = "#{Gosu.fps} FPS. Mem: #{memory_usage} KB. Loc: [#{@x}:#{@y}]. Use arrow keys"
26
26
  end
27
27
 
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = 'https://github.com/spajus/gosu-tiled'
14
14
  spec.license = 'MIT'
15
15
 
16
- spec.files = `git ls-files -z`.split("\x0")
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(/\.(gif|png)$/) }
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
@@ -1,5 +1,5 @@
1
1
  module Gosu
2
2
  module Tiled
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gosu_tiled
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Varaneckas
@@ -111,8 +111,6 @@ files:
111
111
  - README.md
112
112
  - Rakefile
113
113
  - examples/panorama.rb
114
- - examples/screenshots/gosu_tiled.gif
115
- - examples/screenshots/tiled.png
116
114
  - gosu_tiled.gemspec
117
115
  - lib/gosu_tiled.rb
118
116
  - lib/gosu_tiled/empty_tile.rb
@@ -121,11 +119,8 @@ files:
121
119
  - lib/gosu_tiled/map.rb
122
120
  - lib/gosu_tiled/tilesets.rb
123
121
  - lib/gosu_tiled/version.rb
124
- - spec/files/ground.png
125
122
  - spec/files/tiled_map.json
126
123
  - spec/files/tiled_map.tmx
127
- - spec/files/trees.png
128
- - spec/files/water.png
129
124
  - spec/gosu_tiled/layer_spec.rb
130
125
  - spec/gosu_tiled/layers_spec.rb
131
126
  - spec/gosu_tiled/map_spec.rb
@@ -157,11 +152,8 @@ signing_key:
157
152
  specification_version: 4
158
153
  summary: Tiled map editor integration for Gosu game engine
159
154
  test_files:
160
- - spec/files/ground.png
161
155
  - spec/files/tiled_map.json
162
156
  - spec/files/tiled_map.tmx
163
- - spec/files/trees.png
164
- - spec/files/water.png
165
157
  - spec/gosu_tiled/layer_spec.rb
166
158
  - spec/gosu_tiled/layers_spec.rb
167
159
  - spec/gosu_tiled/map_spec.rb
Binary file
Binary file
Binary file