Skip to content

Commit 1704a8f

Browse files
author
Artur Ostręga
committed
Update example
1 parent 5cfbb59 commit 1704a8f

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

example/src/spaces/world.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ class World < Yeah::Space #
99
def initialize(game)
1010
super
1111

12-
things << Cloud.new(game: game, x: width * 0.6, y: height * 0.8)
13-
things << Cloud.new(game: game, x: width * 0.2, y: height * 0.7)
14-
things << Cloud.new(game: game, x: width * 0.1, y: height * 0.9)
15-
things << Duck.new(game: game, x: 10, y: 10)
16-
#things << Duck.new(position: Vec2.divide(size, 2))
12+
things << Cloud.new(game, x: width * 0.6, y: height * 0.8)
13+
things << Cloud.new(game, x: width * 0.2, y: height * 0.7)
14+
things << Cloud.new(game, x: width * 0.1, y: height * 0.9)
15+
things << Duck.new(game, x: 10, y: 10)
16+
#things << Duck.new(game, position: Vec2.divide(size, 2))
1717
end
1818
end

example/src/things/duck.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ def act(elapsed)
2323
puts "*flap flap*"
2424
self.position = mouse.position
2525
end
26+
27+
if mouse.pressed? :middle
28+
display.width += 10
29+
display.height += 10
30+
end
2631
end
2732

2833
def speed

0 commit comments

Comments
 (0)