how do you make this shaking effect?
https://giphy.com/gifs/9dzqIWLk9DlgwXihwr
how do you make this shaking effect?
https://giphy.com/gifs/9dzqIWLk9DlgwXihwr
Give your character two alterable values called "shakeX" and "shakeTimer."
Set its X position to X Position("character")+shakeX.
Set the shakeTimer to your FrameRate*2, and Always substract 1 from the shakeTimer.
When shakeTimer<FrameRate*0.5, and shakeTimer mod FrameRate*0.25=0 (Compare to two Values), set shakeX to RRandom(-1,1)*100.
When shakeTime=0, set ShakeTimer to FrameRate.
what do you mean by FrameRate?
what do you mean by FrameRate?
like 60 fps?
It didnt work. I put -
(Start of Frame)--------X position to X Position("character")+shakeX
(Always)---------shakeTimer to FrameRate*2, substract 1 from the shakeTimer
When shakeTimer<FrameRate*0.5, and shakeTimer mod FrameRate*0.25=0, set shakeX to RRandom(-1,1)*100
When shakeTime=0, set ShakeTimer to FrameRate
my character is just flying off the screen.
I made you an example, it has 2 groups of events, one with shake in X (enabled by default) and the other with shake in X and Y (disabled), you can also set the strength and the number of shakes you want.
Shake example.mfa
thanks this works perfectly!