examples icon indicating copy to clipboard operation
examples copied to clipboard

Examples out of sync: triangle game fix

Open jephthai opened this issue 5 years ago • 0 comments

The API seems to have changed, and now the triangle-game example doesn't work right (at least for me, on Ubuntu 18.04). I had to change it as follows, FYI:

$ git diff
diff --git a/triangle-game/triangle-game.rb b/triangle-game/triangle-game.rb
index f2c36c2..7ce31eb 100644
--- a/triangle-game/triangle-game.rb
+++ b/triangle-game/triangle-game.rb
@@ -24,9 +24,9 @@ Triangle.new(
   color: ['red', 'green', 'blue']
 )
 
-msg = Text.new(x: 320, y: 240, text: 'Hi, Tres!', size: 20, font: '../fonts/Ubuntu.ttf')
+msg = Text.new('Hi, Tres!', x: 320, y: 240, size: 20, font: '../fonts/Ubuntu.ttf')
 
-player = Text.new(x: 0, y: 0, text: '@', size: 32, font: '../fonts/Ubuntu.ttf');
+player = Text.new('@', x: 0, y: 0, size: 32, font: '../fonts/Ubuntu.ttf')
 
 msg.x = 320 - msg.width / 2
 msg.y = 240 - msg.height / 2

jephthai avatar Mar 18 '20 02:03 jephthai