summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFrederico Linhares <fred@linhares.blue>2022-09-16 12:03:04 -0300
committerFrederico Linhares <fred@linhares.blue>2022-09-16 12:03:04 -0300
commit3d6ca447a7104c499e92fc954affdaf4bf011388 (patch)
treed759fbd39d3d66a2457ea92fc4eeb2c31b2cbe4f /test
parent0d0868611389b8dded0c1dfef7a530a4b6e1f148 (diff)
feat Create View
Diffstat (limited to 'test')
-rw-r--r--test/config/init.yaml3
-rw-r--r--test/src/main.rb12
2 files changed, 9 insertions, 6 deletions
diff --git a/test/config/init.yaml b/test/config/init.yaml
index 2139b75..0a7fdcf 100644
--- a/test/config/init.yaml
+++ b/test/config/init.yaml
@@ -1,7 +1,4 @@
name: "Candy Gear Test"
-game:
- width: 640
- height: 360
screen:
width: 1280
height: 720
diff --git a/test/src/main.rb b/test/src/main.rb
index f5c0676..67ef80c 100644
--- a/test/src/main.rb
+++ b/test/src/main.rb
@@ -35,8 +35,14 @@ def init()
$camera_position = CandyGear::Vector3D.new(0.0, 0.0, 0.0);
$camera_rotation = CandyGear::Rotation3D.new(0.0, 0.0, 0.0);
- CandyGear.camera_position = $camera_position;
- CandyGear.camera_rotation = $camera_rotation;
+
+ color = CandyGear::Vector3D.new(0.12, 0.12, 0.18);
+ $view1 = CandyGear::View.new(CandyGear::Vector4D.new(0, 0, 1280, 360));
+ $view2 = CandyGear::View.new(CandyGear::Vector4D.new(0, 360, 1280, 360));
+ CandyGear.views = [$view1, $view2];
+
+ $view1.camera_position = $camera_position;
+ $view1.camera_rotation = $camera_rotation;
end
def key_down(key)
@@ -70,7 +76,7 @@ end
def quit() = CandyGear.quit();
def tick()
- $sprite.draw($sprite_position);
+ $sprite.draw($view2, $sprite_position);
$instances_rotation.rotate(0.0, BOX_ROTATION_SPEED);
$instances.each do |i|
$model.draw(i, $instances_rotation);