diff --git a/main.c b/main.c index 86aaaa3..ffa9f57 100644 --- a/main.c +++ b/main.c @@ -157,21 +157,19 @@ int main(void) UpdateCameraAngle(&g); - /* + // Load GLTF model (no animations) //Model model = LoadModel("resources/3d_models/bad_sphere.glb"); //Vector3 position = { 0.0f, 0.0f, 0.0f }; // Load a 2D image as texture for the billboard //Billboards always point toward the active camera. - - Texture2D sign = LoadTexture("resources/sprites/diard-charles.jpg"); + Texture2D sign = LoadTexture("resources/sprites/husk/ZOMBC1.png"); GenTextureMipmaps(&sign); 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 - float bbSize = 5.0f; // billboard height in world units - */ - + Vector3 bbPos = (Vector3){ -1.0f, 2.0f, -1.0f }; // where in 3D world to place it + float bbSize = 4.0f; // billboard height in world units + // Load a 2D image as texture for the billboard //Billboards always point toward the active camera. Texture2D tree = LoadTexture("resources/sprites/tree.png"); @@ -261,18 +259,18 @@ int main(void) // Fog/vignette tuning float inner = 0.0f; // start radius (center under player) 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) Vector4 fogColor = {0.0f, 0.0f, 0.0f, 1.0f}; // Flashligh tuning float spotAngleDeg = 35.0f; //cone angle float spotCos = cosf(DEG2RAD * (spotAngleDeg * 0.5f)); - float spotSoft = 0.05f; - float lightRange = 150.0f; - float lightFade = 10.0f; + float spotSoft = 0.10f; + float lightRange = 100.0f; + float lightFade = 1.0f; float intensity = 0.25f; // try 0.7–1.5 to taste - float beamSpread = 0.00f; // try 0.15–0.35; higher = less “laser” at distance + float beamSpread = 0.05f; // try 0.15–0.35; higher = less “laser” at distance SetShaderValue(fog, locIntensity, &intensity, 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.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); - break; + break; }; } //---------------------------------------------------------------------------------- @@ -430,6 +433,8 @@ int main(void) RenderTrees(&g, tree, treepos, treeSize); + DrawBillboard(g.player.camera, sign, bbPos, bbSize, WHITE); + EndShaderMode(); // 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 UnloadTexture(texGrass); // frees the grass texture you loaded UnloadTexture(tree); // frees tree texture + UnloadTexture(sign); CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- @@ -724,7 +730,7 @@ static void RenderTrees(Master* g, Texture2D tree, Vector3 baseTreePos, float tr // Placement knobs 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 groundY = baseTreePos.y; // <-- use this as terrain height diff --git a/resources/sprites/husk/ZOMBA1.png b/resources/sprites/husk/ZOMBA1.png new file mode 100644 index 0000000..687e87a Binary files /dev/null and b/resources/sprites/husk/ZOMBA1.png differ diff --git a/resources/sprites/husk/ZOMBA2A8.png b/resources/sprites/husk/ZOMBA2A8.png new file mode 100644 index 0000000..0768141 Binary files /dev/null and b/resources/sprites/husk/ZOMBA2A8.png differ diff --git a/resources/sprites/husk/ZOMBA3A7.png b/resources/sprites/husk/ZOMBA3A7.png new file mode 100644 index 0000000..cb17e4b Binary files /dev/null and b/resources/sprites/husk/ZOMBA3A7.png differ diff --git a/resources/sprites/husk/ZOMBA4A6.png b/resources/sprites/husk/ZOMBA4A6.png new file mode 100644 index 0000000..48f6df1 Binary files /dev/null and b/resources/sprites/husk/ZOMBA4A6.png differ diff --git a/resources/sprites/husk/ZOMBA5.png b/resources/sprites/husk/ZOMBA5.png new file mode 100644 index 0000000..4206be4 Binary files /dev/null and b/resources/sprites/husk/ZOMBA5.png differ diff --git a/resources/sprites/husk/ZOMBB1.png b/resources/sprites/husk/ZOMBB1.png new file mode 100644 index 0000000..268e2fa Binary files /dev/null and b/resources/sprites/husk/ZOMBB1.png differ diff --git a/resources/sprites/husk/ZOMBB2B8.png b/resources/sprites/husk/ZOMBB2B8.png new file mode 100644 index 0000000..5f80166 Binary files /dev/null and b/resources/sprites/husk/ZOMBB2B8.png differ diff --git a/resources/sprites/husk/ZOMBB3B7.png b/resources/sprites/husk/ZOMBB3B7.png new file mode 100644 index 0000000..da3ab58 Binary files /dev/null and b/resources/sprites/husk/ZOMBB3B7.png differ diff --git a/resources/sprites/husk/ZOMBB4B6.png b/resources/sprites/husk/ZOMBB4B6.png new file mode 100644 index 0000000..78187ba Binary files /dev/null and b/resources/sprites/husk/ZOMBB4B6.png differ diff --git a/resources/sprites/husk/ZOMBB5.png b/resources/sprites/husk/ZOMBB5.png new file mode 100644 index 0000000..5a4bc89 Binary files /dev/null and b/resources/sprites/husk/ZOMBB5.png differ diff --git a/resources/sprites/husk/ZOMBC1.png b/resources/sprites/husk/ZOMBC1.png new file mode 100644 index 0000000..7b956a5 Binary files /dev/null and b/resources/sprites/husk/ZOMBC1.png differ diff --git a/resources/sprites/husk/ZOMBC2C8.png b/resources/sprites/husk/ZOMBC2C8.png new file mode 100644 index 0000000..8a20029 Binary files /dev/null and b/resources/sprites/husk/ZOMBC2C8.png differ diff --git a/resources/sprites/husk/ZOMBC3C7.png b/resources/sprites/husk/ZOMBC3C7.png new file mode 100644 index 0000000..bf42668 Binary files /dev/null and b/resources/sprites/husk/ZOMBC3C7.png differ diff --git a/resources/sprites/husk/ZOMBC4C6.png b/resources/sprites/husk/ZOMBC4C6.png new file mode 100644 index 0000000..1b3171a Binary files /dev/null and b/resources/sprites/husk/ZOMBC4C6.png differ diff --git a/resources/sprites/husk/ZOMBC5.png b/resources/sprites/husk/ZOMBC5.png new file mode 100644 index 0000000..e053ac9 Binary files /dev/null and b/resources/sprites/husk/ZOMBC5.png differ diff --git a/resources/sprites/husk/ZOMBD1.png b/resources/sprites/husk/ZOMBD1.png new file mode 100644 index 0000000..0250f78 Binary files /dev/null and b/resources/sprites/husk/ZOMBD1.png differ diff --git a/resources/sprites/husk/ZOMBD2D8.png b/resources/sprites/husk/ZOMBD2D8.png new file mode 100644 index 0000000..49958a5 Binary files /dev/null and b/resources/sprites/husk/ZOMBD2D8.png differ diff --git a/resources/sprites/husk/ZOMBD3D7.png b/resources/sprites/husk/ZOMBD3D7.png new file mode 100644 index 0000000..04d58c2 Binary files /dev/null and b/resources/sprites/husk/ZOMBD3D7.png differ diff --git a/resources/sprites/husk/ZOMBD4D6.png b/resources/sprites/husk/ZOMBD4D6.png new file mode 100644 index 0000000..4c380f3 Binary files /dev/null and b/resources/sprites/husk/ZOMBD4D6.png differ diff --git a/resources/sprites/husk/ZOMBD5.png b/resources/sprites/husk/ZOMBD5.png new file mode 100644 index 0000000..0b2d180 Binary files /dev/null and b/resources/sprites/husk/ZOMBD5.png differ diff --git a/resources/sprites/husk/ZOMBE1.png b/resources/sprites/husk/ZOMBE1.png new file mode 100644 index 0000000..2af6c81 Binary files /dev/null and b/resources/sprites/husk/ZOMBE1.png differ diff --git a/resources/sprites/husk/ZOMBE2E8.png b/resources/sprites/husk/ZOMBE2E8.png new file mode 100644 index 0000000..800313a Binary files /dev/null and b/resources/sprites/husk/ZOMBE2E8.png differ diff --git a/resources/sprites/husk/ZOMBE3E7.png b/resources/sprites/husk/ZOMBE3E7.png new file mode 100644 index 0000000..bae4022 Binary files /dev/null and b/resources/sprites/husk/ZOMBE3E7.png differ diff --git a/resources/sprites/husk/ZOMBE4E6.png b/resources/sprites/husk/ZOMBE4E6.png new file mode 100644 index 0000000..9551918 Binary files /dev/null and b/resources/sprites/husk/ZOMBE4E6.png differ diff --git a/resources/sprites/husk/ZOMBE5.png b/resources/sprites/husk/ZOMBE5.png new file mode 100644 index 0000000..e371dca Binary files /dev/null and b/resources/sprites/husk/ZOMBE5.png differ diff --git a/resources/sprites/husk/ZOMBF1.png b/resources/sprites/husk/ZOMBF1.png new file mode 100644 index 0000000..951ff7d Binary files /dev/null and b/resources/sprites/husk/ZOMBF1.png differ diff --git a/resources/sprites/husk/ZOMBF2F8.png b/resources/sprites/husk/ZOMBF2F8.png new file mode 100644 index 0000000..69746bf Binary files /dev/null and b/resources/sprites/husk/ZOMBF2F8.png differ diff --git a/resources/sprites/husk/ZOMBF3F7.png b/resources/sprites/husk/ZOMBF3F7.png new file mode 100644 index 0000000..82ea927 Binary files /dev/null and b/resources/sprites/husk/ZOMBF3F7.png differ diff --git a/resources/sprites/husk/ZOMBF4F6.png b/resources/sprites/husk/ZOMBF4F6.png new file mode 100644 index 0000000..7f26758 Binary files /dev/null and b/resources/sprites/husk/ZOMBF4F6.png differ diff --git a/resources/sprites/husk/ZOMBF5.png b/resources/sprites/husk/ZOMBF5.png new file mode 100644 index 0000000..6aa60f1 Binary files /dev/null and b/resources/sprites/husk/ZOMBF5.png differ diff --git a/resources/sprites/husk/ZOMBG1.png b/resources/sprites/husk/ZOMBG1.png new file mode 100644 index 0000000..b43f308 Binary files /dev/null and b/resources/sprites/husk/ZOMBG1.png differ diff --git a/resources/sprites/husk/ZOMBG2G8.png b/resources/sprites/husk/ZOMBG2G8.png new file mode 100644 index 0000000..2ee99b7 Binary files /dev/null and b/resources/sprites/husk/ZOMBG2G8.png differ diff --git a/resources/sprites/husk/ZOMBG3G7.png b/resources/sprites/husk/ZOMBG3G7.png new file mode 100644 index 0000000..8a90b2a Binary files /dev/null and b/resources/sprites/husk/ZOMBG3G7.png differ diff --git a/resources/sprites/husk/ZOMBG4G6.png b/resources/sprites/husk/ZOMBG4G6.png new file mode 100644 index 0000000..840e889 Binary files /dev/null and b/resources/sprites/husk/ZOMBG4G6.png differ diff --git a/resources/sprites/husk/ZOMBG5.png b/resources/sprites/husk/ZOMBG5.png new file mode 100644 index 0000000..2a95cb6 Binary files /dev/null and b/resources/sprites/husk/ZOMBG5.png differ diff --git a/resources/sprites/husk/ZOMBH1.png b/resources/sprites/husk/ZOMBH1.png new file mode 100644 index 0000000..3d65091 Binary files /dev/null and b/resources/sprites/husk/ZOMBH1.png differ diff --git a/resources/sprites/husk/ZOMBH2H8.png b/resources/sprites/husk/ZOMBH2H8.png new file mode 100644 index 0000000..dadfc20 Binary files /dev/null and b/resources/sprites/husk/ZOMBH2H8.png differ diff --git a/resources/sprites/husk/ZOMBH3H7.png b/resources/sprites/husk/ZOMBH3H7.png new file mode 100644 index 0000000..5c997bd Binary files /dev/null and b/resources/sprites/husk/ZOMBH3H7.png differ diff --git a/resources/sprites/husk/ZOMBH4H6.png b/resources/sprites/husk/ZOMBH4H6.png new file mode 100644 index 0000000..fef01cb Binary files /dev/null and b/resources/sprites/husk/ZOMBH4H6.png differ diff --git a/resources/sprites/husk/ZOMBH5.png b/resources/sprites/husk/ZOMBH5.png new file mode 100644 index 0000000..f1a948b Binary files /dev/null and b/resources/sprites/husk/ZOMBH5.png differ diff --git a/resources/sprites/husk/ZOMBI0.png b/resources/sprites/husk/ZOMBI0.png new file mode 100644 index 0000000..9f3d34f Binary files /dev/null and b/resources/sprites/husk/ZOMBI0.png differ diff --git a/resources/sprites/husk/ZOMBJ0.png b/resources/sprites/husk/ZOMBJ0.png new file mode 100644 index 0000000..7b39cac Binary files /dev/null and b/resources/sprites/husk/ZOMBJ0.png differ diff --git a/resources/sprites/husk/ZOMBK0.png b/resources/sprites/husk/ZOMBK0.png new file mode 100644 index 0000000..25e0f2b Binary files /dev/null and b/resources/sprites/husk/ZOMBK0.png differ diff --git a/resources/sprites/husk/ZOMBL0.png b/resources/sprites/husk/ZOMBL0.png new file mode 100644 index 0000000..f106885 Binary files /dev/null and b/resources/sprites/husk/ZOMBL0.png differ diff --git a/resources/sprites/husk/ZOMBM0.png b/resources/sprites/husk/ZOMBM0.png new file mode 100644 index 0000000..1674381 Binary files /dev/null and b/resources/sprites/husk/ZOMBM0.png differ diff --git a/resources/sprites/husk/husk_mutant.zip b/resources/sprites/husk/husk_mutant.zip new file mode 100644 index 0000000..ec3d22d Binary files /dev/null and b/resources/sprites/husk/husk_mutant.zip differ