36 inherit: "default" 0.0;
54 inherit: "default" 0.0;
62 name: "animation_start";
65 after: "animation,clear";
69 name: "call_animation,state1";
72 set_int(anim_id, anim(get_float(global_speed), "animation_1", 0));
78 name: "call_animation,state2";
81 set_int(anim_id, anim(get_float(global_speed), "animation_2", 0));
87 name: "animation,stop";
91 cancel_anim(get_int(anim_id));
96 name: "animation,clear";
98 cancel_anim(get_int(anim_id));
99 if (get_int(anim_n) == 2)
100 set_float(anim_pos, (get_float(anim_pos) - 1) * ( -1));
102 after: "call_animation,state1";
111 public message(Msg_Type:type, id, ...) {
112 if ((type == MSG_FLOAT) && (id == MSG_ID_VEL))
113 set_float(global_speed, Float:getarg(2));
116 public animation_1(val, Float:pos) {
117 if (pos >= get_float(anim_pos) && get_int(anim_n) == 1)
119 set_tween_state(PART:"square1", pos, "default", 0.0,
121 set_tween_state(PART:"square2", pos, "default", 0.0,
123 set_float(anim_pos, pos);
127 run_program(PROGRAM:"call_animation,state2");
128 set_float(anim_pos, 0.0);
132 public animation_2(val, Float:pos) {
133 if (pos >= get_float(anim_pos) && get_int(anim_n) == 2)
135 set_tween_state(PART:"square1", pos, "invert", 0.0,
137 set_tween_state(PART:"square2", pos, "invert", 0.0,
139 set_float(anim_pos, pos);
143 run_program(PROGRAM:"call_animation,state1");
144 set_float(anim_pos, 0.0);