Skip to content

Commit e64ee0e

Browse files
author
Artur Ostręga
committed
example: Create space's #things using ::things
1 parent 2d0eff7 commit e64ee0e

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

example/src/spaces/world.rb

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,15 @@ class World < Yeah::Space #
99

1010
self.things = {
1111
Cloud => [
12-
-> { [width * 0.6, height * 0.8] },
13-
-> { [width * 0.2, height * 0.7] },
14-
-> { [width * 0.1, height * 0.9] }
12+
[384, 288],
13+
[128, 252],
14+
[64, 324]
1515
],
16-
1716
Duck => [
1817
[10, 10]
1918
],
20-
2119
Guy => [
22-
-> { [width * 0.8, height * 0.8] }
20+
[512, 288]
2321
]
2422
}
25-
26-
def initialize(game)
27-
super
28-
29-
things << Cloud.new(game, x: width * 0.6, y: height * 0.8)
30-
things << Cloud.new(game, x: width * 0.2, y: height * 0.7)
31-
things << Cloud.new(game, x: width * 0.1, y: height * 0.9)
32-
things << Duck.new(game, x: 10, y: 10)
33-
things << Guy.new(game, x: width * 0.8, y: height * 0.8)
34-
#things << Duck.new(game, position: Vec2.divide(size, 2))
35-
end
3623
end

0 commit comments

Comments
 (0)