A mini game where you have to decorate shells for your crab customers :D
A mini game where you have to decorate shells for your crab customers :D
I built a small crab dress up game! i made this project to practice my core coding skills by practicing concepts of loops, functions, dictionaries, etc through this game. i wasnât expecting this project to take as long, but iâm glad i got to solve many problems and learnt why and how to fix them in godot :â)) it was definitely challenging figuring out how to initially set up the random order generation with the random crabs all in a single animation player, but it ended up working really well for my game! iâm really proud of my game overall, and canât wait to keep adding more features to make it better. this game isnât complete and there may be a few bugs(pause button menu only works on second press TT) or glitches, but please do leave some feedback for me to keep improving this game!
last devlog for this game woohooo. i added another animation player on the home screen so now the crabâs shell changes every few seconds, giving it a more dress uppy feel before you even start the game. then i wanted to add an overlay menu when the pause button is pressed, it displays 2 buttons, one to go back to the home screen and one to view the credits. so i created a new canvas layer for the credits scene and decorated it with different shells and the robber crab >:)) that would be visible when the credits button was pressed, but i was facing some issues with the input process mode when paused. even though i set my area 2d inputs process mode to âwhen pausedâ orâalwaysâ it wouldnât register the mouse clicks to the area 2d
so then to avoid that mess i created a new scene that it would direct you to, which isnât ideal for mid gameplay, but it is what it is for now. i may change it in the future to have the credits on the home screen for less resources and just easier navigability.
once that was done, there came a new issue! on the first press of the pause button, the collision shapes didnât disable!
iâm not really sure how to fix this, i used multiple methods like setting using deferred() to wait a frame, then enable it, using .input_pickable == true to let mouse clicks work in a paused game state, but it didnât work out TT. iâll take a break from this game, study for exams and come back to this and debug it properly
lastly, i fixed the glitch where the crab spawns on the screen briefly, then spawns again when the game first starts by resetting the animation track player position to the beginning of the track!
but yeah the core gameplay and necessities are all done!
iâl create the readme and upload to itch next before shipping later :DD
Log in to leave a comment
yesterday i added a probability array to receive a special crab event, then i thought maybe we could apply that to the extras upgrades during shell orders and place them with dynamic pricing! so i modified the pool, the extra is chosen depending on what day the player is on. if the player is on day 7, they have a 50% chance to use their upgrade on a crab order to get a few extra pearls vs on the first 4 days the player has a 25% chance of being able to use their extra upgrade for extra pearls on a crab order. I also added more singular extras to each specific extra pool. so instead of the stars being a fixed set amount, the number of stars on the order increases your pearl count! but to keep it less of a chance to get that, i added more singular stars and barnacles to their respective build pool function.
then, i animated the wave on the menu and game page so it gives more life to it lol. i think i will try to animate the fish the crab is on or make the crabs claws on the menu move a little so theres a little more to look at.
after, i was updating the shop prices previously everything was under 600. but with the addition of bonus pearls from achievements, special events like rich crab, and pearls from correctly placed extras, it was too easy to get all the extras before day 10. so i increased prices from(100,600) to (150,1800), and it works! the last shop item is unlockable on day 8 or 9, and if youâre lucky and get visited by rich crab multiple times, even day 7 is possible!
iâm facing a few annoying bugsss, like the crab doesnât leave when at the end day or the previous extras are showing on top of the robber crab, and achievements arenât updating in the achievements tab anymoreâŠ
hopefully i can get all the bugs fixed up before flavortown ends and ship 
Log in to leave a comment
achievements are now working!!
i used 2 array indexing to set the .text property to the correct display text in the global script. I removed my 2nd anim track to fade the achievement pop up and just added those key frames into the enter achievement popup to reduce code lines and keep it simpler lol. I also added if else statements when you click on the achievement toggle to check if you have unlocked an achievement, to set the text context of each achievement to unlocked based on the global script.
i ran into a few issues, for some reason my continue button to close the achievement panel isnât workinggg TT. it works when i test it by itself at the start of the game, but when i test it mid game, the close button doesnât work. Iâm thinking some inputs are not allowing to click it, which doesnât really make sense, as the collision shapes behind it have the process mode set to inherit, which shouldnât be clickable when pausedâŠ. so i have to do a little digging to figure out how to fix that issue.
next, i added the 2 new crabs! i created a new export var @export var special_crab_textures: Array[Texture2D] to hold the rich and robber crab as not to mess with logic of the normal crab. then i created a probability array [0,0,0,0,0,0,1] with 1 being the chance to receive a special crab event. and if it lands on 1 then it randomly picks if its a robber crab or rich crab. i made the rich crab give out 60/30 pearls, and the robber take 25 pearls. i also started setting up the robber crab stealing purchased extras, but iâm just too tired to actually code it rn lol, will finish this up tomorrow morning! lastly, i took the anim player from the menu screen with the bubbles, edited the positions a little and placed them in the game screen!
this game is almost done, just a few more additions and tweaks, and itâll be ready to ship!
Log in to leave a comment
i set up the musiccc! i think the track i chose fits the vibe perfectly. i have to search for sfx for like ambient ocean noise or bubble noise and maybe when we earn pearls lol. i learnt how to use preload() when i was working on b4 i fade, my other game, and i had the chance to use it here for the music implementation
. it was kinda confusing setting the music to loop since the audio stream played doesnât have a loop property in the inspector, but allows music.loop = true in code xD
i also started setting up an achievement panel, animations, and a global dictionary for unlocking the achievements. at first i set the achievement unlocking with classes, and i would create a new object for each achievement, but iâm lowk just learning classes in c++ at my college and donât wanna confuse myself with gd script classes, so i just stuck to what i know best, dictionary. i created the name, desc, reward count, and unlocked for each achievement. maybe if i pass my next cs exam iâll implement a class as tribute in my next game
since i didnât implement classes, i wanted to see if there was a thing like dynamic memory allocation like in c++, but after researching a little, i found out that godot manages it memory and cleans up whatever is not being used!! i plan to use some of the variables for the achievement unlocking functions and set them to null when iâm done with it so it frees up the resources itâs holding. this way is wayyy easier than câs dynamic memory allocation with malloc and calloc 
i also created 2 animations a fade in + bounce achievement popup and a fade out achievement leaving. i was tracking time on lapse for the ifrst time today but i had some issue and it didnât let me save the time :(( but anyways i made 2 new crabbiess, a robber crab and a rich crab! i plan to make the robber crab attack and steal your collected pearls maybe every couple of days and the rich crab will also randomly bless you with pearls!
Log in to leave a comment
all order requests are OFFICIALLY not broken when hiding TT. last time i fixed the stars and barnacles, but i guess whatever i did to the bow didnât apply. i set up the bow variable 3 different ways, through a bool, convert it to an int, and use a string to verify if it was a bow. i wasnât really sure where exactly it was breaking, so i just changed all instances of a bow to rely on ints, 0 for false and 1 for true. that wasnât really the source of the issue, but it did make it easier to debug! then i was searching through my code and was wondering why do i have 2 huge if else visibility control blocks for showing the order requests⊠and thatâs where i saw the problem, i didnât have an else: block for not showing the ribbon if it wasnât true
. so no matter what, if i had a ribbon at the start, it wouldnât hide later.
after i fixed that, i noticed a small bug with the collision shapes on the panel select, briefly enabling after a crab left, then re-enabling itself, so i added some code to disable the collision blocks so it wasnât pressable when the crab was exiting and before a new crab came onto the screen.
lastly, i was fixing up the ending screen. i added 2 crabby dance anims! :DD and created new labels to show the final stats at the end of the game. but for some reason, when i was previewing the game, it kept placing the label where it wasnât supposed ot. i found out my label didnât have an anchor on it?!? TT idk how it didnât have an anchor, but i found that you can set a custom anchor to where your current text is so it doesnât mess with the formatting you have. i plan to ship soon so i can gather some feedback on the initial stage of this game!!
Log in to leave a comment
omg i finally fixed the visibility issues with the crab order. thank you, past me, for writing detailed devlogs, because i just re read them and figured out how to fix the issue XD. in the last devlog, i created anim tracks for each shell type and deleted my huge code block for position, rotation, and scale of each object. after some testing today⊠i realized i needed that block back TT. because after the animation plays, thereâs no way to reset the position in the anim player itself, so i used that code as a behind the scenes kind of reset for the next crab. now i need to go back and clean up some of the code where iâve pasted the same function in different places ot try to target the problem
.
I also started implementing a ending screen, i plan to display the stats like total pearls earned, longest streak etc. i created new global vars for the streak and crab sales
.
the core gameplay system however is done!!
now i just need to make this game feel more dynamic rather than just a linear flow of crab spawn -> order -> recieve pears -> new day. but iâm not sure if that would be doable for a ship as flavortown ends in 9 days⊠we shall see :â))
but iâll just add my ideas here for future reference:
Log in to leave a comment
fixed a few things, broke a few thingsâŠ
! first off i fixed the mixed-up starfish and barncle swapped input. i had swapped the coll shape and the function signal it was emitting, and this was blocking input when pressing a starfish the barnacle would be disabled. next, i fixed the amount of time you can click on reset by creating a new var that stores the total upgrades when an order is generated. i also saw that i was setting my amount of bow to the total upgrades if the value was set to ânoneâ which then that would always be true, setting even a âbowâ from bow to 0, reducing the total extra upgrades by one. after fixing that, i then realized my hide extras on the customize panel functions was just hiding the colors and not the extras, so i edited that to actually target the extra upgrades lol. while testing, i was wondering why my extras werenât animating with the crab leave when called. turns out if you set positions outside of the anim track it doesnât create that smooth anim transition for move positions TT. so i deleted my huge setup for every rotation, position and scale for extra upgrades
and then i created a new anim player to not deal with any issues of calling the same player twice at the same time and created 3 separate tracks for each shell type. after i did that, i noticed the problem where stuff in the order request still shows up after the previous crab left again. ughhh i thought i fixed this bug, but iâll take a look at it next time i work on this.
Log in to leave a comment
today i started adjusting the ordering system for the crab when extras are unlocked by shop. i had it previously structured base shell -> colors. but now itâs not so linear if a extra is unlocked but color wasnât asked in the order. so i created a few if else statements to identify these edge cases. the first was to check once the shell type was applied, if there was no color and no extras, then check the order. the second case was after the shell type was applied, and there wasnât a color, then unlock the extras. and the last case was once the shell type applied, then applying colors becomes true!
i also had to restructure my customize panel script to account for the 3 new coll shapes i added. after that, i connected 3 functions to the main script _on_barnacle_selected(count), _on_bow_selected(enabled), and _on_stars_selected(count). these functions are a little different from my on color selected or on shape selected because those 2 relies on 1 number that would be chosen on random to choose what the shell type would be or the color. but with the extras, iâm displaying 3 extras on 1 screen with the possibility that you could have more than 3 extras on that crab at a single time. so instead of appending a string type, i used ints and bools!
in the video below, there are some visibility issues, i havenât gotten there yet TT, but my next to-do will be to show the customize panel, which extra is supposed to be correctly displayed, and resetting the positions and visibility states once an order is done. i will also find some fitting music and put it on the game! :3
Log in to leave a comment
pause button now works!! i added more @export variables for the paused and normal sprite textures and set the texture to the paused or unpaused button, depending if the tree scene is paused or not. this time, i set the process mode to âalwaysâ so that the pause button is always clickable, so that the button always works :DD i donât really have a popup for pause for ingame settings, at least not yet since i have my 2 setting displayed already: pause and music. but maybe to display days done so far, or total perals earned? iâm thinking maybe adding achievements too! but maybe thatâs too far fetched lol.
i also set up the toggle for my music pause and resume button, but havenât loaded any audio in yet, i need to find the perfect one :3
I also started working on setting up the extra upgrades for the rest of the shop items! since last time, my problem was with the position of the starting shells not being visible in the frame, i worked on that first. usually i would do node.position.x and .node.position.y to define the location of the node, but i found that using Vector2() can contain both the x and y position at the same time, reducing my positioning code lines by half! i also found that adding rotation to each node. i found it interesting that the inspector changes the rotation in values of degrees, but when assigning the rotation of a node, it rotates in radians instead :0 so i had to add _degrees to the script to make sure it rotates in degrees only!
Log in to leave a comment
raised crab upgrade shop item prices by 50% hehehe. i was testing a few of the features and found this edge case for the shell display. if you get something wrong, the old shell stays on the crab and a new shell is added on top :( i fixed this by creating a helper function hide_all_crab_upgrades() and calling it when the order entry was wrong to hide all the crab upgrades to eliminate ANY chance of future bugs lol. i also found another bug that made the order request shells stay even after the crab left. turns out i was only visually resetting it but not resetting the code values for the order request. since i didnât reset it in the code, my crab_order() function automatically updated the ui and displayed the past order when it wasnât supposed to. ohh i also finally fixed the crab respawning even when the hour count was 24!! i switched from using an if statement that relied on âhoursâ tracked to a bool flag that tracked if the day was active. since my process() runs every frame to update and track the hours passed, i set that to control wheter my day would end or not if current_hour >= 24 and day_active:end_day() and i toggled the bool blag to day active = false inside the end day function for added safety nothing else in the script tries to break it, and it worked!!
iâm thinking iâll add the pause system next since i just learned how to implement it in my previous projct, before i fade :333
Log in to leave a comment
omg guys i finally figured out what the problem was with the selected colors not applying đđ. i set up a starting position for the base shells so that when they exit using the animation player, the position can be reset every new crab order! i spent so much time printing statements and deleting and rewriting code to figure out why the colored shells werenât appearing, but then the next shells didnât show after pressing the colored shell for the first time because i moved the position keyframe in the animation player, but never reset it!! it was such an easy fix, but took me so long to figure out TT. but i guess itâs a good thing in itâs own way, i restructured some of my code to be more readable and work better, to be less buggy! i fixed a bunch of my collision shape mapping, and migrated some items into arrays and for loops for reusability later in the game!
next, i HAVE to figure out why the crab isnât leaving when the day is done. itâs probably a silly fix like the colors not showing, but weâll see! hopefully itâll be easier to add the rest of the accessory addons know that i know i need to apply a saved position for those :â)
iâm thinking to increase the items in the shop by a lottttt, to make playing the game lasting so you actually play for 20 days. and maybe even incorporating special events?? like a royal crab that gives you extra pearls or a events like a shark attack that messes up your stand and takes away one of your purchased accessories? lmk if you have any ideas to make this game epikkkk :3
Log in to leave a comment
so i got the color apply function to kinda work TT (it only works when it wants to
) i had to change up my shell selected script that emits a signal to match the collision shape rather than relying on area 2ds. previously, my cutomization panel script emits a signal for shell selected in the main script in an array of 3 items only⊠but now that iâm adding in upgrades like colors, i think iâll just have to restructure the customization panel to an area 2d for each crab add on to make it easier to code TT. i replaced some of my huge blocks of code for turning visibility on and off with helper function calls and honestly, it makes it so so much more readable! now iâm running into an edge case for when the selected color is ânoneâ but the game still expects you to input a color because ânoneâ is in the color list.
when the colored shells do apply, some of them arenât positioned properly, which i have to fix. but the color applies either when you press the shell correctly and the right color, or if you press the correct shell and the wrong color the color will appear when the crab leaves, orrrr it just wonât show at all. i really need to figure out how to fix this so i can move onto adding more features in this game 
Log in to leave a comment
i started working on the crabs ordering shells with colors! i need to find out why the colored shell isnât showing though when you press the color :â))
i modified my on_shell_selected func with an if else to check normal flow vs flow with colors then added 2 helper funcs to apply the colors!
today i also learnt you could set properties based on bool results of other vars than just true/false!
purplepanel.visible = Global.upgrades["purple"]
which is soooo useful iâll def be using more of this in the rest of the game
there are a fdew bugs iâm encountering, im just writing them here so i can reference them later when trying to fix it :D
Log in to leave a comment
created a functional shop system that subtracts total pearls earned when you buy something. i did this by creating a global variable that tracks your pearls earned per order and subtracting that peral amount when pressing an area2d in the shop overlay! I currently have 3 colors: purple, yellow, pink, starfish, seaweed bows, and barnacles available to purchase on the shop! I also implemented a pick random function for the colors only if youâve purchased them, so they show up in the order request. next, iâm going to add the color showing on the crab shell and check order logic for the crab colors.
Log in to leave a comment
Reordered the scene structures and moved nodes into canvas layers to add the shells into animation players, where they would still be behind the crab. Then I separated the happy and sad crab orders and only gave 5 pearls if the crab was sad. If you give the crab the wrong order, then instead of just leaving, it allows you to retry giving a good shell. Lastly, I also started setting up the end day screen with the shop and next day.
Log in to leave a comment
I created texture arrays for my 3 types of crabs and arrays for my shells, and learned about pick_random() function to randomly choose which crab appears and which shell is being ordered. I set up enter and leave animations for the crab through an animation player with visibility and position tracks, as well as updating the global pearl count variable if the order is correct or incorrect, 10 if correct on first try, 5 if correct on 2+ tries. My next goal is to animate the shells so they drop and store the starting position in a variable to reset when a new crab arrives.
Log in to leave a comment
I set up hover states using @export variables in the script for my area 2d buttons by loading in textures for the hover and normal states in the inspector. I also set up the game scene layout with 4 major sections: the crab. the order stand and accessories, the customize panel, and shop! Lastly, I added the scene changes from my menu screen to the game welcome screen.
Log in to leave a comment
hi guys! i created a tonn of assets for the game in figma and set up the menu screen in godot. i added little floating bubble animations to make it look a little cool! :3 also experimented with godot splash screen and kept it as the water background. hopefully, if my game isnât too heavy, it can stay that bg so the loading doesnât take too long, and it just looks like it starts on the menu screen!