From 2a4c15c26780d2cb55906a15ec0f79fe4b36586e Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Wed, 8 Jun 2022 02:28:01 -0600 Subject: fix minor issues on images --- blog/dst/g/gogodot_jam3_devlog_1.html | 149 ++++++++++++++++++++++++---------- 1 file changed, 106 insertions(+), 43 deletions(-) (limited to 'blog/dst/g/gogodot_jam3_devlog_1.html') diff --git a/blog/dst/g/gogodot_jam3_devlog_1.html b/blog/dst/g/gogodot_jam3_devlog_1.html index 92480c4..05def8d 100644 --- a/blog/dst/g/gogodot_jam3_devlog_1.html +++ b/blog/dst/g/gogodot_jam3_devlog_1.html @@ -81,20 +81,21 @@

Creating my Go Godot Jam 3 entry devlog 1

IF YOU’RE SEEING THIS, THIS IS A WIP

-

The jam’s theme is Evolution and all the details are listed here. This time I’m logging as I go, so there might be some changes to the script or scenes along the way. Note that I’m not going to go into much details, the obvious will be ommitted.

+

The jam’s theme is Evolution and all the details are listed here. This time I’m logging as I go, so there might be some changes to the script or scenes along the way I couldn’t actually do this, as I was running out of time.. Note that I’m not going to go into much details, the obvious will be ommitted.

I wanted to do a Snake clone, and I’m using this jam as an excuse to do it and add something to it. The features include:

Initial setup

Again, similar to the FlappyBird clone I developed, I’m using the directory structure I wrote about on Godot project structure with slight modifications to test things out. Also using similar Project settings as those from the FlappyBird clone like the pixel art texture imports, keybindings, layers, etc..

-

I’ve also setup GifMaker, with slight modifications as the AssetLib doesn’t install it correctly and contains unnecessry stuff: moved necessary files to the res://addons directory, deleted test scenes and files in general, and copied the license to the res://docs directory. Setting this up was a bit annoying because the tutorial it’s bad (with all due respect). I might do a separate entry just to explain how to set it up, because I couldn’t find it anywhere other than by inspecting some of the code/scenes.

+

I’ve also setup GifMaker, with slight modifications as the AssetLib doesn’t install it correctly and contains unnecessry stuff: moved necessary files to the res://addons directory, deleted test scenes and files in general, and copied the license to the res://docs directory. Setting this up was a bit annoying because the tutorial it’s bad (with all due respect). I might do a separate entry just to explain how to set it up, because I couldn’t find it anywhere other than by inspecting some of the code/scenes.I ended up not leaving this enabled in the game as it lagged the game out, but it’s an option I’ll end up researching more.

This time I’m also going to be using an Event bus singleton (which I’m going to just call Event) as managing signals was pretty annoying on my last project; as well as a Global singleton for essential stuff so I don’t have to do as many cross references between nodes/scenes.

Assets

This time I’ll be creating my own assets in Aseprite, wont be that good, but enough to prototype and get things going.

+

Other than that I used few key sprites from vryell: Controller & Keyboard Icons and a font from datagoblin: Monogram.

The snake

This is the most challenging part in my opinion as making all the body parts follow the head in a user defined path it’s kinda hard. I tried with like 4-5 options and the one I’m detailing here is the only one that worked as I wanted for me. This time the directory structure I’m using is the following:

@@ -268,6 +269,12 @@ func _add_segment_to_queue() -> void: _snake.propagate_call("set_process_input", [on_off])

Which will stop the snake node and all children.

+

Fix on body segments following head

+

After a while of testing and developing, I noticed that sometimes the head “detaches” from the body when a lot of rotations happen (moving the snake left or right), because of how imprecise the Curve2D is. To do this I just send a signal (snake_rotated) whenever the snake rotates and make a small correction (in generic_segment.gd):

+
func _on_snake_rotated() -> void:
+    offset -= 0.75 * Global.SNAKE_SPEED * pow(get_physics_process_delta_time(), 2)
+
+

This is completely random, I tweaked it manually after a lot of iterations.

The food

For now I just decided to setup a simple system to see everything works fine. The idea is to make some kind of generic food node/scene and a “food manager” to spawn them, for now in totally random locations. For this I added the following signals: food_placing_new_food(type), food_placed_new_food(type) and food_eaten(type).

First thing is creating the Food.tscn which is just an Area2D with its necessary children with an attached script called food.gd. The script is really simple:

@@ -316,48 +323,104 @@ func _on_body_entered(body: Node) -> void: Snake - Food basic interaction
Snake - Food basic interaction
-

Brainstorm/To-do

- -

Resources

+

Other minor stuff

+

Not as important but worth mentioning: