Skip to content

Commit

Permalink
Add Wave shader to shoot
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanlangston committed Jan 6, 2024
1 parent a93c417 commit e1e8770
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Models/Shoot.zig
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ pub const Shoot = struct {

pub inline fn Draw(self: @This()) void {
if (self.active) {
const wave = Shared.Shader.Get(.Wave);
wave.activate();
defer wave.deactivate();

const waveShaderLoc = raylib.getShaderLocation(wave, "seconds");
raylib.setShaderValue(wave, waveShaderLoc, &Shared.Random.Get().float(f32), @intFromEnum(raylib.ShaderUniformDataType.shader_uniform_float));

raylib.drawCircleGradient(
@intFromFloat(self.position.x),
@intFromFloat(self.position.y),
Expand Down

0 comments on commit e1e8770

Please sign in to comment.