Compare commits
12 Commits
cube_game
...
123063b3c5
| Author | SHA1 | Date | |
|---|---|---|---|
| 123063b3c5 | |||
| d40cc9b484 | |||
| 5a4cd2eb83 | |||
| 0927a0a531 | |||
| 20706dc060 | |||
| 1ccdba57a5 | |||
| 3298638725 | |||
| 15b2066ea2 | |||
| a79815eb7b | |||
| c24535ad67 | |||
| 7e48cd8496 | |||
| 0b357330a6 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.vscode/
|
||||||
18
.vscode/c_cpp_properties.json
vendored
18
.vscode/c_cpp_properties.json
vendored
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "linux-gcc-x64",
|
|
||||||
"includePath": [
|
|
||||||
"${workspaceFolder}/**"
|
|
||||||
],
|
|
||||||
"compilerPath": "/usr/bin/gcc",
|
|
||||||
"cStandard": "${default}",
|
|
||||||
"cppStandard": "${default}",
|
|
||||||
"intelliSenseMode": "linux-gcc-x64",
|
|
||||||
"compilerArgs": [
|
|
||||||
""
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"version": 4
|
|
||||||
}
|
|
||||||
14
.vscode/launch.json
vendored
14
.vscode/launch.json
vendored
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "Debug with CodeLLDB",
|
|
||||||
"type": "lldb",
|
|
||||||
"request": "launch",
|
|
||||||
"program": "${fileDirname}/${fileBasenameNoExtension}",
|
|
||||||
"args": [],
|
|
||||||
"cwd": "${fileDirname}",
|
|
||||||
"preLaunchTask": "C/C++: gcc build active file"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
59
.vscode/settings.json
vendored
59
.vscode/settings.json
vendored
@@ -1,59 +0,0 @@
|
|||||||
{
|
|
||||||
"C_Cpp_Runner.cCompilerPath": "gcc",
|
|
||||||
"C_Cpp_Runner.cppCompilerPath": "g++",
|
|
||||||
"C_Cpp_Runner.debuggerPath": "gdb",
|
|
||||||
"C_Cpp_Runner.cStandard": "",
|
|
||||||
"C_Cpp_Runner.cppStandard": "",
|
|
||||||
"C_Cpp_Runner.msvcBatchPath": "",
|
|
||||||
"C_Cpp_Runner.useMsvc": false,
|
|
||||||
"C_Cpp_Runner.warnings": [
|
|
||||||
"-Wall",
|
|
||||||
"-Wextra",
|
|
||||||
"-Wpedantic",
|
|
||||||
"-Wshadow",
|
|
||||||
"-Wformat=2",
|
|
||||||
"-Wcast-align",
|
|
||||||
"-Wconversion",
|
|
||||||
"-Wsign-conversion",
|
|
||||||
"-Wnull-dereference"
|
|
||||||
],
|
|
||||||
"C_Cpp_Runner.msvcWarnings": [
|
|
||||||
"/W4",
|
|
||||||
"/permissive-",
|
|
||||||
"/w14242",
|
|
||||||
"/w14287",
|
|
||||||
"/w14296",
|
|
||||||
"/w14311",
|
|
||||||
"/w14826",
|
|
||||||
"/w44062",
|
|
||||||
"/w44242",
|
|
||||||
"/w14905",
|
|
||||||
"/w14906",
|
|
||||||
"/w14263",
|
|
||||||
"/w44265",
|
|
||||||
"/w14928"
|
|
||||||
],
|
|
||||||
"C_Cpp_Runner.enableWarnings": true,
|
|
||||||
"C_Cpp_Runner.warningsAsError": false,
|
|
||||||
"C_Cpp_Runner.compilerArgs": [],
|
|
||||||
"C_Cpp_Runner.linkerArgs": [],
|
|
||||||
"C_Cpp_Runner.includePaths": [],
|
|
||||||
"C_Cpp_Runner.includeSearch": [
|
|
||||||
"*",
|
|
||||||
"**/*"
|
|
||||||
],
|
|
||||||
"C_Cpp_Runner.excludeSearch": [
|
|
||||||
"**/build",
|
|
||||||
"**/build/**",
|
|
||||||
"**/.*",
|
|
||||||
"**/.*/**",
|
|
||||||
"**/.vscode",
|
|
||||||
"**/.vscode/**"
|
|
||||||
],
|
|
||||||
"C_Cpp_Runner.useAddressSanitizer": false,
|
|
||||||
"C_Cpp_Runner.useUndefinedSanitizer": false,
|
|
||||||
"C_Cpp_Runner.useLeakSanitizer": false,
|
|
||||||
"C_Cpp_Runner.showCompilationTime": false,
|
|
||||||
"C_Cpp_Runner.useLinkTimeOptimization": false,
|
|
||||||
"C_Cpp_Runner.msvcSecureNoWarnings": false
|
|
||||||
}
|
|
||||||
26
.vscode/tasks.json
vendored
26
.vscode/tasks.json
vendored
@@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "2.0.0",
|
|
||||||
"tasks": [
|
|
||||||
{
|
|
||||||
"type": "shell",
|
|
||||||
"label": "C/C++: gcc build active file",
|
|
||||||
"command": "/usr/bin/gcc",
|
|
||||||
"args": [
|
|
||||||
"-g",
|
|
||||||
"${file}",
|
|
||||||
"-o",
|
|
||||||
"${fileDirname}/${fileBasenameNoExtension}"
|
|
||||||
],
|
|
||||||
"options": {
|
|
||||||
"cwd": "${fileDirname}"
|
|
||||||
},
|
|
||||||
"problemMatcher": [
|
|
||||||
"$gcc"
|
|
||||||
],
|
|
||||||
"group": {
|
|
||||||
"kind": "build",
|
|
||||||
"isDefault": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
21
Makefile
Normal file
21
Makefile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# 1. Variables (to avoid repeating yourself)
|
||||||
|
CC = gcc
|
||||||
|
CFLAGS = -Iinclude
|
||||||
|
LDFLAGS = -Llib -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
|
||||||
|
|
||||||
|
# 2. Default target (runs when you just type 'make')
|
||||||
|
default: visual text
|
||||||
|
|
||||||
|
# 3. Specific build targets
|
||||||
|
visual: ray.c
|
||||||
|
$(CC) ray.c -o ray.out $(CFLAGS) $(LDFLAGS)
|
||||||
|
|
||||||
|
text: text_physics.c
|
||||||
|
$(CC) text_physics.c -o text_physics.out $(CFLAGS) $(LDFLAGS)
|
||||||
|
|
||||||
|
# 4. Cleanup targets (all mapped to the same action)
|
||||||
|
clean clear rm remove wipe:
|
||||||
|
rm -f ray.out text_physics.out
|
||||||
|
|
||||||
|
# 5. Phony targets (tells make these are actions, not actual files)
|
||||||
|
.PHONY: default visual text clean clear rm remove wipe
|
||||||
25
README.md
Normal file
25
README.md
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# WrldBox Sandbox Simulator
|
||||||
|
|
||||||
|
## 🧊Introduction
|
||||||
|
|
||||||
|
**WrldBox** is a work-in-progress sandbox simulator made by Team wholeworldcoding. It is currently in an experimental stage.
|
||||||
|
|
||||||
|
It consists of two components:
|
||||||
|
|
||||||
|
- `text_physics.c`, a text-based 1-object physics simulation
|
||||||
|
|
||||||
|
- `ray.c`, rendering the simulation with raylib.
|
||||||
|
|
||||||
|
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 <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "raylib.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_x = 100; // Starting X (pixels)
|
||||||
float obj_y = 100; // Starting Y (pixels)
|
float obj_y = 100; // Starting Y (pixels)
|
||||||
float obj_vel_x = 50; // Velocity X (pixels/second)
|
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