You are browsing as a guest. Sign up (or log in) to start making projects!

9h 54m 6s logged

Devlog 5: Adding Abilities

Welcome back!
Today I’ll discuss my implementation of abilities in the game, since I figured that just making a breakout clone is a bit boring.
But first, i wanna talk about the new block textures.

Block Texture

As you may have noticed from my past devlogs, the blocks look kind of bland. And that’s expected, since I’m just modifying their modulate value when they’re instantiated. To change that, I decided to write a shader to mimic the look of the blocks in this breakout web game, which I found while trying to search for some inspiration.

The shader itself is really simple. We can use a sample2D variable in the Godot shader language to provide the shader a 2D linear gradient. And then we can sample the pixels on the gradient and display the brightest components of the gradient pixel and the original block’s color:

shader_type canvas_item;

uniform sampler2D gradientTexture;

void fragment() {
	vec4 textColor = texture(gradientTexture, UV);
	COLOR = max(COLOR, textColor);s
}

This results in a simple, but cool design for the blocks. I also applied it to the blocks forming the title in the main menu.

Ability System

With stardance ending, I decided to quicky add an ability system to my project. Right now, I’ve only added two: growing the paddle and adding an extra ball.
This was accomplished by creating an Ability class as well as an AbilityManager class. When instantiated, each block is randomly assigned an AbilityType. All we have to do is handle those abilities whenever the block is destroyed by the player.

This is done in the AbilityManager node, with a method that we connect to the a signal that’s emitted whenever a block’s removed:

func _on_block_manager_block_removed(block: Block, ball: Ball) -> void:
	if block.ability == Ability.AbilityType.CLONE:
		# Handle clone ability
	elif block.ability == Ability.AbilityType.GROW:
		# Handle grow ability

This results in a pretty simple ability system.

Other stuff

With the new ability system, I decided to add some more sound effects for the game by searching for free sfx packs on itch. I’ve credited the ones i used on the GitHub repository, and I think it made the game a bit more fun.
I also added five new levels, and an end screen, so the game can actually be replayed without having to quit and launch it again.
Finally, there’s now three difficulties to the game, which I’ll definitely have to tweak, since they all feel easy.
Until next time!

0
10

Comments 0

No comments yet. Be the first!