- Nov 4, 2022
- 5
- 0
I'm trying to add a shake effect to the current background of the current label from an outside screen. I'm stuck. Read the documents and I've been searching in forums to find a solution.
There is a sanity system at my game:
And I want to change the animation and background of the screen if sanity drops below 25:
Problem is, inside the screen I can't use predeclared variables like bg. And I can only "add" new images. This results in adding another background on top of existing which is not what I'd like to do. I want to replace the existing one or add a shake animation to it.
I have a shake transformation:
I'd appreciate the help. Any discussions you guys can link me to it, I'd be happy to read.
There is a sanity system at my game:
Code:
screen sanitybar:
vbox xalign 0.99:
if sanity >= 75:
add "images/sane.png" xalign 1.0 at sanity_transformation()
elif sanity >= 50:
add "images/less_sane.png" xalign 1.0 at sanity_transformation()
elif sanity >= 25:
add "images/not sane.png" xalign 1.0 at sanity_transformation()
else:
add "images/mad sane.png" xalign 1.0 at sanity_transformation()
text "Sanity: [sanity]/100"
bar value AnimatedValue(sanity, 100, 0.5) xalign 0.0 yalign 0.1 xmaximum 200
Code:
label chapter0_0:
scene bg:
zoom 0.7
I have a shake transformation:
Code:
init:
transform my_shake:
linear 0.1 xoffset -2 yoffset 2
linear 0.1 xoffset 3 yoffset -3
linear 0.1 xoffset 2 yoffset -2
linear 0.1 xoffset -3 yoffset 3
linear 0.1 xoffset 0 yoffset 0
repeat
Last edited: