MusicPhotographyGame developmentBakingWritingBooks Hello! My name is Max!I needed to make this account for a few reasons, to share photos, for posting dev logs, and whatever else I find interesting.

49 posts

These First Few Devlogs Will Be Numbered With Roman Numerals As I Have Not Yet Started Work On My Actual

These first few devlogs will be numbered with roman numerals as I have not yet started work on my actual game

Context and warning

This project is my graduation project for high school, I do have a partner for doing this, but they’re behind me on learning the engine. Imay publish the result or even keep working on it after my senior year, saying this, to people who would push for me to release my project earlier than my senior year, no. This is a school project and I will not be pushed, the school comes first.

Mario Clone

To learn Godot, my engine of choice, I have been working on multiple small projects, such as a Tarot reader, a mobile game on the Godot docs, and more recently, a Super Mario Bros. clone.

Today I will be going over:

The movement script

The bounding box and signals in Godot

My plans for this project

Movement Script

In the movement script, I may have been caught in some feature creep. The movement script has:

Side to Side movement

@export var speed = 300.0 @export var friction = 10 ... func _physic_process(delta): ... if Input.is_action_pressed("ui_right"): velocity.x += speed if Input.is_action_pressed("ui_left"): velocity.x -= speed else: velocity.x = move_toward(velocity.x, 0, friction)

The "ui_right" is set to right arrow key and D, the "ui_left" is set to left arrow key and A. When "ui_right" or "ui_left" are pressed the velocity vector (Vector2(x, y)) is incremented by speed, and when neither are pressed the move_toward function is used. The move_toward function takes the arguments “what value does it start at, what is the end value, what value is it decremented/incremented by”, in my case, the starting value is the current x velocity, the end value is 0, or standing still, and it is decremented by friction, which equals 10.

Jumping with Jump Buffering and Coyote Time

@export var jump = -400.0 ... var coyoteTimer var jumpBuffer = 0 var isJumping = false ... func _ready(): coyoteTimer = Timer.new() coyoteTimer.one_shot coyoteTimer.wait_time = 1.0 add_child(coyoteTimer) ... func _physics_process(delta): if jumpBuffer > 0: if is_on_floor(): velocity.y = jump isJumping = true jumpBuffer = 0 else: jumpBuffer -= 1 elif Input.is_action_just_pressed("ui_accept"): if is_on_floor(): velocity.y = jump isJumping = true elif not coyoteTimer.is_stopped(): velocity.y = jump isJumping = true else: jumpBuffer = 5 elif Input.is_action_just_released("ui_accept"): velocity.y = max(velocity.y, jump)

Let’s look through this line by line, starting with the variable jump, why is it negative if you want to go up, well in Godot, the vector graph is mirrored over the x axis so -y is up and +y is down. The other variables apply to jump buffering and coyote time. I haven’t told you about jump buffering and coyote time yet have I? well, they’re both fairly simple features that make the game feel smoother and more responsive. Jump buffering makes it so that if you hit the jump button ("ui_accept") and you're not quite on the ground, you'll jump when you land. Coyote time is named after Wile E. Coyote and makes it so that if you jump just after leaving a ledge, when it seems like you'd still be able to jump, you can. The _ready() function is the first thing to run, as it runs on startup, this one sets up the coyote timer The _physics_process() function runs every physics frame , yes, there are even more kinds of framerate! This first if statement checks to see if the jump buffering frames are still active. If they are, and the player is on the floor, then the player jumps, sets isJumping to true and sets the buffer frames to 0. if is_on_floor() is false, then the code decrements jumpBuffer by 1. If there aren't any buffer frames, it checks if "ui_accept" was pressed, if so, it checks if is_on_floor() is true, if so the player jumps, else if the coyoteTimer is active, and if so, the player jumps, else, it activates the jump buffer frames. I'm not entirely sure what that last elif statement does , it probably just jumps.

Bounding Box and Signals in Godot

Signal are an incredibly powerful tool when used correctly, "Signal up, call down" is a saying in Godot that helps to make organized code . Signals can connect nodes to trigger things, but they can be ignored, which helps for reusablity.

func _on_bound_body_entered(): get_tree().reload_current_scene()

The _on_bound_body_entered() function checks if a phyics body has entered the bounding walls. the get_tree().reload_current_scene() reloads the level.

Future Plans

I hope to finish world one by the end of this week, but we'll see when we get there, and hopefully by around the end of january, me and my partner can start working on the actual game.

TCHÜSS

  • no-semicolons
    no-semicolons liked this · 2 years ago
  • exsanguinated-doves
    exsanguinated-doves liked this · 2 years ago

More Posts from No-semicolons

1 year ago

I now have two, I’ll show them when i get home

I have a custom pfp that I made but I'm not sure I should use it

Thoughts?

2 years ago

Note to all who want to follow me

Please do something with you account first

If you have no posts

No title

No likes

I’ll assume you’re a bot and block you

I’ll also block you for any sort of hate, I make games, not politics

2 years ago

Game Development Adventure II

Unfortunately, I lost a ton of my data and files, so there's not much to say today.

the upload schedule is every other Monday starting today.


Tags :
1 year ago

Game development adventures 3

Sorry i took so long

please forgive me

Our artist has been hard at work, and I completely rewrote the wave function collapse algorithm

Game Development Adventures 3

I don't know where that red squiggle came from

This is a dict that contains all the data for our new tile set, and I have have to set it up again for the , hopefully, final time

The original script was made in GDscript v1, I'm using GDscript v2

It was also made in 3d, I'm doing 2d

So most of the original has to be changed and I'm not finished with that yet

I've started to work on the actual story! so far your ship crash lands on a random planet, when you go looking for someone to fix it, you come across a fledgling resistance. They agree to fix your ship if you join them

Hopefully I can do more this week

I might open a ko-fi to pay for the few things I do need to do this like fl studio

I may change the algorithm, it all depends on what works

anyways

o7 cmdr

1 year ago

He finally started!

I already showed them your script

Graduation Project 1

I figured I should probably start writing these logs so here we are. I am working on my graduation project with my friend @no-semicolons, where we are programming a roguelike in Godot game engine.

I haven't don't much so far but write a basic movement script for the character. Said script was found on the Internet. I've also been assigned the task of updating a giant dictionary in the code as our artist makes more tiles for the tile map.


Tags :