N
Nikles
Guest
Hi folks!
I'm currently experiencing a brain fart and I need your help.
I'm creating a wavy/tearing effect (gif below). How do I make it seamlessly repeat forever? Because as it is right now it just keeps moving all those surfaces outside the display. And they never cycles back.
If I reset the sy (screen y) to 0 it will cycle back but I get a jittery effect (just like the bad loop below)
Here's the code in the create event of my controller:
Here's the post draw event
Can you help me implement a seamless loop?
EDIT:
I've edited the above code to highlight what's going on; I'm looping blindly at random here because I can't wrap my head around it. Right now I have zero ideas on how to approach the issue. Any input is appreciated.
I'm currently experiencing a brain fart and I need your help.
I'm creating a wavy/tearing effect (gif below). How do I make it seamlessly repeat forever? Because as it is right now it just keeps moving all those surfaces outside the display. And they never cycles back.
If I reset the sy (screen y) to 0 it will cycle back but I get a jittery effect (just like the bad loop below)
Here's the code in the create event of my controller:
Code:
sy = 0
Code:
var as = application_surface
var dw = display_width
var dh = display_height
var band_num = 16
var band_height = dh / band_num
for (var current_band = 0; current_band < band_num * 2; current_band++)
{
draw_surface_part(as, 0, 0 + band_height * current_band - sy, dw, band_height, 0 + sin(current_band) * 32 , 0 + band_height * current_band - sy)
}
sy += 4
if (band_height * band_num - sy + band_height) <= 0
sy = 0
EDIT:
I've edited the above code to highlight what's going on; I'm looping blindly at random here because I can't wrap my head around it. Right now I have zero ideas on how to approach the issue. Any input is appreciated.
Last edited by a moderator: