Working ray.c
This commit is contained in:
25
README.md
25
README.md
@@ -1,14 +1,25 @@
|
||||
# WrldBox Sandbox Simulator
|
||||
|
||||
**WrldBox** is a work-in-progress sandbox simulator made by Team wholeworldcoding.
|
||||
## 🧊Introduction
|
||||
|
||||
Currently, it is in a prototype/experimental stage:
|
||||
**WrldBox** is a work-in-progress sandbox simulator made by Team wholeworldcoding. It is currently in an experimental stage.
|
||||
|
||||
- Rendering is extremely buggy. `ray.c` experiences orientation problems and is vibe coded and unchecked.
|
||||
It consists of two components:
|
||||
|
||||
The only usuable product is `text_physics.c`. This is a text physics simulator that simulates 2D physics.
|
||||
- `text_physics.c`, a text-based 1-object physics simulation
|
||||
|
||||
Expect more updates. This has huge potential to become the next big `wholeworldcoding` project.
|
||||
- `ray.c`, rendering the simulation with raylib.
|
||||
|
||||
> [!TIP]
|
||||
> Don't expect anything to work!
|
||||
This project has a huge potential to become the next major `wholeworldcoding` project.
|
||||
|
||||
## 🛠️ Build and Compile
|
||||
|
||||
Clone the repository. Once you have navigated to the folder, you can run:
|
||||
|
||||
- `make text && ./text_physics.out` to compile and run `text_physics.c`
|
||||
|
||||
- `make visual && ./ray.out` to compile and run `ray.c`
|
||||
|
||||
## 🏅Credits
|
||||
|
||||
This project was impossible without the support of all three `wholeworldcoding` members.
|
||||
9
ray.c
9
ray.c
@@ -1,8 +1,15 @@
|
||||
// ray.c A-0-i by team wholeworldcoding.
|
||||
// working physics simulation with 1 object, limited playground and fixed parameters
|
||||
// This is P7MJ, out.
|
||||
|
||||
// Changes:
|
||||
// Reversing gravity makes it work?!!!
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "raylib.h"
|
||||
|
||||
const float g = -9.81;
|
||||
const float g = 9.81; // Gravity is inversed cause raylib uses top right corner as origin
|
||||
float obj_x = 100; // Starting X (pixels)
|
||||
float obj_y = 100; // Starting Y (pixels)
|
||||
float obj_vel_x = 50; // Velocity X (pixels/second)
|
||||
|
||||
4
structure.txt
Normal file
4
structure.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
launcher.c
|
||||
render.c
|
||||
character.c
|
||||
physics.c
|
||||
Reference in New Issue
Block a user