In this devlog, I'm gonna organised what I've maded 29th March(2024) to 1th April(2024).
It was completely first time to use Godot. I had no idea what to do, so I decided to do something easy first. Main menu.
On YouTube there's a youtuber who teaches you about Godot, which is very helpful to me, he's "Gwizz" So I made main menu watching that his tutorials. Node system is kinda weird to me since I've only used Unity so far, like how the hell can I make canvas and change anchor?!
When you press start then scene changes to "game.tscn", quit then quit(obviously) and setting well I didn't make canvas (I don't even know it's correct to say that about Godot) yet so left it be.. empty button.
So far my design always has dark outline for all the sprites, and my sister(who's artist) recommended me to draw similar colour but darker than the sprite colour. For example if it's lemon then make its outline as like mustard colour. I accepted that feedback and re-drew everything. Wasn't that hard, thankfully I drew outline on the different layout.
So like I said, it's gonna be a game that you have to stack up the objects falling from the sky. If you miss one single thing then it's game over. I think it's gonna be just easy and simple, just keep stacking up and get high score.
Game art was like this(first image) when I first thought of this concept. Since it's gonna be just hyper casual game, I didn't draw that much. But then I drew new design(second image). Cause well... THAT wasn't enough. (feel like my drawing for game is improving)
Oh and if someone's curious about what tool I'm using, I'm not using fancy things. Though I have Adobe Illustrator/Photoshop but I don't like drawing on tablet looking at computer, for some reason, so I have my galaxy tab and I'm using free app called "Sketchbook".
Anyway, so I re-drew things except like UI, since I thought it's okay to have dark outline for them. Also drew new hand too, longer.
On main menu, there'll be hamburger on plate and hand in background, playing idle animation like slow-motion. Ingredients is almost falling but then go back to plate like rewind.
Animation on Godot was little bit confusing at first, like "I added animation as child node so I should be able to move the parent node no?!" but no. Unlike Unity, you can move any node in one animation. Just simply click plus button and select node, and what component to change. Little annoying thing as Unity developer was if I want to change something's position and scale then I have to add indivisual things and change it. Cause well in Unity you can just resize and rescale it then it automatically adds to animation change. So... Anyway it was a bit hard to find the information cause on YouTube it was mostly sprite animation. And I don't want that.
After adding animation, I worked on canvas thing. So if you press option then I want to show the option screen. So I added control node, and added button & textureRect in control node. If you press "option" button then make option node visible using optionCanvas.visible = true . And as the opposite, if you press "back to menu" button then make option node invisible.
So in Devlog #0, at the end of it I said gameplay slightly changed, so here's the thing. The theme was "stacking up as many as you can, and get high score" but I was thinking like "if you control badly then ingredients on plate would fall but if you piled up like 100 things then how can I show that to player?!" So.. I changed the theme. Just serve burgers as many as you can.
So I needed to draw another hand, right hand, for top bun, to finish whole burger. And changed fries to just money jar. Cause you'll earn money from building one burger and serve it.
After that go to game.tscn scene, change fries image to money jar in UI node. Then added player, long left hand. Now time for player movement.
It's gonna be a mobile game but I used get_viewport().size so it can be adjustable to any screen size. So hand is gonna move between mouse_position.x >= 40 && mouse_position.x <= screen_width - 40 at X position. And Y is between mouse_position.y >= screen_height/2 && mouse_position.y <= screen_height .
I made player can move, now it's time to instantiate object falling from top.
func instantiate_ingredient(pos):
#print("instantiate!")
random_index = randi_range(0, ingredients.size() - 1)
var instance = ingredients[random_index].instantiate()
ins_ingredient.append(instance)
instance.position = pos
canvas.add_child(instance)
So make a function about instantiating random object at the position that's given as parameter.
Here, instantiating ingredient objects now working.
But obviously, they're not colliding on plate because they don't have collider! So it's time to add. Again, Godot physics made me sooooo confused. Unlike Unity, It has layer and mask?... so apparently, layer determines what can detect me and mask determins what I can detect. (from "Branno" on YouTube)
And to use something like "onCollision2DEnter" in Unity, (RigidBody2D) you need to make Contact Monitor on and Max Contact Reported to more than 1. It works when it's set to 1 but I just set it 2. Otherwise... IT DOESN'T COLLIDE (it annoyed me soooo much..)
Then go to script and select node that is Rigidbody2D, and go to Signal section and choose these. Simple! But for now, let's make it collide with each other.
So... yeah it collides now, but it's too fast and too... slippery. For now, let's be content with it, it collides at least.
Ingredient and plate can collide. But it was too fast and too slippery. So I thought a lot, like is it good idea to make physics like that? If player moves then ingredient might fall.. It'll be so tricky and physics might be playing up. So I decided to make stick to the plate when it lands.
And yes.. this happened. I had no idea what is going on, I just simply used freeze = true and set_freeze_mode(FREEZE_MODE_KINEMATIC) to make it stop falling when it collides.
So I made another array variable. We have "ins_ingredient" array for instantiated ingredient and it's added to "canvas" which is control node. The new array is "stacked_ing". Save ingredient object that's stacked on plate will be placed in this array. Then it'll be added to plate as its child node. Add stacked_ing.append(null) in instantiate function.
if ins_ingredient[i].collided && ins_ingredient[i].in_middle:
Check if it's collided with plate or ingredient and collider that is in the middle(so if it lands on like edge its position is not fixed)
for j in range(stacked_ing.size()):
if stacked_ing[j] == null:
# add that ingredient to stacked array
stacked_ing[j] = ins_ingredient[i]
frozen = true
Check through stacked_ing array, if it's null then put that collided instantiated ingredient in the array.
# move stacked item to player node
for i in range(stacked_ing.size()):
if stacked_ing[i] != null:
# change parent node
canvas.remove_child(canvas.get_child(i))
var new_instance = stacked_ing[i].duplicate()
plate.add_child(new_instance)
# resize and rescale
var original_scale = stacked_ing[i].global_scale
var original_position = stacked_ing[i].global_position
new_instance.global_scale = original_scale
new_instance.global_position = original_position
Then remove that ingredient object from "canvas" parent node, and add to "plate" as child node. And resize/relocate. Since global position and position as child node in "plate" is different.
So by doing these, it won't just stop at its global position in "canvas" node when it collides with plate, it'll be added to plate node and set the position then ingredients will move together as player moves. Problem solving! I'll add game play gif in next devlog, after adding some more features.
It was so confusing and I wanted to just switch to Unity but thinking I don't have to pay fee if this game goes well I just kept trying and trying figurint out what the hell Godot is, and I'm proud of myself doing well so far. Let's keep going!