| 1 |
for (j = 0; j < 2; j++) |
| 2 |
{ |
| 3 |
if (osc_horizontal == true) |
| 4 |
{ |
| 5 |
m_time_elapsed += time_increase; |
| 6 |
if (m_time_elapsed >= time_max) |
| 7 |
{ |
| 8 |
m_time_elapsed = 0; |
| 9 |
m_sign_modifier = -m_sign_modifier; |
| 10 |
} |
| 11 |
} |
| 12 |
if (osc_vertical == true) |
| 13 |
{ |
| 14 |
m_time_elapsed_v += time_increase_v; |
| 15 |
if (m_time_elapsed_v >= time_max_v) |
| 16 |
{ |
| 17 |
m_time_elapsed_v = 0; |
| 18 |
m_sign_modifier_v = -m_sign_modifier_v; |
| 19 |
} |
| 20 |
} |
| 21 |
} |
| 22 |
if (scroll_horizontal == true) |
| 23 |
{ |
| 24 |
scroll_ind_total_x += scroll_ind_inc_x; |
| 25 |
if (scroll_ind_total_x >= scroll_ind_max_x) |
| 26 |
{ |
| 27 |
while (scroll_ind_total_x >= scroll_ind_max_x) |
| 28 |
{ |
| 29 |
scroll_current_x += pixel_dim; |
| 30 |
if (scroll_current_x >= sprite_width) |
| 31 |
scroll_current_x -= sprite_width; |
| 32 |
else if (scroll_current_x < 0) |
| 33 |
scroll_current_x += sprite_width; |
| 34 |
scroll_ind_total_x -= scroll_ind_max_x; |
| 35 |
} |
| 36 |
} |
| 37 |
} |
| 38 |
else |
| 39 |
{ |
| 40 |
scroll_current_x = 0; |
| 41 |
scroll_ind_total_x = 0; |
| 42 |
} |
| 43 |
if (scroll_vertical == true) |
| 44 |
{ |
| 45 |
scroll_ind_total_y += scroll_ind_inc_y; |
| 46 |
if (scroll_ind_total_y >= scroll_ind_max_y) |
| 47 |
{ |
| 48 |
while (scroll_ind_total_y >= scroll_ind_max_y) |
| 49 |
{ |
| 50 |
scroll_current_y += pixel_dim; |
| 51 |
if (scroll_current_y >= sprite_height) |
| 52 |
scroll_current_y -= sprite_height; |
| 53 |
else if (scroll_current_y < 0) |
| 54 |
scroll_current_y += sprite_height; |
| 55 |
scroll_ind_total_y -= scroll_ind_max_y; |
| 56 |
} |
| 57 |
} |
| 58 |
} |
| 59 |
else |
| 60 |
{ |
| 61 |
scroll_current_y = 0; |
| 62 |
scroll_ind_total_y = 0; |
| 63 |
} |
| 64 |
if (interlaced_x == true) |
| 65 |
int_s_current_x = int_s_default_x; |
| 66 |
else |
| 67 |
int_s_current_x = 1; |
| 68 |
if (interlaced_y == true) |
| 69 |
int_s_current_y = int_s_default_y; |
| 70 |
else |
| 71 |
int_s_current_y = 1; |
| 72 |
sign_modifier = m_sign_modifier; |
| 73 |
time_elapsed = m_time_elapsed; |
| 74 |
sign_modifier_v = m_sign_modifier_v; |
| 75 |
time_elapsed_v = m_time_elapsed_v + (scroll_current_y / pixel_dim); |
| 76 |
while (time_elapsed_v >= time_max_v) |
| 77 |
{ |
| 78 |
time_elapsed_v -= time_max_v; |
| 79 |
sign_modifier_v = -sign_modifier_v; |
| 80 |
} |
| 81 |
for (i = 0; i < sprite_height; i += pixel_dim) |
| 82 |
{ |
| 83 |
scroll_temp_x = scroll_current_x; |
| 84 |
if (scroll_temp_x >= sprite_width) |
| 85 |
scroll_temp_x -= sprite_width; |
| 86 |
else if (scroll_temp_x < 0) |
| 87 |
scroll_temp_x += sprite_width; |
| 88 |
scroll_temp_y = scroll_current_y + i; |
| 89 |
if (scroll_temp_y >= sprite_height) |
| 90 |
scroll_temp_y -= sprite_height; |
| 91 |
else if (scroll_temp_y < 0) |
| 92 |
scroll_temp_y += sprite_height; |
| 93 |
if (osc_horizontal == true || osc_vertical == true) |
| 94 |
{ |
| 95 |
if (osc_horizontal == true) |
| 96 |
{ |
| 97 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
| 98 |
animation_disjoint_x = sign_modifier * (max_rise - game_maker_cannot_do_math); |
| 99 |
time_elapsed += time_increase; |
| 100 |
if (time_elapsed >= time_max) |
| 101 |
{ |
| 102 |
time_elapsed = 0; |
| 103 |
sign_modifier = -sign_modifier; |
| 104 |
} |
| 105 |
} |
| 106 |
else |
| 107 |
{ |
| 108 |
animation_disjoint_x = 0; |
| 109 |
} |
| 110 |
var anim_dj_y_last = animation_disjoint_y; |
| 111 |
if (osc_vertical == true) |
| 112 |
{ |
| 113 |
game_maker_cannot_do_math = power((time_elapsed_v / ((time_max_v / 2) * (1 / sqrt(max_rise_v)))) - sqrt(max_rise_v), 2); |
| 114 |
animation_disjoint_y = sign_modifier_v * (max_rise_v - game_maker_cannot_do_math); |
| 115 |
if (interlaced_y == false) |
| 116 |
{ |
| 117 |
time_elapsed_v += time_increase_v; |
| 118 |
if (time_elapsed_v >= time_max_v) |
| 119 |
{ |
| 120 |
time_elapsed_v = 0; |
| 121 |
sign_modifier_v = -sign_modifier_v; |
| 122 |
} |
| 123 |
} |
| 124 |
} |
| 125 |
else |
| 126 |
{ |
| 127 |
animation_disjoint_y = 0; |
| 128 |
} |
| 129 |
animation_disjoint_x = pixel_dim * floor(0.5 + (animation_disjoint_x / pixel_dim)); |
| 130 |
animation_disjoint_y = pixel_dim * floor(0.5 + (animation_disjoint_y / pixel_dim)); |
| 131 |
event_user(0); |
| 132 |
var for_end; |
| 133 |
if (i == 0) |
| 134 |
for_end = 0; |
| 135 |
else |
| 136 |
for_end = animation_disjoint_y - anim_dj_y_last; |
| 137 |
if (for_end < 0) |
| 138 |
for_end = 0; |
| 139 |
for (k = 0; k <= for_end; k++) |
| 140 |
{ |
| 141 |
for (l = 0; l <= 1; l++) |
| 142 |
{ |
| 143 |
var par_y = (draw_top + i + (int_s_current_y * animation_disjoint_y)) - (pixel_dim * k); |
| 144 |
image_alpha = ((par_y - alpha_top) + 1) * ((alpha_max - alpha_min) / ((alpha_bottom - alpha_top) + 1)); |
| 145 |
if (image_alpha > alpha_max) |
| 146 |
image_alpha = alpha_max; |
| 147 |
else if (image_alpha < alpha_min) |
| 148 |
image_alpha = alpha_min; |
| 149 |
draw_sprite_part_ext(sprite_index, image_index, par_left[l], scroll_temp_y, par_width[l], pixel_dim, par_x[l], par_y, image_xscale, image_yscale, c_black, 1); |
| 150 |
draw_sprite_part_ext(sprite_index, image_index, par_left[l], scroll_temp_y, par_width[l], pixel_dim, par_x[l], par_y, image_xscale, image_yscale, c_white, image_alpha * alpha_base); |
| 151 |
} |
| 152 |
} |
| 153 |
} |
| 154 |
int_s_last_y = int_s_current_y; |
| 155 |
if (interlaced_x == true) |
| 156 |
int_s_current_x = -int_s_current_x; |
| 157 |
if (interlaced_y == true) |
| 158 |
int_s_current_y = -int_s_current_y; |
| 159 |
} |