Skip to content

Commit 5746574

Browse files
author
Artur Ostręga
committed
Update example
1 parent 41b4d98 commit 5746574

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

example/assets/images/duck.jpg

-48.9 KB
Loading

example/src/game.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
class Example < Yeah::Game
44
#class Example < Game
5-
display.size = 320, 240
5+
display.size = 640, 360
66
self.space = World
77
end

example/src/looks/cloud_look.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
class CloudLook < Yeah::FillLook #
44
#class CloudLook < FillLook
55
self.size = 120, 20
6-
self.color = 0.8, 0.8, 0.9
6+
self.color = 0.9, 0.9, 1
77
end

example/src/spaces/world.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33

44
class World < Yeah::Space #
55
#class World < Space
6-
self.size = 320, 240
6+
self.size = 640, 360
77
self.clear_color = 0.5, 0.7, 0.5
88

99
def initialize
1010
super
1111

1212
things << Cloud.new(x: width * 0.6, y: height * 0.8)
13-
things << Duck.new(x: width / 2, y: height / 2)
13+
things << Cloud.new(x: width * 0.2, y: height * 0.7)
14+
things << Cloud.new(x: width * 0.1, y: height * 0.9)
15+
things << Duck.new(x: 10, y: 10)
1416
#things << Duck.new(position: Vec2.divide(size, 2))
1517
end
1618
end

example/src/things/duck.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class Duck < Yeah::Thing #
66
self.look = DuckLook #
77

88
def act(input, space)
9-
puts "Quack" if rand > 0.8
9+
self.x += 3
10+
puts "Quack" if rand > 0.5
1011
end
1112
end

0 commit comments

Comments
 (0)