summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2024-05-12 03:12:08 -0400
committerrealtradam <[email protected]>2024-05-12 03:12:08 -0400
commitae35e8f858b761cc553c39328f1dc6577148f067 (patch)
tree486c5b6783facad50566f10ebedc7e7739f4489a
parent885591d23c49c2a4dfefbf78c76f1394f938947e (diff)
downloadtojam2024-ae35e8f858b761cc553c39328f1dc6577148f067.tar.gz
tojam2024-ae35e8f858b761cc553c39328f1dc6577148f067.zip
add split screen line
-rw-r--r--src/main.c16
-rw-r--r--src/player.c2
-rw-r--r--src/render.c16
3 files changed, 25 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index 44cca12..0147bd5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -140,6 +140,8 @@ int main(void)
EndScissorMode();
rlViewport(0, 0, 320, 240);
+ DrawRectangle((320/2)-4, 0, 2, 240, BLACK); // split screen line
+
// Draw cube with an applied texture
//test();
// Draw cube with an applied texture, but only a defined rectangle piece of the texture
@@ -151,6 +153,20 @@ int main(void)
char text[50];
sprintf(text, "Joystick %d,%d", inputs_p1.stick_x, inputs_p1.stick_y);
DrawText(text, 10, 30, 12, GREEN);
+ DrawText("Position", 150, 30, 12, GREEN);
+ sprintf(text, "x: %f", camera.position.x);
+ DrawText(text, 150, 45, 12, GREEN);
+ sprintf(text, "y: %f", camera.position.y);
+ DrawText(text, 150, 60, 12, GREEN);
+ sprintf(text, "z: %f", camera.position.z);
+ DrawText(text, 150, 75, 12, GREEN);
+ DrawText("Target", 220, 30, 12, GREEN);
+ sprintf(text, "%f", camera.target.x);
+ DrawText(text, 220, 45, 12, GREEN);
+ sprintf(text, "%f", camera.target.y);
+ DrawText(text, 220, 60, 12, GREEN);
+ sprintf(text, "%f", camera.target.z);
+ DrawText(text, 220, 75, 12, GREEN);
DrawFPS(10, 10);
EndDrawing();
diff --git a/src/player.c b/src/player.c
index ad8967b..eca796a 100644
--- a/src/player.c
+++ b/src/player.c
@@ -20,7 +20,7 @@ lookThroughPlayer(Camera camera, Player player, Player player2)
camera.target.x = player.position.x;
camera.target.y = player.position.y;
camera.target.z = player.position.z;
- //camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
+ camera.up = (Vector3){ 0.0f, 0.0f, 1.0f };
//camera.target = player2.position;
//camera.target = (Vector3){
// 0, 0, 0
diff --git a/src/render.c b/src/render.c
index 9188b6d..9203ece 100644
--- a/src/render.c
+++ b/src/render.c
@@ -19,15 +19,15 @@ renderWorld(World* world, Camera camera)
drawPlayer(&world->players[0]);
drawPlayer(&world->players[1]);
- for(int i = 0; i < 11; ++i){
- //DrawCube((Vector3){i,3,3}, 0.5f, 0.5f, 0.5f, YELLOW);
- //DrawCube((Vector3){i,4,3}, 0.5f, 0.5f, 0.5f, DARKPURPLE);
- //DrawCube((Vector3){i,5,3}, 0.5f, 0.5f, 0.5f, YELLOW);
- //DrawCube((Vector3){i,3,4}, 0.5f, 0.5f, 0.5f, MAGENTA);
- //DrawCube((Vector3){i,4,4}, 0.5f, 0.5f, 0.5f, GREEN);
+ for(int i = 0; i <= 3; ++i){
+ DrawCube((Vector3){i,3,3}, 0.5f, 0.5f, 0.5f, YELLOW);
+ DrawCube((Vector3){i,4,3}, 0.5f, 0.5f, 0.5f, DARKPURPLE);
+ DrawCube((Vector3){i,5,3}, 0.5f, 0.5f, 0.5f, YELLOW);
+ DrawCube((Vector3){i,3,4}, 0.5f, 0.5f, 0.5f, MAGENTA);
+ DrawCube((Vector3){i,4,4}, 0.5f, 0.5f, 0.5f, GREEN);
DrawCube((Vector3){i,5,4}, 0.5f, 0.5f, 0.5f, MAGENTA);
- DrawLineV((Vector2){i, 0}, (Vector2){i, 10}, BLACK);
- DrawLineV((Vector2){0, i}, (Vector2){10, i}, BLACK);
+ //DrawLineV((Vector2){i, -3}, (Vector2){i, 3}, BLACK);
+ //DrawLineV((Vector2){-3, i}, (Vector2){3, i}, BLACK);
}
//rlPopMatrix();
EndMode3D();