Yeah, I may have slightly neglected the NL forum.... When I release a fixed demo this weekend I'll update the topic there as well.
About the screen effect. I'm not going to lie... it's a little complex. I'm not sure how much use you'll get out of the explanation, but I'll give anyway.
1. Turn a switch which makes all the objects I want to remain unaffected draw pitch black. As in: Link's sprites, the HUD and enemies. This is handled in the draw events of the various objects themselves. Also the coloring is important. It has to be pitchblack and the same color can't be used anywhere else in the game ('cause then those pixels would also remain unaffected).
2. Save a screenshot to a surface.
3. Save the surface as a sprite (which I'll call A), also making the black areas transparent in the process.
4. Draw sprite A onto a surface as a fully black image. The result will be an inverted screenshot basically in the sense that all is black with silhouettes for the "constant" elements in the original screenshot (=Link's sprites, the HUD and the enemies)
5. Make a new surface and draw the screenshot and then the surface from 4 onto it.
6. Save this latest surface also as a sprite, again turning the black color transparent. With this you'll have isolated all the sections of the original screenshot that should remain unaffected. Or in other words: You'd have a transparent surface with ONLY the character, enemies and HUD drawn onto it and only the pats you see in the original screenshot. That last part is especially important, because without it "constant" elements on screen will always be drawn on the forground during the effect. If you have an enemy standing behind a bridge or tree you probably don't want to have him pop up in front of said bridge or tree. I'll call the latest sprite B.
7. Next we take sprite A (which had the holes in it) and draw it 5 times onto a new surface. Draw them at the following positions (the sprite should not have any offset values and also the order and placing is importanthere): draw at (0,-8), (-8,0), (0,8), (8,0) and finally like normal at (0,0). The result is sprite A, but with the empty spaces (mostly) filled up with similar colors as the surrounding pixels. You'll get weird graphical effects if skip this. I call this sprite C.
Basically step 1 through 7 have been preparation for the blocky effect. They can best be done just once at the initiation of the shock effect to save resources because the following takes a lot of processing power.
8. Next we created the main effect. From left to right I keep taking a vertical slice (every n pixels) from spriteC and draw it onto a new surface while stretching it the same n pixels in width. I do the same with the resulting image onto the actual screen, only then drawing horizontal slices stretched in height. n equals the size of the resulting blocks. So let's say you are at the start of you're shock sequence and want to create a blocky effect with blocks of 2x2 pixels. Create a drawing loop that draws every second vertical line of sprite C at the same location on a new surface, but with a width x2. Repeat this with the resulting surface to the actual screen but looping through the height rather then the width. Take every second horizontal line in the surface you want to draw. Draw it at the same position on the screen, but draw it with height x2. The result is the blurred screenshot without having used the character, enemies and other constant elements. I must note that drawing lines and stretching them is WAY more efficient then doing it block by block, obviously.
9. Finally draw sprite B (which held just the constant elemants) onto the screen.
And voila. Screen successfully distorted.
I'd like to say that's all, but I'm still having problems with preexisting (partly transparent) surfaces in the original screenshot because they are not saved to surfaces correctly. It's a gamemaker issue so I'm not try to solve it at this time. I'm also unable to get the performance to 30 fps (yet
), but it's hardly noticeable because of the nature of the effect (luckily).