From e3d80fbb561d43e53d8fd7bac49f46dbadfd291e Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 24 Nov 2025 02:49:11 -0700 Subject: Working on things and broke something This reverts commit fc72bf3d757340382ad8e422eb31e701577544f8. --- design.org | 163 ++++++++++++++++++++++++++++++++++++++++++++++ design/design.org | 163 ---------------------------------------------- design/find-things-ui.png | Bin 4803 -> 0 bytes src/game.c | 5 ++ src/game.h | 2 + src/map.c | 35 ++++++++++ src/map.h | 16 +++++ src/settings.c | 2 + src/settings.h | 4 ++ src/world.c | 1 + 10 files changed, 228 insertions(+), 163 deletions(-) create mode 100644 design.org delete mode 100644 design/design.org delete mode 100644 design/find-things-ui.png create mode 100644 src/map.c create mode 100644 src/map.h diff --git a/design.org b/design.org new file mode 100644 index 0000000..e884d4e --- /dev/null +++ b/design.org @@ -0,0 +1,163 @@ +* General concept +A old creepy hag asks you to find something. Her request is very strange and +vague. If you bring back the wrong thing too many times she snaps your neck, if +you don't find it fast enough she snaps your neck, if you do *anything* wrong +she snaps your neck! If you find it you are rewarded a sticky nickel, old +mint... + +* Style +Surrealism, dry humor, dark humor, absurdity... Basically Whangdoodle Land +turned ghetto. You can freely roam the open world but its best to stay focused +on the task at hand and also keep your eyes pealed for things that might be +helpful in up coming requests. + +It will be made with poorly done 3d graphics. Colorful yet dark, magical yet +run down (like a out of order Disney Land)... + +* Game play +You pretty much have to bend over backwards to find whatever the old hag +wants. This includes asking the very strange looking npcs, building crazy rigs +to get places, trading items at suspicious shops, digging through trashcans, +fishing in the radio active pond, searching a prostitute's /fuck holes/... + +* End of game +On the last request you will have the items required for killing the old +hag. You will come across a old hag killing guide while doing the last +request. If you kill her you win. If you are a good boy and continue as she +said you will have your neck snapped no matter what you do. + +* Characters ++ Kiddo the main character. ++ Samantha the old hag. ++ John the shop keeper (just Ron with a beard and mostly bald head). ++ Ron the music store owner (just John with a mustache and long hair). ++ Tod the bartender (also looks like John and Ron). ++ Bethany the prostitute. ++ Frog Man the christian plug. ++ Jesus. + +* Place ++ Back woods. Most of the world. ++ Samantha's spot. Just a trash pile under a tree. ++ John's shop (you will never see John and Ron in the same place at the same + time). ++ Ron's shop. ++ Laundromat. ++ Frog Man's spot. Its just a bean bag chair in a cardboard hut behind a + dumpster. ++ Bethany's place. ++ Public park. ++ Radio active pond. ++ Bar, /there is no bar everyone just gets wasted in the streets./ ++ The church. + +* Items you need to find +1. Car keys. +2. Can of conk (off brand coke). +3. Half smoked cig. +4. Creepy doll. +5. Funk gun (its always aimed at the person holding it). +6. Half melted ice cream sandwich. +7. Holy bible. +8. White jazz bass. +9. Guitar pick. +10. Pair of old boots (do not bring back a pair of new boots or at least ones + that look new). +11. Three eyed fish. +12. Sad looking x-max tree. +13. Massive hard drive. +14. The real Easter Bunny (for the Easter BBQ). +15. Stolen skateboard. +16. Cat skeleton. +17. /Bitches Stew by Meter David/ record copy. +18. Used condom. +19. Laptop running Haiku OS. +20. Nuclear Ninja Tortoise. + +* Rest of the items [2/43] ++ [X] Old mint. ++ [X] Sticky nickel. ++ [ ] Dollaridoo. ++ [ ] Bent screw. ++ [ ] Left handed screw driver. ++ [ ] Foam cup. ++ [ ] Plastic cup. ++ [ ] Receipt. ++ [ ] Used tea bag. ++ [ ] ABC gum. ++ [ ] bullet shell. ++ [ ] Lighter (out of lighter fluid). ++ [ ] Emergency radio. ++ [ ] Calculator. ++ [ ] Copy of /The Winston Niles Rumfoord Pocket History of Mars/. ++ [ ] Copy of /The Day the World Ended/ by Jonah (Rumor has it John wrote it). ++ [ ] Ice 9. ++ [ ] Bullet. Out of gun powder. Ice 9 was the best we can do. ++ [ ] Rotten eye ball. ++ [ ] Moldy finger. ++ [ ] Slightly broken rake. ++ [ ] Old but perfectly usable Thought Slap. ++ [ ] Apple (with worm). ++ [ ] Bag of surreal cheese snacks. Results of an insane mind they are. ++ [ ] Blood covered ladder. ++ [ ] Yard weed (no one knows if it actually has THC but they keep smoking it + anyways). ++ [ ] Fire Bird guitar. ++ [ ] Glock. An overrated firearm made out of plastic. ++ [ ] Ice pick with eyeball flesh on it. ++ [ ] Opium lollipop. Looks just like a poppy plant and likely been up someones + ass. ++ [ ] A glock with a ice pick taped to the firing side and a opium lollipop to + the other. Said to have been used for lobotomies: opium to numb them, ice + pick to preform it, and gun in case something goes wrong. ++ [ ] Phishing rod. ++ [ ] Fire extinguisher. ++ [ ] Bicycle vroom. ++ [ ] Motor vroom. ++ [ ] Scout knife. It was not well kept. ++ [ ] Garfield flashlight. ++ [ ] Berger from Ye Berger Lord. ++ [ ] Blood covered rock. ++ [ ] Blood covered hammer. ++ [ ] Duck tape. No, duck tape should not be used as a permanent fix! ++ [ ] Infrared goggles. ++ [ ] Night vision goggles. + +* Design and programming ++ It will have a open world making heavy use of height maps. ++ No real physics, just dummy physics. ++ Nearly everything will be a intractable object. ++ Very lite and careful use of memory allocation. Use the stack a lot more. ++ Procedural generation. ++ Use bounding volume hierarchy for entities (the game is quite static). ++ Mesh instancing as much as possible. + +** Intractable objects +All objects will have a simple object id. When you interact with it the +procedure for that object will be called. The ids can also be used for mesh +instancing. + +** Procedural generation +The world will be procedural generated and try to make sure every world it +creates is possible to beat. A little wack is fine as long as its +beatable. Since most of the world will just be a height map a image will be +generated first than rest of the world will be based around it. + +* TODO World generation check list [6/8] ++ [X] Basic terrain ++ [X] Ground texture ++ [X] Trees/plants ++ [X] Sky ++ [X] Pond ++ [X] Power lines ++ [ ] Places ++ [ ] Roads + +* TODO Check list [0/5] ++ [ ] World generation completed ++ [ ] Menu and UI ++ [ ] Interaction system ++ [ ] All characters added ++ [ ] All items added ++ [ ] All levels added + diff --git a/design/design.org b/design/design.org deleted file mode 100644 index e884d4e..0000000 --- a/design/design.org +++ /dev/null @@ -1,163 +0,0 @@ -* General concept -A old creepy hag asks you to find something. Her request is very strange and -vague. If you bring back the wrong thing too many times she snaps your neck, if -you don't find it fast enough she snaps your neck, if you do *anything* wrong -she snaps your neck! If you find it you are rewarded a sticky nickel, old -mint... - -* Style -Surrealism, dry humor, dark humor, absurdity... Basically Whangdoodle Land -turned ghetto. You can freely roam the open world but its best to stay focused -on the task at hand and also keep your eyes pealed for things that might be -helpful in up coming requests. - -It will be made with poorly done 3d graphics. Colorful yet dark, magical yet -run down (like a out of order Disney Land)... - -* Game play -You pretty much have to bend over backwards to find whatever the old hag -wants. This includes asking the very strange looking npcs, building crazy rigs -to get places, trading items at suspicious shops, digging through trashcans, -fishing in the radio active pond, searching a prostitute's /fuck holes/... - -* End of game -On the last request you will have the items required for killing the old -hag. You will come across a old hag killing guide while doing the last -request. If you kill her you win. If you are a good boy and continue as she -said you will have your neck snapped no matter what you do. - -* Characters -+ Kiddo the main character. -+ Samantha the old hag. -+ John the shop keeper (just Ron with a beard and mostly bald head). -+ Ron the music store owner (just John with a mustache and long hair). -+ Tod the bartender (also looks like John and Ron). -+ Bethany the prostitute. -+ Frog Man the christian plug. -+ Jesus. - -* Place -+ Back woods. Most of the world. -+ Samantha's spot. Just a trash pile under a tree. -+ John's shop (you will never see John and Ron in the same place at the same - time). -+ Ron's shop. -+ Laundromat. -+ Frog Man's spot. Its just a bean bag chair in a cardboard hut behind a - dumpster. -+ Bethany's place. -+ Public park. -+ Radio active pond. -+ Bar, /there is no bar everyone just gets wasted in the streets./ -+ The church. - -* Items you need to find -1. Car keys. -2. Can of conk (off brand coke). -3. Half smoked cig. -4. Creepy doll. -5. Funk gun (its always aimed at the person holding it). -6. Half melted ice cream sandwich. -7. Holy bible. -8. White jazz bass. -9. Guitar pick. -10. Pair of old boots (do not bring back a pair of new boots or at least ones - that look new). -11. Three eyed fish. -12. Sad looking x-max tree. -13. Massive hard drive. -14. The real Easter Bunny (for the Easter BBQ). -15. Stolen skateboard. -16. Cat skeleton. -17. /Bitches Stew by Meter David/ record copy. -18. Used condom. -19. Laptop running Haiku OS. -20. Nuclear Ninja Tortoise. - -* Rest of the items [2/43] -+ [X] Old mint. -+ [X] Sticky nickel. -+ [ ] Dollaridoo. -+ [ ] Bent screw. -+ [ ] Left handed screw driver. -+ [ ] Foam cup. -+ [ ] Plastic cup. -+ [ ] Receipt. -+ [ ] Used tea bag. -+ [ ] ABC gum. -+ [ ] bullet shell. -+ [ ] Lighter (out of lighter fluid). -+ [ ] Emergency radio. -+ [ ] Calculator. -+ [ ] Copy of /The Winston Niles Rumfoord Pocket History of Mars/. -+ [ ] Copy of /The Day the World Ended/ by Jonah (Rumor has it John wrote it). -+ [ ] Ice 9. -+ [ ] Bullet. Out of gun powder. Ice 9 was the best we can do. -+ [ ] Rotten eye ball. -+ [ ] Moldy finger. -+ [ ] Slightly broken rake. -+ [ ] Old but perfectly usable Thought Slap. -+ [ ] Apple (with worm). -+ [ ] Bag of surreal cheese snacks. Results of an insane mind they are. -+ [ ] Blood covered ladder. -+ [ ] Yard weed (no one knows if it actually has THC but they keep smoking it - anyways). -+ [ ] Fire Bird guitar. -+ [ ] Glock. An overrated firearm made out of plastic. -+ [ ] Ice pick with eyeball flesh on it. -+ [ ] Opium lollipop. Looks just like a poppy plant and likely been up someones - ass. -+ [ ] A glock with a ice pick taped to the firing side and a opium lollipop to - the other. Said to have been used for lobotomies: opium to numb them, ice - pick to preform it, and gun in case something goes wrong. -+ [ ] Phishing rod. -+ [ ] Fire extinguisher. -+ [ ] Bicycle vroom. -+ [ ] Motor vroom. -+ [ ] Scout knife. It was not well kept. -+ [ ] Garfield flashlight. -+ [ ] Berger from Ye Berger Lord. -+ [ ] Blood covered rock. -+ [ ] Blood covered hammer. -+ [ ] Duck tape. No, duck tape should not be used as a permanent fix! -+ [ ] Infrared goggles. -+ [ ] Night vision goggles. - -* Design and programming -+ It will have a open world making heavy use of height maps. -+ No real physics, just dummy physics. -+ Nearly everything will be a intractable object. -+ Very lite and careful use of memory allocation. Use the stack a lot more. -+ Procedural generation. -+ Use bounding volume hierarchy for entities (the game is quite static). -+ Mesh instancing as much as possible. - -** Intractable objects -All objects will have a simple object id. When you interact with it the -procedure for that object will be called. The ids can also be used for mesh -instancing. - -** Procedural generation -The world will be procedural generated and try to make sure every world it -creates is possible to beat. A little wack is fine as long as its -beatable. Since most of the world will just be a height map a image will be -generated first than rest of the world will be based around it. - -* TODO World generation check list [6/8] -+ [X] Basic terrain -+ [X] Ground texture -+ [X] Trees/plants -+ [X] Sky -+ [X] Pond -+ [X] Power lines -+ [ ] Places -+ [ ] Roads - -* TODO Check list [0/5] -+ [ ] World generation completed -+ [ ] Menu and UI -+ [ ] Interaction system -+ [ ] All characters added -+ [ ] All items added -+ [ ] All levels added - diff --git a/design/find-things-ui.png b/design/find-things-ui.png deleted file mode 100644 index fa60e24..0000000 Binary files a/design/find-things-ui.png and /dev/null differ diff --git a/src/game.c b/src/game.c index 6f87639..e2cf7e8 100644 --- a/src/game.c +++ b/src/game.c @@ -82,6 +82,9 @@ void initGame(Game* game) game->player.camera.fovy = game->settings.fov; game->player.position = Vector3Scale(game->world.size, 0.5); + // Map. + initMap(&game->map, &game->settings); + disableGameCursor(game); } @@ -182,6 +185,8 @@ void updateGameScene(Game* game) drawGameScreen(game); + updateMap(&game->map, game); + // Cross hair. if (IsKeyPressed(game->settings.toggleCrossHairKey)) { diff --git a/src/game.h b/src/game.h index d917d70..a58d4c9 100644 --- a/src/game.h +++ b/src/game.h @@ -4,6 +4,7 @@ #include "player.h" #include "world.h" #include "entity.h" +#include "map.h" #ifndef GAME_H #define GAME_H @@ -22,6 +23,7 @@ struct Game { Player player; World world; Model skybox; + Map map; SceneId sceneId; bool isCursorEnabled; diff --git a/src/map.c b/src/map.c new file mode 100644 index 0000000..ebcb077 --- /dev/null +++ b/src/map.c @@ -0,0 +1,35 @@ +#include "map.h" +#include "game.h" + +void repositionMap(Map* map) +{ + map->rect.x = GetRenderWidth() - map->rect.width; +} + +void initMap(Map* map, const Settings* settings) +{ + *map = (Map){ + .rect = (Rectangle){0.0, 0.0, settings->mapPreviewSize, + settings->mapPreviewSize}, + .isEnabled = settings->isMapPreviewEnabledDefault, + .isFullSize = false + }; + + repositionMap(map); +} + +void updateMap(Map* map, Game* game) +{ + // Handle window resize. + if (IsWindowResized()) + { + repositionMap(map); + } + + if (!map->isEnabled) + { + return; + } + + DrawRectangleLinesEx(map->rect, 3.0, BLUE); +} diff --git a/src/map.h b/src/map.h new file mode 100644 index 0000000..ce4e71e --- /dev/null +++ b/src/map.h @@ -0,0 +1,16 @@ +#include "utils.h" +#include "settings.h" + +#ifndef MAP_H +#define MAP_H + +typedef struct { + Rectangle rect; + bool isEnabled; + bool isFullSize; +} Map; + +void initMap(Map* map, const Settings* settings); +void updateMap(Map* map, Game* game); + +#endif diff --git a/src/settings.c b/src/settings.c index 3171811..26caa73 100644 --- a/src/settings.c +++ b/src/settings.c @@ -18,6 +18,8 @@ Settings defaultSettings() .crossHairSize = 8.0, .crossHairThickness = 3.0, .crossHairColor = BLUE, + .isMapPreviewEnabledDefault = true, + .mapPreviewSize = 300.0, .mouseSpeed = 0.1, .forwardKey = KEY_W, .backwardKey = KEY_S, diff --git a/src/settings.h b/src/settings.h index 468f402..118bf84 100644 --- a/src/settings.h +++ b/src/settings.h @@ -33,6 +33,10 @@ typedef struct { float crossHairThickness; Color crossHairColor; + // Map. + bool isMapPreviewEnabledDefault; + float mapPreviewSize; + // Controls. float mouseSpeed; KeyboardKey forwardKey; diff --git a/src/world.c b/src/world.c index 6f2e093..a6fdf24 100644 --- a/src/world.c +++ b/src/world.c @@ -516,6 +516,7 @@ void generateWorldSamanthasPlace(World* world, const Assets* assets, Entity samantha = createEntity(SAMANTHA, Vector3Add(center, SAMANTHA_OFFSET)); world->entities[*placeId] = samantha; + *placeId = *placeId + 1; // Trashcans yippee! Vector3 trashPosition = (Vector3){-SAMANTHAS_SPOT, -- cgit v1.2.3