Skip to content

Commit

Permalink
Fixed old bad code
Browse files Browse the repository at this point in the history
  • Loading branch information
Twingamerdudes authored May 29, 2024
1 parent de5f9db commit b6edb63
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/Cristal/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ function Callback(name, args)
end
end
end
function OnUpdate()
function OnUpdate(dt)
if cristalAnimation then
if currentScale[1] <= 3 then
currentScale[1] = currentScale[1] + 0.4 * deltaTime
currentScale[2] = currentScale[2] + 0.4 * deltaTime
opacity = opacity + 150 * deltaTime
currentScale[1] = currentScale[1] + 0.4 * dt
currentScale[2] = currentScale[2] + 0.4 * dt
opacity = opacity + 150 * dt
ChangeCustomUIField("CristalImage", "scale", {{currentScale[1], currentScale[2]}})
ChangeCustomUIField("CristalImage", "color", {{255, 255, 255, opacity}})
elseif fade then
opacity = opacity - 150 * deltaTime
opacity = opacity - 150 * dt
ChangeCustomUIField("CristalImage", "color", {{255, 255, 255, opacity}})
if opacity <= 0 then
cristalAnimation = false
Expand All @@ -51,4 +51,4 @@ function OnUpdate()
fade = true
end
end
end
end

0 comments on commit b6edb63

Please sign in to comment.