From 6a372eb5706201b6c2e286138bf0272986872359 Mon Sep 17 00:00:00 2001 From: Steven Hedges Date: Fri, 24 Jan 2025 20:19:19 -0500 Subject: [PATCH 1/5] update color-dodge --- color-dodge-game/color-dodge.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/color-dodge-game/color-dodge.rb b/color-dodge-game/color-dodge.rb index 6e160ee..ad1764d 100644 --- a/color-dodge-game/color-dodge.rb +++ b/color-dodge-game/color-dodge.rb @@ -52,7 +52,7 @@ def radius # Instantiating the score text and variable score = 0 -score_text = Text.new(x: (get :width)-150, y: 10, text: "Score: #{score}", font: "../fonts/Ubuntu.ttf", color: 'white') +score_text = Text.new("Score: #{score}", x: (get :width)-150, y: 10, font: "fonts/Ubuntu.ttf", color: 'white') # Creating a lifebar lifebar = Rectangle.new(x: 10, y: 10, z: 1, width: player_life, height: 25, color: 'red') @@ -107,7 +107,7 @@ def radius dx = player.x - enemy.getBodyPosition().first dy = player.y - enemy.getBodyPosition().last - # Euclidian distance between the two centers of the squares + # Euclidean distance between the two centers of the squares distance = Math.sqrt(dx * dx + dy * dy) # If this calculated distance is less than the two radius of the shapes summed, then they are overlapping. From c41c1178bbadfdf27f4279ded34659afbf260077 Mon Sep 17 00:00:00 2001 From: Steven Hedges Date: Fri, 24 Jan 2025 20:20:53 -0500 Subject: [PATCH 2/5] update keyevent-example --- keyevent-example/keyevent-example.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyevent-example/keyevent-example.rb b/keyevent-example/keyevent-example.rb index b9fb98c..40e99f8 100644 --- a/keyevent-example/keyevent-example.rb +++ b/keyevent-example/keyevent-example.rb @@ -7,7 +7,7 @@ set title: "KeyEvent Example" text_size = 20 -font_path = "../fonts/Ubuntu.ttf" +font_path = "fonts/Ubuntu.ttf" on :key_down do |k| key = k['key'] From b82deadf754bf7fcade50149c78668785fc58ce9 Mon Sep 17 00:00:00 2001 From: Steven Hedges Date: Fri, 24 Jan 2025 20:29:10 -0500 Subject: [PATCH 3/5] update triangle-game --- triangle-game/triangle-game.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/triangle-game/triangle-game.rb b/triangle-game/triangle-game.rb index f2c36c2..b76bd28 100644 --- a/triangle-game/triangle-game.rb +++ b/triangle-game/triangle-game.rb @@ -24,9 +24,9 @@ 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 From 72fd2b76329e92c65d3360b8aa6f93097551c9fc Mon Sep 17 00:00:00 2001 From: Steven Hedges Date: Fri, 24 Jan 2025 20:44:13 -0500 Subject: [PATCH 4/5] update version dates and remove comments --- color-dodge-game/README.md | 2 +- keyevent-example/README.md | 2 +- toggle-switch/README.md | 2 +- triangle-game/triangle-game.rb | 5 +---- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/color-dodge-game/README.md b/color-dodge-game/README.md index 1fdd1ec..c77cfa5 100644 --- a/color-dodge-game/README.md +++ b/color-dodge-game/README.md @@ -2,7 +2,7 @@ Made by [Heitorado](https://github.com/heitorado) -**Ruby2D Version:** 0.6.0 +**Ruby2D Version:** 0.12.1 Feel free to use and modify as you wish! diff --git a/keyevent-example/README.md b/keyevent-example/README.md index 733854c..c116ed9 100644 --- a/keyevent-example/README.md +++ b/keyevent-example/README.md @@ -2,7 +2,7 @@ Made by [slime-man](https://github.com/slime-man) -**Ruby2D Version:** 0.8.1 +**Ruby2D Version:** 0.12.1 An example using the `on` method to capture `KeyEvents`. It displays the keys you type, like stamps on the screen. diff --git a/toggle-switch/README.md b/toggle-switch/README.md index a46c5dd..0d5e130 100644 --- a/toggle-switch/README.md +++ b/toggle-switch/README.md @@ -2,7 +2,7 @@ Made by [Tobias Wilfert](https://github.com/tobias-wilfert) -**Ruby2D Version:** 0.8.1 +**Ruby2D Version:** 0.12.1 Feel free to use and modify as you wish! diff --git a/triangle-game/triangle-game.rb b/triangle-game/triangle-game.rb index b76bd28..78aa0ce 100644 --- a/triangle-game/triangle-game.rb +++ b/triangle-game/triangle-game.rb @@ -1,5 +1,5 @@ # A simple "Triangle Game" that allows you to move a Roguelike '@' around the -# window (and off of it). This is a working example on MacOS 10.12 as of Dec 16, 2017. +# window (and off of it). This is a working example on MacOS 15.2 as of Jan 24, 2025. # This combines some of the Ruby2D tutorial code with keypress management # that actually works. # @@ -35,7 +35,6 @@ t = Time.now on :key do |e| - # puts e if e.type == :down case e.key when 'j' @@ -57,8 +56,6 @@ set background: 'random' end tick += 1 - # Close the window after 5 seconds - #if Time.now - t > 5 then close end end show From a04011fd8bd891c9b12ac03ef4ced738409da124 Mon Sep 17 00:00:00 2001 From: Steven Hedges Date: Fri, 24 Jan 2025 21:06:33 -0500 Subject: [PATCH 5/5] update triangle-game --- triangle-game/triangle-game.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/triangle-game/triangle-game.rb b/triangle-game/triangle-game.rb index 78aa0ce..b6b370d 100644 --- a/triangle-game/triangle-game.rb +++ b/triangle-game/triangle-game.rb @@ -26,7 +26,7 @@ msg = Text.new('Hi, Tres!', x: 320, y: 240, size: 20, font: 'fonts/Ubuntu.ttf') -player = Text.new('@', x: 0, y: 0, 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