summaryrefslogtreecommitdiffhomepage
path: root/game/main.rb
diff options
context:
space:
mode:
authorarngo <[email protected]>2022-01-21 01:30:02 -0500
committerarngo <[email protected]>2022-01-21 01:30:02 -0500
commit99955cc7ce726d10856b4e4df2c560b2d2e2d80e (patch)
tree6aad2d12e8179967a9702eb118f520e1d2f1d256 /game/main.rb
parente45a93074586de2babdc9761cb02e60f96065894 (diff)
downloadFelFlameEngine-99955cc7ce726d10856b4e4df2c560b2d2e2d80e.tar.gz
FelFlameEngine-99955cc7ce726d10856b4e4df2c560b2d2e2d80e.zip
testing rectangle and circle
Diffstat (limited to 'game/main.rb')
-rw-r--r--game/main.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/game/main.rb b/game/main.rb
index 0ea5d7c..5f31b8c 100644
--- a/game/main.rb
+++ b/game/main.rb
@@ -6,7 +6,27 @@ Rl.target_fps = 60
color = Rl::Color.new(200,50,50,255)
white = Rl::Color.new(255,255,255,255)
+rect1 = Rl::Rectangle.new(50,50,10,10)
+rect2 = Rl::Rectangle.new(100,50,10,10)
+circ1 = Rl::Circle.new(100,100,10)
+circ2 = Rl::Circle.new(100,50,10)
+
+puts "rect1: #{rect1.x} #{rect1.y} #{rect1.w} #{rect1.h}"
+puts "circ1: #{circ1.x} #{circ1.y} #{circ1.radius}"
+
+puts "false: #{rect1.collide_with_rect? rect2}" # no
+puts "true: #{rect1.collide_with_rect? rect1}" # ya
+
+puts "false: #{circ1.collide_with_rect? rect1}" # no
+puts "true: #{circ2.collide_with_rect? rect2}" # ya
+
+puts "true: #{rect2.collide_with_circle? circ2}" # ya
+
+puts "false: #{circ1.collide_with_circle? circ2}" # no
+puts "true: #{circ1.collide_with_circle? circ1}" # ya
+
pause_champ = Rl::Texture.new("./assets/PauseChamp.png")
+puts "#{pause_champ.w} #{pause_champ.h}"
y = 10
spaceing = 25
@@ -32,6 +52,16 @@ Rl.while_window_open do
)
end
+ if Rl.is_key_down? 72
+ pause_champ.w += 10
+ pause_champ.h += 10
+ end
+
+ if Rl.is_key_down? 71
+ pause_champ.w += 10
+ pause_champ.h += 10
+ end
+
Rl.draw_text(
text: "mouse wheel:#{Rl.mouse_wheel}",
x: 350,