Commenting edits and wrldbox study

This commit is contained in:
2026-06-17 21:08:12 -04:00
parent e2fb018c61
commit c2b802807d
4 changed files with 30 additions and 10 deletions

View File

@@ -24,6 +24,10 @@ Clone the repository. Once you have navigated to the folder, you can run:
- `make` - `make`
## 🌳 This Branch
This is the branch for the cube-based RPG.
## 🏅Credits ## 🏅Credits
This project was impossible without the support of all three `wholeworldcoding` members. This project was impossible without the support of all three `wholeworldcoding` members.

13
home/p7mj/idea.txt Normal file
View File

@@ -0,0 +1,13 @@
Develop a particular branch of this game into a RPG with a storyline and characters as cubes.
So the storyline I can think of now is:
You are a cube (pick name w/o numbers or symbols, and color)
You are in school
You like another cube, but the cube likes someone else
they get together and u get angry, first few missions is sabotage daily life of the other cube's xxxfriend
then it evolves into all out war

View File

@@ -20,20 +20,20 @@ int main(void)
SetTargetFPS(60); SetTargetFPS(60);
// Now we actually start the code InitWorld(); // from world.h
InitWorld();
printf("WrldBox engine started\n"); printf("WrldBox engine started\n");
printf("Gravity = %.2f\n", g); printf("Gravity = %.2f\n", g);
// until we close the window, expect inputs
while (!WindowShouldClose()) while (!WindowShouldClose())
{ {
// Calculate delta time for consistent performace across different FPSes
float dt = GetFrameTime(); float dt = GetFrameTime();
if (IsKeyPressed(KEY_P)) if (IsKeyPressed(KEY_P))
{ {
// If it's simulating, stop simulating. If it isn't simulating, start simulating. // Toggle simulation
isSimulating = !isSimulating; isSimulating = !isSimulating;
} }
@@ -45,8 +45,7 @@ int main(void)
if (IsKeyPressed(KEY_Q)) if (IsKeyPressed(KEY_Q))
{ {
// We're gonna have to rewrite the entity logic at some point. Because an actual game doesn't just contain a bunch of blocks. But whatever for now... // Test feature: spawn random cube
// Q key pressed? -> Poof, box, random position, random size, random color.
SpawnEntity( SpawnEntity(
GetRandomValue(50, 950), GetRandomValue(50, 950),
GetRandomValue(20, 150), GetRandomValue(20, 150),
@@ -88,6 +87,7 @@ int main(void)
ClearBackground(RAYWHITE); ClearBackground(RAYWHITE);
// Ground line
DrawLine( DrawLine(
0, 0,
(int)ground_y, (int)ground_y,
@@ -95,6 +95,7 @@ int main(void)
(int)ground_y, (int)ground_y,
DARKGRAY); DARKGRAY);
// Ground Text
DrawText( DrawText(
"GROUND", "GROUND",
10, 10,
@@ -102,9 +103,9 @@ int main(void)
20, 20,
DARKGRAY); DARKGRAY);
DrawEntities(); DrawEntities(); // from render.c
DrawRectangle( DrawRectangle( // title box
0, 0,
0, 0,
screenWidth, screenWidth,
@@ -133,6 +134,8 @@ int main(void)
20, 20,
BLACK); BLACK);
// if player exists, draw position and velocity
if (player) if (player)
{ {
DrawText( DrawText(
@@ -173,10 +176,10 @@ int main(void)
DrawText("Q = Random Cube", 700, 105, 18, BLACK); DrawText("Q = Random Cube", 700, 105, 18, BLACK);
DrawText("P = Pause | R = Reset", 700, 125, 18, BLACK); DrawText("P = Pause | R = Reset", 700, 125, 18, BLACK);
EndDrawing(); EndDrawing(); // end the current draw loop
} }
// When the window wants to close, close it. What a surprise. // At this point the window was closed
CloseWindow(); CloseWindow();
return 0; return 0;
} }

BIN
wrldbox

Binary file not shown.