gosu_tiled 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -7
- data/examples/panorama.rb +5 -5
- data/gosu_tiled.gemspec +1 -1
- data/lib/gosu_tiled/version.rb +1 -1
- metadata +1 -9
- data/examples/screenshots/gosu_tiled.gif +0 -0
- data/examples/screenshots/tiled.png +0 -0
- data/spec/files/ground.png +0 -0
- data/spec/files/trees.png +0 -0
- data/spec/files/water.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1356ea783b4bd01004bf80c1b8f5ded281022e4c
|
4
|
+
data.tar.gz: 8452f3152de816ecf7f35dbccd2d35923618e93b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
8
|
+
## How to use it?
|
9
|
+
|
10
|
+
Install the gem:
|
11
|
+
|
12
|
+
```console
|
13
|
+
gem install gosu_tiled
|
14
|
+
```
|
6
15
|
|
7
|
-
|
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
|
-
@
|
26
|
-
@x
|
27
|
-
@
|
28
|
-
@y
|
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)
|
data/examples/panorama.rb
CHANGED
@@ -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
|
-
@
|
21
|
-
@x
|
22
|
-
@
|
23
|
-
@y
|
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
|
|
data/gosu_tiled.gemspec
CHANGED
@@ -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']
|
data/lib/gosu_tiled/version.rb
CHANGED
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.
|
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
|
data/spec/files/ground.png
DELETED
Binary file
|
data/spec/files/trees.png
DELETED
Binary file
|
data/spec/files/water.png
DELETED
Binary file
|