You are browsing as a guest. Sign up (or log in) to start making projects!

7h 19m 44s logged

Crab Fight 🦀

Hello everyone it’s getting close to the day when I get to submit, Pirate Cats, and as usual if you want to view my game’s previous progress you can see it on youtube https://youtu.be/XgYkeBUyqbE?si=mVQkA0oVtBkzSB1x Well now I have currently finished the crab fight. I usually only devlog after the day is done, but for pirate cats I devlog when I finish one minigame, so now today I have finished the crab fight minigame, so I will be explaining all about it. I dont have the dialouge and the text or the home pages or settings done yet, but I will be submiting on the 30th. I think i might need to go back and fix the assets for some other items, as like the fishing game the place holders are still there and the cannon doesn’t really look like a cannon, but let’s get started and talk about my progress.

Crabs

So now it is time for me to talk on what I have been doing for the past 2 days, well I have been working on the actual minigame as always, if you watched the video and have any suggestions please comment it, I will take it into account! So for the crabs, there are 3 crabs, they dont really do anything just different colored hats for variety but what happens is that there are 3 groups, left right and middle, I do a randi function randi_range(1,2) if it is 1 the crabs in the first group are not part of the first round if it is 2 they are part of the first round. Then I do an function for each group and do an if statment to see which crab color should be visible then in that I do the calculations. Alright you might be wondering, what are the calculations? Well the calculations are how much the crab has to move each time. So I have to take account the height of the waves, how much room I have between waves, and how many times the crabs will pop up. So in the code I make the crab go up, then go down. I use the tween function to move the crab, since using an animation player and you can only run 1 animation at a time, it would be a pain to keep track of all the animation players, so I use tween as I have said before tween moves the item smootly so it is not teleporting. Then I do either of two things, one if the crab gets all the way to the bottom then the players screen flashes red, then it repeats the process.

Cannon

So in godot, you can add inputs, I added left, right, and space. So then in the code I did in the process, using direction and inputted left and right. The first one inputed is -1 second is 1 and if both or none is being pressed then direction is 0. This is built into godot so I got lucky, because it saved some time in the coding process. Then I have a speed, which I set to 200-300. Then in process I did ~$Cannon.global_position = direction * speed * delta` this makes it so that it moves every esecond something is being held down. Now that I have explained how the cannon is working I will explain how the cannon ball works.

Cannon Ball

So everyone, the cannon ball is a new scene, I can just call it every time and this makes it so I dont have to make alot of them, because I don’t know how many the user will use, so it would be hard to make so many. So in the new scene I have a panel on the cannon ball, as my other mini games. The panel on the crabs and the panel on the cannon ball interact, this happens when they are in direct contact, I check if that crab is visible, and then if that crab should be caught, it can only be caught if it is above the wave (if it is not above the wave then it is hiding but can still be triggered, not visible) then I make that group not visible, and do it for all the other crabs that got hit. I use tween to make the cannon move up by 300. The work I have done in the past few days were alot more complicated, but I will keep doing more, my goal is to reach 50 hours by the end of this month and submit. Thank you guys, if you want to see progress itsVishy Labs on both youtube and instagram. See you guys!

0
3

Comments 0

No comments yet. Be the first!