Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Neat Water tricks. (GM 5&4)


Recommended Posts

Hmm... using speed can't be very precise, because of the view scrolling, I suggest this method, that I use:

For a static background:

draw_background(background,view_xview,view_yview)

For the furthest parallax:

for (i=0; i< room_width/1.5; i+=put background width here)draw_background(background name,i+view_xview/1.5, view_yview/1.5)

For the middle parallax:

for (i=0; i< room_width/2; i+=" put background width here")draw_background(background name,i+view_yview/2, view_xview/2)

For the nearest parallax:

for (i=0; i< room_width/2.5; i+=" put background width here")draw_background(background name,i+view_xview/2.5, view_yview/2)

I hope can help...

Link to comment
Share on other sites

I can't download the file no matter what I do. Anyway, tiling your own background while drawing only the amount of times needed requires one tricky algorithm (but you can probably get away with being sloppy):

i=x1-((x1 mod bw)-(bx mod bw))-bw*((x1 mod bw)&lt;(bx mod bw));

for(i=i; i&lt;=x2; i+=bw){
    draw_background(background,i,by);
}

-x1 and x2 are the start and end of the area you want it to be drawn (namely "view_xview" and "view_xview+view_wview" respectively)

-bx and by are the positions of the background you want to be drawn (usually view_x/yview multiplied by something between 0 and 2).

-bw is the width of the background.

Anyway, here's a complete paralax system ala Sonic 3. With a little editing, this system could easily be split into having two seperate paralax systems for above and below the water line.

http://fast.filespace.org/KainSirusque/paralax.gm6

Forgive the crappy server, I don't know the best place to upload random .gm6 files.

Edit: GM 5.x version:

http://fast.filespace.org/KainSirusque/paralax.gmd

Link to comment
Share on other sites

can't download the file no matter what I do.

Me niether. =/

Anyway, here's a complete paralax system ala Sonic 3. With a little editing, this system could easily be split into having two seperate paralax systems for above and below the water line.

http://fast.filespace.org/KainSirusque/paralax.gm6

Forgive the crappy server, I don't know the best place to upload random .gm6 files.

Edit: GM 5.x version:

http://fast.filespace.org/KainSirusque/paralax.gmd

I looked at the GM5 version and just saw some classic paralax. I thought the topic was supposed to show off a water effect... Anyways, add some vertical paralax to that ( just a little bit ) and it'll look nice.

BTW, shouldn't your examples go under fangame assistance since that's where tutorials go? This is just a programming discussion part of the forum where you talking about how things can be done. ( Yes, I see that you have done that too )

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...