Added zombie for testing

This commit is contained in:
2025-08-31 22:55:58 -05:00
parent d7363921ad
commit 4a4d198617
47 changed files with 20 additions and 14 deletions

34
main.c
View File

@@ -157,21 +157,19 @@ int main(void)
UpdateCameraAngle(&g); UpdateCameraAngle(&g);
/*
// Load GLTF model (no animations) // Load GLTF model (no animations)
//Model model = LoadModel("resources/3d_models/bad_sphere.glb"); //Model model = LoadModel("resources/3d_models/bad_sphere.glb");
//Vector3 position = { 0.0f, 0.0f, 0.0f }; //Vector3 position = { 0.0f, 0.0f, 0.0f };
// Load a 2D image as texture for the billboard // Load a 2D image as texture for the billboard
//Billboards always point toward the active camera. //Billboards always point toward the active camera.
Texture2D sign = LoadTexture("resources/sprites/husk/ZOMBC1.png");
Texture2D sign = LoadTexture("resources/sprites/diard-charles.jpg");
GenTextureMipmaps(&sign); GenTextureMipmaps(&sign);
SetTextureFilter(sign, TEXTURE_FILTER_BILINEAR); // optional but looks nicer SetTextureFilter(sign, TEXTURE_FILTER_BILINEAR); // optional but looks nicer
Vector3 bbPos = (Vector3){ 1.0f, 2.5f, 1.0f }; // where in 3D world to place it Vector3 bbPos = (Vector3){ -1.0f, 2.0f, -1.0f }; // where in 3D world to place it
float bbSize = 5.0f; // billboard height in world units float bbSize = 4.0f; // billboard height in world units
*/
// Load a 2D image as texture for the billboard // Load a 2D image as texture for the billboard
//Billboards always point toward the active camera. //Billboards always point toward the active camera.
Texture2D tree = LoadTexture("resources/sprites/tree.png"); Texture2D tree = LoadTexture("resources/sprites/tree.png");
@@ -261,18 +259,18 @@ int main(void)
// Fog/vignette tuning // Fog/vignette tuning
float inner = 0.0f; // start radius (center under player) float inner = 0.0f; // start radius (center under player)
float outer = 20.0f; // how far until full fog float outer = 20.0f; // how far until full fog
float minShadow = 0.9f; // baseline darkness at the center (0 = none, 1 = pitch black) float minShadow = 0.85f; // baseline darkness at the center (0 = none, 1 = pitch black)
float sharpness = 2.0f; // steeper edge (optional if shader uses it) float sharpness = 2.0f; // steeper edge (optional if shader uses it)
Vector4 fogColor = {0.0f, 0.0f, 0.0f, 1.0f}; Vector4 fogColor = {0.0f, 0.0f, 0.0f, 1.0f};
// Flashligh tuning // Flashligh tuning
float spotAngleDeg = 35.0f; //cone angle float spotAngleDeg = 35.0f; //cone angle
float spotCos = cosf(DEG2RAD * (spotAngleDeg * 0.5f)); float spotCos = cosf(DEG2RAD * (spotAngleDeg * 0.5f));
float spotSoft = 0.05f; float spotSoft = 0.10f;
float lightRange = 150.0f; float lightRange = 100.0f;
float lightFade = 10.0f; float lightFade = 1.0f;
float intensity = 0.25f; // try 0.71.5 to taste float intensity = 0.25f; // try 0.71.5 to taste
float beamSpread = 0.00f; // try 0.150.35; higher = less “laser” at distance float beamSpread = 0.05f; // try 0.150.35; higher = less “laser” at distance
SetShaderValue(fog, locIntensity, &intensity, SHADER_UNIFORM_FLOAT); SetShaderValue(fog, locIntensity, &intensity, SHADER_UNIFORM_FLOAT);
SetShaderValue(fog, locBeamSpread, &beamSpread, SHADER_UNIFORM_FLOAT); SetShaderValue(fog, locBeamSpread, &beamSpread, SHADER_UNIFORM_FLOAT);
@@ -370,8 +368,13 @@ int main(void)
g.player.lean.x = Lerp(g.player.lean.x, sideway*0.02f, 10.0f*delta); g.player.lean.x = Lerp(g.player.lean.x, sideway*0.02f, 10.0f*delta);
g.player.lean.y = Lerp(g.player.lean.y, forward*0.015f, 10.0f*delta); g.player.lean.y = Lerp(g.player.lean.y, forward*0.015f, 10.0f*delta);
bbPos.x += (g.player.position.x - bbPos.x)*.005;
bbPos.z += (g.player.position.z - bbPos.z)*.005;
UpdateCameraAngle(&g); UpdateCameraAngle(&g);
break; break;
}; };
} }
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
@@ -430,6 +433,8 @@ int main(void)
RenderTrees(&g, tree, treepos, treeSize); RenderTrees(&g, tree, treepos, treeSize);
DrawBillboard(g.player.camera, sign, bbPos, bbSize, WHITE);
EndShaderMode(); EndShaderMode();
// Restore opaque cutoff for anything else you draw with that material later // Restore opaque cutoff for anything else you draw with that material later
@@ -463,6 +468,7 @@ int main(void)
UnloadModel(mdlTile); // frees the model and its mesh/VBOs UnloadModel(mdlTile); // frees the model and its mesh/VBOs
UnloadTexture(texGrass); // frees the grass texture you loaded UnloadTexture(texGrass); // frees the grass texture you loaded
UnloadTexture(tree); // frees tree texture UnloadTexture(tree); // frees tree texture
UnloadTexture(sign);
CloseWindow(); // Close window and OpenGL context CloseWindow(); // Close window and OpenGL context
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
@@ -724,7 +730,7 @@ static void RenderTrees(Master* g, Texture2D tree, Vector3 baseTreePos, float tr
// Placement knobs // Placement knobs
const int densityA = 10; // 1-in-10 on (odd,odd) const int densityA = 10; // 1-in-10 on (odd,odd)
const int densityB = 20; // 1-in-14 on (even,even) const int densityB = 13; // 1-in-14 on (even,even)
const float jitter = tileSize * 0.35f; // random in-tile offset const float jitter = tileSize * 0.35f; // random in-tile offset
const float groundY = baseTreePos.y; // <-- use this as terrain height const float groundY = baseTreePos.y; // <-- use this as terrain height

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.