Currently working on a 2D platformer (Devlog)

Hey guys! Sorry if I’ve been a little late, but the reason for that is that I originally was going to join a game jam called “Godot (&beyond) Official Awards: The Indie Spark” (Here’s the link if you want to join the jam: Godot (&beyond) Official Awards: The Indie Spark - itch.io), and that the theme for the jam was “Adventure”. So, I originally wanted to make a platformer called “One Tiny Knight”. Basically, in the game, you play as a small blue knight, who has gotten himself trapped inside an abandoned ruins center after getting separated from his group of small tiny blue knights, and now must explore the ruins while defeating enemies with his sword and finding parts of a giant key.

Here’s the thing though. I was making so much good progress on Juicy the Orange that while I could juggle both games at the same time, I wanted to spend this weekend’s time on Juicy the Orange, so I decided that I’ll work on One Tiny Knight another time or tomorrow.

Anyways, back on track, I added an airborne enemy named “Chi Chi”. Basically, this enemy moves left and right in the air, and I finally added logic as of when Juicy jumps on Chi Chi, Chi Chi not only falls down and plays a sound when defeated, but I added a flip animation to give it more of a powerful effect.

Oh, and get this, I finally added controller support, and it worked exactly the same as lat them. The only issue I was having at the previous attempt was that I was using my 8BitDo Ultimate C Wireless Nintendo Switch Controller on wired mode, which made Juicy glitch out, but using it wireless, Juicy controls perfectly.

Here’s the code for Chi Chi if y’all need it:

extends Node2D

@export var SPEED : float = 70.0
@export var LEFT_LIMIT : float = -40.0   
@export var RIGHT_LIMIT : float = 40.0
var velocity : Vector2 = Vector2.ZERO
var direction : int = 1
var home_x : float = 0.0
var falling : bool = false


@onready var animated_sprite_2d = $AnimatedSprite2D
@onready var chi_chi_hurt_sound = $ChiChiHurtSound

func _ready():
	home_x = position.x

func _process(delta):
	if falling:
		velocity.y += 300 * delta  
		position += velocity * delta
		animated_sprite_2d.rotation += 12.0 * delta  
	else:
		# Air patrol
		position.x += direction * SPEED * delta
		# Reverse at limits
		if position.x < home_x + LEFT_LIMIT:
			direction = 1
			animated_sprite_2d.flip_h = true
		elif position.x > home_x + RIGHT_LIMIT:
			direction = -1
			animated_sprite_2d.flip_h = false

func _on_hit_area_body_entered(body: Node2D) -> void:
	if falling:
		return 
	if body.name == "Juicy":
		if body.velocity.y > 0 and body.global_position.y < global_position.y:
			falling = true
			velocity.y = 60 
			body.velocity.y = -body.JUMP_FORCE * 1.15
			body.animated_sprite_2d.play("Juicy Jump")  
			animated_sprite_2d.play("Chi Chi Hurt")
			chi_chi_hurt_sound.play()

Now, the next thing I’ll be adding for Juicy the Orange is a parallax background, and a transporter which brings Juicy to the second section of the first level. Just make sure y’all keep in touch with me! Thanks a lot!

Fantastic work so far Joshington!

It’s easy to see the vision here, and your passion for your project is kind of infectious :joy:
Your original post makes me want to write proper devlogs , rather than a list of small updates like I currently do.

I cant seem to find you or your game on itch though for some reason.
The devlog seems to give me a 404 error.

Could you link it again?

Sure! The link’s right here: Juicy the Orange by Joshington

Note that I don’t have a cover art or any screenshots for the game, as it’s currently in very early development, and I was actually thinking of hiring a cover artist, but I didn’t want to spend any money, so I decided to make my cover art either in Microsoft Paint or Pixilart. But I mean hey, whichever works.

Also, in case you already read this part or not, I’m going to release a Demo version of only the first world on itch.io first, then the full, completed game later on. Just wanted to make sure y’all are waiting for the Demo release!

Thanks a million for liking, commenting, and overall contributing to my pet project! Really means a lot! :heart::heart::heart:

Also, do you know on how to implement a health bar system and a knockback system, and also a transportation system (Basically, the transportation system will work similar as of when Mario enters a pipe in Super Mario Bros., and also to change Juicy’s position as to when the transportation animation ends, it moves Juicy somewhere far away from the first section of the first level.) because I’ve been really trying to figure out on how to work that with enemies with the health bar and knockback system. If you do, please consider letting me know. Thanks a lot in advance!

Hey there!
A tutorial would probably help with those first two, but I recommend sitting down and really thinking about each of those systems. What does it need? How can you break it down? How can you break down those parts further? Just keep breaking down until you think you can implement something in code, and eventually you’ll have something to work with. This approach helped me learn fast.
On the other hand, with a tutorial, you’re just copying down code without learning much from it.

Hey @ComicallyUnfunny

So, from what you said, breaking down on what I can work with, I actually tried doing that myself with an AnimatedSprite2D node, about setting up a custom variable in Juicy’s script about how many health points Juicy has, such as var health: int = 3and whenever Juicy gets hit by an enemy, the health variable subtracts 1 number, as in remove 1 health point, and when Juicy loses all of his lives, the scene reloads itself, and the health variable reverts back to 3 health points.

I can’t tell you the full process though, as I tried doing this method while also finding tutorials, but from what I need, I couldn’t really find anything, so I’m going to stick to this approach: Breaking down, breaking down parts even further, and implement to code.

I’m not asking for tutorials from anyone, but I don’t think tutorials are just for copying down code and calling it a day (Well, for some people including you). At the very least, in the past, I took notes on what each line of code actually does, such as with simple stuff like a variable, a boolean sets from true to false, a variable displays a counter, func _ready -> void():, starts whatever action at the start of the scene, and Input.get_axis("Left", "Right"), but it’s your opinion and I’m fine with that.

Thanks a lot @ComicallyUnfunny !!!

1 Like

Nice work!
I agree that tutorials can be very useful is used correctly, but most beginners don’t do that. If you can absorb knowledge from a tutorial, that’s great! Personally, I prefer the Godot docs.

1 Like

Recently, I came up with a story for Juicy the Orange, as in the past, with my previous attempts at making Juicy the Orange in GDevelop, I made so many bizzare storylines that were either too ambitious, or I eventually just didn’t think they were the perfect storylines, but this story is where I’m keeping it simple and striaghtforward. Here’s the plot: One day, on a very fine afternoon, a small, spunky orange named Juicy was inside his house playing video games with his best friend/housemate, Penguin. They enjoyed gaming together and also enjoyed being housemates, when all of a sudden, a loud BOOM struck outside. Juicy and Penguin went outside to check the damage, only to mysteriously find nothing. Suddenly, a shadow came from above, swooped down with a giant claw, and tried to grab the two friends from below, but luckily, Juicy rolled away just in time, but then, the claw grabbed Penguin by the head and was carried far away! It was an evil scientist named Dr. Science who took Penguin, and off to his laboratory on a far, distant area he went.

Now, it’s up to Juicy to go save his bestest friend from the nefarious scientist himself, but beware, because Dr. Science’s henchmen will try to stop Juicy at every turn. Fortunately, Juicy can collect powerful artifacts known as “Juice Sprites”, mysterious artifacts that are hidden in each level that have the power to unlock entrances to Dr. Science’s biggest henchmen in every hub world, and legend has it that collecting all of the Juice Sprites in the world will defeat Dr. Science’s army for good!

Here’s some screenshots of the story parts and characters that will take place:
Juicy’s best friend, Penguin
Penguin
Dr. Science, the main antagonist of the game
Dr. Science In His Hovercraft

Penguin being kidnapped and carried off by Dr. Science


Juice Sprite
Juice Sprite
Mockup of Juicy and Penguin’s House

Oh, and here’s the Juicy the Orange itch.io Thumbnail. It was made in Microsoft Paint, and it really took me all night to make this, so I’m a little tired, so please enjoy the thumbnail I made! :heart::heart::heart:

3 Likes

Sure! I’ll give you a quick rundown on each:

  1. Health bar: - I have a TextureProgressBar, into which I’ve loaded in my own graphics. But for testing purposes, you can just change the fill colour under Tint > Progress to see it change visually. Ideally, you want a Singleton (Autoload) where you store your player’s health.
    Then, have your health bar receive updates from the singleton.

func _process(delta):
# Update the HUD values
$Health.value = Global.health

(Global is the singleton I’m using, but you could make a script and call it “PlayerStats” or something for clarity’s sake.)

  1. Knockback - there’s a few ways to do this. But you could essentially just have an @export var called knockback_velocity; and apply it when you need to on the appropriate body.
    velocity = knockback_force (also flip the velocity depending on the sprite’s direction , ie. velocity = -knockback_force)

  2. For teleportation like Mario’s, you have a few options again.
    But a typical way would be : player presses button to enter pipe > lock player movement > start player animation (entering the pipe) > reposition player > and finally play another as you reposition the player. If you haven’t already, look into state machines.
    Or for testing purposes. you could also just add a boolean to the top of your script.
    Something like @export var movement_locked : bool = false. Put this also at the top of your movement logic, like so:

if movement_locked:
return
(then your normal movement code is here)

Finally, when you press the button to teleport, you can just toggle that variable so you cant move while you’re transported to another place.

3 Likes