31 lines
683 B
Plaintext
31 lines
683 B
Plaintext
# Screen dimensions
|
|
screen_width = Window.GetWidth();
|
|
screen_height = Window.GetHeight();
|
|
|
|
# Load frames
|
|
frame_count = 53;
|
|
frames = [];
|
|
for (i = 0; i < frame_count; i++) {
|
|
num = String(i);
|
|
if (i < 10) num = "000" + num;
|
|
else if (i < 100) num = "00" + num;
|
|
else num = "0" + num;
|
|
frames[i] = Image("frames/frame_" + num + ".png");
|
|
}
|
|
|
|
# Position centered
|
|
x = (screen_width - 498) / 2;
|
|
y = (screen_height - 498) / 2;
|
|
|
|
# Animation state
|
|
current_frame = 0;
|
|
|
|
fun refresh_callback() {
|
|
sprite = Sprite(frames[current_frame]);
|
|
sprite.SetX(x);
|
|
sprite.SetY(y);
|
|
current_frame = (current_frame + 1) % frame_count;
|
|
}
|
|
|
|
Plymouth.SetRefreshFunction(refresh_callback);
|