diff options
author | David Luevano Alvarado <david@luevano.xyz> | 2023-07-23 22:31:37 -0600 |
---|---|---|
committer | David Luevano Alvarado <david@luevano.xyz> | 2023-07-23 22:31:37 -0600 |
commit | 627b5c1ff7b6856f1b83da5b6d1acd5cf597b266 (patch) | |
tree | 339c4e79df5bfec2f38c064af307254ebe476eb7 /live/blog/g/gogodot_jam3_devlog_1.html | |
parent | cfa119e524823b1b47ea8f7c675d5c003037d736 (diff) |
add new built files
Diffstat (limited to 'live/blog/g/gogodot_jam3_devlog_1.html')
-rw-r--r-- | live/blog/g/gogodot_jam3_devlog_1.html | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/live/blog/g/gogodot_jam3_devlog_1.html b/live/blog/g/gogodot_jam3_devlog_1.html index 85a2af0..baf14d0 100644 --- a/live/blog/g/gogodot_jam3_devlog_1.html +++ b/live/blog/g/gogodot_jam3_devlog_1.html @@ -141,7 +141,7 @@ <p>Other than that I used few key sprites from <a href="https://vryell.itch.io/">vryell</a>: <a href="https://vryell.itch.io/controller-keyboard-icons">Controller & Keyboard Icons</a> and a font from <a href="https://datagoblin.itch.io/">datagoblin</a>: <a href="https://datagoblin.itch.io/monogram">Monogram</a>.</p> <h2 id="the-snake">The snake<a class="headerlink" href="#the-snake" title="Permanent link">¶</a></h2> <p>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:</p> -<figure id="__yafg-figure-32"> +<figure id="__yafg-figure-38"> <img alt="FileSystem - Snake dir structure" src="https://static.luevano.xyz/images/g/gogodot_jam3/file_system_snake_dir_structure.png" title="FileSystem - Snake dir structure"> <figcaption>FileSystem - Snake dir structure</figcaption> </figure> @@ -175,7 +175,7 @@ func _rotate_to(direction: int) -> void: _direction = _direction.rotated(deg2rad(direction * Global.SNAKE_ROT_SPEED * get_physics_process_delta_time())) </code></pre> <p>After tunning all the necessary parameters you should get something like this:</p> -<figure id="__yafg-figure-33"> +<figure id="__yafg-figure-39"> <img alt="Snake - Basic movement (left and right controls)" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_basic_movement.gif" title="Snake - Basic movement (left and right controls)"> <figcaption>Snake - Basic movement (left and right controls)</figcaption> </figure> @@ -212,7 +212,7 @@ func _on_Head_snake_path_new_point(coordinates: Vector2) -> void: update() </code></pre> <p>With this, we’re now populating the <em>Path2D</em> curve points with the position of the snake head. You should be able to see it because of the <code>_draw</code> call. If you run it you should see something like this:</p> -<figure id="__yafg-figure-34"> +<figure id="__yafg-figure-40"> <img alt="Snake - Basic movement with path" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_basic_movement_with_path.gif" title="Snake - Basic movement with path"> <figcaption>Snake - Basic movement with path</figcaption> </figure> @@ -256,7 +256,7 @@ func _on_Head_snake_path_new_point(coordinates: Vector2) -> void: _add_initial_segment(TAIL_SEGMENT_NP) </code></pre> <p>Select the <em>Snake</em> node and add the <em>Body</em> and <em>Tail</em> scene to the parameters, respectively. Then when running you should see something like this:</p> -<figure id="__yafg-figure-35"> +<figure id="__yafg-figure-41"> <img alt="Snake - Basic movement with all body parts" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_basic_movement_added_body_parts.gif" title="Snake - Basic movement with all body parts"> <figcaption>Snake - Basic movement with all body parts</figcaption> </figure> @@ -299,7 +299,7 @@ func _add_segment_to_queue() -> void: body_segment_queue.append(body_segment_queue.back() + Global.SNAKE_SEGMENT_SIZE) </code></pre> <p>With everything implemented and connected accordingly then we can add segments on demand (for testing I’m adding with a key press), it should look like this:</p> -<figure id="__yafg-figure-36"> +<figure id="__yafg-figure-42"> <img alt="Snake - Basic movement with dynamic addition of new segments" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_basic_movement_with_dynamic_segments.gif" title="Snake - Basic movement with dynamic addition of new segments"> <figcaption>Snake - Basic movement with dynamic addition of new segments</figcaption> </figure> @@ -362,21 +362,21 @@ func _on_body_entered(body: Node) -> void: add_child(food) </code></pre> <p>And this is used in <code>_process</code> to place new food whenever needed. For now I added a condition to add food until 10 pieces are in place, and keep adding whenever the food is is lower than 10. After setting everything up, this is the result:</p> -<figure id="__yafg-figure-37"> +<figure id="__yafg-figure-43"> <img alt="Snake - Food basic interaction" src="https://static.luevano.xyz/images/g/gogodot_jam3/snake_food_basic_interaction.gif" title="Snake - Food basic interaction"> <figcaption>Snake - Food basic interaction</figcaption> </figure> <h2 id="za-warudo-the-world">Za warudo! (The world)<a class="headerlink" href="#za-warudo-the-world" title="Permanent link">¶</a></h2> <p>It just happend that I saw a video to create random maps by using a method called <a href="https://www.mit.edu/~kardar/teaching/projects/chemotaxis(AndreaSchmidt)/random.htm">random walks</a>, this video was made by <a href="https://www.youtube.com/c/NADLABS">NAD LABS</a>: <a href="https://www.youtube.com/watch?v=ppP2Doq3p7s">Nuclear Throne Like Map Generation In Godot</a>. It’s a pretty simple but powerful script, he provided the source code from which I based my random walker, just tweaked a few things and added others. Some of the maps than can be generated with this method (already aded some random sprites):</p> -<figure id="__yafg-figure-38"> +<figure id="__yafg-figure-44"> <img alt="World map generator - Random map 1" src="https://static.luevano.xyz/images/g/gogodot_jam3/world_generator_1.png" title="World map generator - Random map 1"> <figcaption>World map generator - Random map 1</figcaption> </figure> -<figure id="__yafg-figure-39"> +<figure id="__yafg-figure-45"> <img alt="World map generator - Random map 2" src="https://static.luevano.xyz/images/g/gogodot_jam3/world_generator_2.png" title="World map generator - Random map 2"> <figcaption>World map generator - Random map 2</figcaption> </figure> -<figure id="__yafg-figure-40"> +<figure id="__yafg-figure-46"> <img alt="World map generator - Random map 3" src="https://static.luevano.xyz/images/g/gogodot_jam3/world_generator_3.png" title="World map generator - Random map 3"> <figcaption>World map generator - Random map 3</figcaption> </figure> |