-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2074287
commit 976b8eb
Showing
4 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
extends SpellBase | ||
|
||
func cast(player: Player, _enemies: Array[Node]): | ||
player.shield_multiplier *= 0.5 | ||
player.enable_shield(0.5) | ||
|
||
func uncast(player: Player, _enemies: Array[Node]): | ||
player.shield_multiplier *= 2.0 | ||
player.disable_shield() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
shader_type canvas_item; | ||
|
||
const float thickness = 0.02; | ||
const float feather = 0.005; | ||
|
||
uniform sampler2D noise; | ||
|
||
vec2 rotate(vec2 v, float angle) { | ||
float s = sin(angle); | ||
float c = cos(angle); | ||
return mat2(vec2(c, s), vec2(-s, c)) * v; | ||
} | ||
|
||
void fragment() { | ||
float alpha = COLOR.a * (1.0 - smoothstep(0.5 - feather, 0.5, length(UV - vec2(0.5, 0.5)))); | ||
alpha *= smoothstep(0.5 - thickness - feather, 0.5 - thickness, length(UV - vec2(0.5, 0.5))); | ||
alpha *= texture(noise, rotate(UV, TIME)).r; | ||
COLOR = vec4(0.0, 0.0, 1.0, alpha); | ||
} |