Part 5: Parallaxed, squashed, and stretched all over


Hiya guys! Yep. I've been gone for quite some time, and I have been pretty busy with Juicy the Orange while I was gone. But, I just added a whole new set of features to show off my current progress! Before we go over these new features, I just wanted to say thanks a billion for sticking around with me throughout the past week, because it's real fun and heartwarming going through your likes and responses and seeing about my progress! 

First off, and I think this is the big one here, I achieved a working parallax scrolling background. This one was definently tricky to pull off, but here's the thing. I know there's a "ParallaxBackground" canvas node in Godot, and I tried doing it myself before I made these devlogs, but I deleted those because I just didn't know how to make the layers of the background actually "scroll." That's when I watched a tutorial called "Parallax Scrolling in under 3 minutes! Godot 3.2 Tutorial" by bitbrain, and took some notes. Basically, in order to get the background "scrolling", all I had to do was duplicate the layers based on what width that one specific layer is, and also to duplicate the layers, and then after that, set the Motion X scale to depending on if the layer is in the front or the back. (Game Dev Tip: From what I've learned from plenty of other game devs, set the layer at the furthest away to the slowest speed, and set the layer closest to the screen to the fastest speed.) Also, I ran into sort of a little problem. You see, when I duplicated the layers and playtested the game, the parallax scrolling worked PERFECTLY (Like, seriously, in the past with GDevelop, I was able to get parallax scrolling up and running in a minute, but now, for the first time ever, I can achieve the same exact thing in Godot 4), however, I saw some texture popping, and obviously I didn't want that in my game. So. what I did was that I duplicated the ParallaxLayer nodes for each of the background layers to fill in the pop-in gaps, so that it will always show the background layers no matter what. Oh, and I'm still deciding on whether I should add in a smoother camera for Juicy to match with the parallax scrolling or not. But hey, who knows? 

The next thing I got done, and this is pretty much my favorite part that I achieved: Squash and Stretch Tweening. You see, I watched a BUNCH of game dev videos regarding to "Game Feel" (or "Game Juice" depending on what you want to call it that), and this one was something I needed to be EXTRA careful with in GDScript. So, I watched yet another tutorial called "Squash and stretch in 3 minutes [Godot 4]" by Cold and took some more notes to keep in mind with me in the future. So, for the squashing and stretching, basically, all I had to do was add this variable: var is_airborne := false, and for the stretching when Juicy jumps, all I literally had to do was add in this one, singular line of code: $AnimatedSprite2D.scale = Vector2(0.7, 1.3)", for the jumping, and then to prevent it to have Juicy stretching forever, I simply added these two lines of code for both x and y: $AnimatedSprite2D.scale.x = move_toward($AnimatedSprite2D.scale.x, 1, 1 * delta), and $AnimatedSprite2D.scale.y = move_toward($AnimatedSprite2D.scale.y, 1, 1 * delta). Alrighty, we got the squashing done, and the next thing I needed is the squashing for when Juicy falls. Now, I was having trouble for the first part when I tried doing this patch of code from Cold's tutorial: get_gravity(velocity), but here's the thing, get_gravity() requires nothing inside the parentheses to process. So... I simply changed the code from get_gravity(velocity) to velocity.y += SQUASH * delta (Oh, and I added a custom @export for SQUASH specifically, so that it doesn't overlap with the overall GRAVITY for Juicy's jumping and falling gravity.)

The last thing I achieved (but not yet finished), was a transportation system, and this took me a HUGE while to implement. Huge shoutout to Zebedy (IZebl) for this one, because he gave me a rundown on how to implement a Mario pipe-like transportation system in the Godot Forum on my devlog page. (Here's the link: Currently working on a 2D platformer (Devlog) - Showcase / In Development - Godot Forum) But, I got a transportation system working in a more different approach, and actually something I can build off of instead of one core mechanic. So, basically, I got a basic Area2D transportation system, with this small batch of code: 

extends Area2D

func _on_body_entered(body: Node2D) -> void:

if body.name == "Juicy":

body.move_local_x(1409.0)

and when Juicy goes inside the transporter, it "transports" him into a different position, transporting Juicy to the second section of the first level. Oh, and I was also going to have the transporter be a "Orange Juice Carton Teleporter" (or OJCT for short). Basically, when Juicy steps inside the OJCT, the OJCT will play its closing animation, and when that closing animation is finished, another OJCT in the same scene will play its opening animation, and when that opening animation is finished, it will disappear, and Juicy will be transported to the next section of the first level, but I think I'll either do that or a basic "Juicy entering a door" direction, but what do you think? (Oh, and also, I changed the Dash Meter from a standard meter to a car fuel-like meter, and made the Coin Counter font to be more bolder and readable, and also added a tutorial sign showing the player on how to hover in the air, and I'll include more signs for jumping, rolling, spitting, and roll-jumping throughout the first level only.)

Also, during while I was working on these mechanics and effects, get this: I'm currently banned from the Godot Forum, but here's the thing though. I made a post on FreakyGoose's "Looking for early feedback on my game" post about him making a 2D boss rush action-adventure game (Here's the link to his post: Looking for early feedback for my game - Showcase / In Development - Godot Forum), and I was speaking very positively about the game, about the hand-drawn aesthetics looking very similar to Hollow Knight, but then, a few days ago, my post suddenly got flagged, and now, I'm blocked off from the Godot Forum. I'm not sure if this was a mistake by the staff, but I don't know when I'll be unbanned, but I'll have to stick to creating devlogs on itch.io in the meantime, and I can transfer all of my devlogs over to my page on the Godot Forum.

Right now, I'm literally passing flying colors with my newly found and built mechanics, effects, and overall effort on Juicy the Orange, because now, it suddenly doesn't feel static anymore. It's a moving, vibrant, colorful and cartoony world that I can actually enjoy playtesting in, and most importantly, for y'all to play in. I hope y'all continue to read my devlogs, as I make myself some progress towards both the Demo and the full, completed game, and y'all keep liking, following, commenting, and overall supporting my project with Juicy the Orange. ๐ŸŠ๐ŸŠโค๏ธโค๏ธ๐Ÿ“๐Ÿ“๐Ÿ‘พ๐ŸŽฎ

Here's some screenshots of my current progress with Juicy the Orange! 

Comments

Log in with itch.io to leave a comment.

Looking clean! The UI looks crisp and the colour palette is nice here.


It's great to read that you're enjoying your playtesting; I have this problem too (make sure you don't spend *too* much time playtesting)!