diff options
| author | arngo <[email protected]> | 2022-01-21 01:24:18 -0500 |
|---|---|---|
| committer | arngo <[email protected]> | 2022-01-21 01:24:18 -0500 |
| commit | 128fab6823e2569837d9e14549bb5817577a2ce0 (patch) | |
| tree | 412d0c6a6fcaee7e192f3e5f5c51dee6f0ebfa72 /mrblib | |
| parent | dc203ce664367fec050f7ad4f37076160d10d2a4 (diff) | |
| download | mruby-raylib-128fab6823e2569837d9e14549bb5817577a2ce0.tar.gz mruby-raylib-128fab6823e2569837d9e14549bb5817577a2ce0.zip | |
Circle class and circle-rectangle collision methods
Diffstat (limited to 'mrblib')
| -rw-r--r-- | mrblib/raylib.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mrblib/raylib.rb b/mrblib/raylib.rb index 9856e5b..be2bf65 100644 --- a/mrblib/raylib.rb +++ b/mrblib/raylib.rb @@ -1,6 +1,31 @@ Rl = Raylib module Raylib + class Circle + attr_accessor :vector + attr_accessor :radius + + def initialize(x, y, radius) + self.vector = Vector2.new(x, y) + self.radius = radius + end + + def x + self.vector.x + end + + def y + self.vector.y + end + + def x=(x) + self.vector.x = x + end + + def y=(y) + self.vector.y = y + end + end class << self attr_accessor :defined_loop attr_accessor :data_keys_pressed |
