@@ -1126,15 +1126,17 @@ GLOBAL_LIST_EMPTY(transformation_animation_objects)
1126
1126
sleep (duration)
1127
1127
source. cut_overlay(overlay_image)
1128
1128
1129
- // /Perform a shake on an atom, resets its position afterwards
1130
- / atom / proc / Shake(pixelshiftx = 15 , pixelshifty = 15 , duration = 250 )
1129
+ // / Perform a shake on an atom, resets its position afterwards
1130
+ / atom / proc / Shake(pixelshiftx = 2 , pixelshifty = 2 , duration = 2.5 SECONDS , shake_interval = 0.02 SECONDS )
1131
1131
var /initialpixelx = pixel_x
1132
1132
var /initialpixely = pixel_y
1133
- var /shiftx = rand(- pixelshiftx,pixelshiftx)
1134
- var /shifty = rand(- pixelshifty,pixelshifty)
1135
- animate (src , pixel_x = pixel_x + shiftx, pixel_y = pixel_y + shifty, time = 0.2 , loop = duration)
1136
- pixel_x = initialpixelx
1137
- pixel_y = initialpixely
1133
+
1134
+ animate (src , pixel_x = initialpixelx + rand(- pixelshiftx,pixelshiftx), pixel_y = initialpixelx + rand(- pixelshifty,pixelshifty), time = shake_interval, flags = ANIMATION_PARALLEL )
1135
+
1136
+ for (var /i in 3 to ((duration / shake_interval))) // Start at 3 because we already applied one, and need another to reset
1137
+ animate (pixel_x = initialpixelx + rand(- pixelshiftx,pixelshiftx), pixel_y = initialpixely + rand(- pixelshifty,pixelshifty), time = shake_interval)
1138
+
1139
+ animate (pixel_x = initialpixelx, pixel_y = initialpixely, time = shake_interval)
1138
1140
1139
1141
// /Checks if the given iconstate exists in the given file, caching the result. Setting scream to TRUE will print a stack trace ONCE.
1140
1142
/ proc / icon_exists(file, state, scream)
0 commit comments