Some months ago I started playing around with Godot engine, I’ve started with a Pong clone
just to learn the basics, then - when talking about it to a friend - came the idea of this game where the player reflects
projectiles with some sort of magic shield. And here I am, making some good progress (considering the short amount of free time
I have) thanks to how high level development Godot provides, its awesome community,
great documentation and
great learning references, such as GD Quest!
The dash skill and its trail effect
The problem:
I have this modular character composed by head and body sprites, it doesn’t have multiple animation frames,
its animations are just position and scale tweens.
My solution:
I’ve created a script and attached it to a child node of my character. This dash script has a owner_path that should point to the character. It
assumes the character has some methods:
Then it uses those methods to achieve the dash with trail effect:
Next
You can easily change this script to export the number of ghost trails and tween variables so
you can change them directly on the editor. Also, it might be a good idea to detach (by creating another script)
the trail from the dash logic, after all you might want to add the trail effect to other things that won’t have a dash skill.
_Design Patterns: Elements of Reusable Object-Oriented Software_ by Erich Gamma, John Vlissides, Ralph Johnson and Richard Helm is one of...… Continue reading