A Flash Developer Resource Site

Results 1 to 19 of 19

Thread: water effect what do you think

  1. #1
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160

    water effect what do you think

    i was playing with this thing maybe i ll use it for a pirate game
    the file size is 34kb but its not compressed though

    http://magnetos.lazoom.com/pirates.swf

    if anybody is interested on how i do it its quite simple
    i got a big jpg picture i break it a part and idivide it in to 4 movie clips
    then i add the code below on each mc i just slightly changed the decimal value for each mc so it waves at a different speed
    thats it

    code:

    onClipEvent (enterFrame) {
    // Creates a slight bobbing motion
    z = 4*Math.cos(ang += 0.092);
    _xscale = _yscale=z+100;
    }


  2. #2
    Senior Member
    Join Date
    Jun 2002
    Location
    Manchester, UK
    Posts
    2,357
    It might have been nicer with more parts??? However it's inspired me for something which I'll do tommorow - not the same but just inspired!!

    RipX

  3. #3
    DOT-INVADER marmotte's Avatar
    Join Date
    May 2002
    Location
    Dot-Switzerland
    Posts
    2,601
    yay, that's great, really ^_^

    i imagine easily the super nice effect if the MCs were smaller and a lot more numerous... it may become like real water!

    good little work.

  4. #4
    avatar free
    Join Date
    Jul 2002
    Location
    UK
    Posts
    835
    Yeah, that is pretty convincing. (Although, yes - more parts to make it smoother at the joins).

    I remember seeing a flag motion flash file AGES ago, this reminded me of that. And there was a money ( dollar ) one too if i recall.

    Think i too might have a play around with water effects after seeing this. ( You'll start a new craze on the games board mag - "new water game - look at!" )
    jonmack
    flash racer blog - advanced arcade racer development blog

  5. #5
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    yeah you guys are right but if i divide the picture a any more it might get a little too slow ....
    i dont know why but i am in the mood for a nice pirate game

    ahr ahr ahr
    i just added water bubbles looks cooler now http://magnetos.lazoom.com/pirates.swf

  6. #6
    Spelunker Beatcow's Avatar
    Join Date
    Apr 2001
    Location
    after 5, before 4 Location::~Location(){}
    Posts
    797
    After i saw pirates of the carribbean, i wanted to make a pirate game. But dont give in, the feeling goes away after a while. YARR!!!! i mean MOO!!!!!!!!

  7. #7
    Member
    Join Date
    Jan 2003
    Posts
    60
    Wow that's really awesome... um er... damn.

    After i saw pirates of the carribbean, i wanted to make a pirate game. But dont give in, the feeling goes away after a while. YARR!!!! i mean MOO!!!!!!!!
    Totally off topic, but does anyone remember Sid Meier's Pirates (PC/NES/Genesis)? One of the best games I've played, and probably the only pirate game I've played.

  8. #8
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223

  9. #9
    Senior Member MiSSenLinX's Avatar
    Join Date
    Jan 2003
    Location
    Perth, Australia
    Posts
    260
    Hey thats a nice effect tonypa

  10. #10
    Patron Saint of Beatings WilloughbyJackson's Avatar
    Join Date
    Nov 2000
    Location
    Ro-cha-cha-cha, New York
    Posts
    1,988
    Neat effect. Although the 4 split become increasing obvious as it continues.

    Just a quick thought but might some sort of masking work also?

    -pXw
    Pretty Little Gunner...coming soon

  11. #11
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    Originally posted by tonypa
    I made once water effect
    http://www.hot.ee/tonypa/flash/flas/water4.html

    You can get the source fla here:
    http://www.flashkit.com/board/showth...hreadid=444890

    nice work tony but it looks like you have 2 mcs scrolling one over the other ,its running water.
    i am trying to anchieve an underwater effect
    i am afraid that even if i break the jpg into smaller parts you'll still be able to see the joints there must be a better way of doing this

  12. #12
    Senior Member random10122's Avatar
    Join Date
    Mar 2002
    Location
    Sheffield, UK
    Posts
    1,747
    Personally i like the joins, looks great

    fracture2 - the sequel
    fracture - retro shooter
    blog - games, design and the rest

    "2D is a format, not a limitation" -Luis Barriga

  13. #13
    Untitled-1.fla strille's Avatar
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    1,626
    magnetos, that's a nice effect.

    The talk about the obvious splits reminded me of the technique I used on the clouds in the z_mapping movie. If you use an alpha blend between the different images it's possible to hide the splits quite well. I just had to test it:

    http://www.strille.net/works/misc/underwaterEffect/

    You have to save the images as .png, which increases the file size a bit, but it's worth it. I used 8 images, and they are scaled and positioned vertically using two sin-functions:

    code:
    this.onEnterFrame = function() {
    var si = Math.sin;

    for (var n=1;n<=8;n++) {
    var clip = images[n];

    yScaleSpeed += 0.04;
    clip._yscale = 120 + 4*si(yScaleSpeed + n/4);

    yMoveSpeed += 0.01;
    clip._y = 20*si(yMoveSpeed + n/5);
    }
    };


  14. #14
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    now that is one coool water effect!
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  15. #15
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    Originally posted by strille
    magnetos, that's a nice effect.

    The talk about the obvious splits reminded me of the technique I used on the clouds in the z_mapping movie. If you use an alpha blend between the different images it's possible to hide the splits quite well. I just had to test it:

    http://www.strille.net/works/misc/underwaterEffect/

    You have to save the images as .png, which increases the file size a bit, but it's worth it. I used 8 images, and they are scaled and positioned vertically using two sin-functions:

    code:
    this.onEnterFrame = function() {
    var si = Math.sin;

    for (var n=1;n<=8;n++) {
    var clip = images[n];

    yScaleSpeed += 0.04;
    clip._yscale = 120 + 4*si(yScaleSpeed + n/4);

    yMoveSpeed += 0.01;
    clip._y = 20*si(yMoveSpeed + n/5);
    }
    };


    thanks strille
    your example its cool but it move too fast and in all directions
    feels like the water its stretched
    maybe it should wave horizontally or vertically only

  16. #16
    Untitled-1.fla strille's Avatar
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    1,626
    It may look like it moves in all directions, but it's only vertical movement and scale. I agree that it's moving a bit too fast and a bit too much, but I exaggerated it on purpose to show the effect clearly. You could always reduce the wave speed and amplitude...

  17. #17
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    Originally posted by strille
    It may look like it moves in all directions, but it's only vertical movement and scale. I agree that it's moving a bit too fast and a bit too much, but I exaggerated it on purpose to show the effect clearly. You could always reduce the wave speed and amplitude...
    thanks again strille i ll study your fla and see if i can understand it
    i also noticed at (least with mine) that if i play the swf on my bros 2Ghz pc it plays too fast and the effect of slow water motion its completely spoiled is there a way to fix this?

  18. #18
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    i would reduce the fps way down on your machine and then keep adding 1 to the fps until the anim runs correctly. it should then run correctly on just about any machine faster than yours.
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  19. #19
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    Originally posted by BlinkOk
    i would reduce the fps way down on your machine and then keep adding 1 to the fps until the anim runs correctly. it should then run correctly on just about any machine faster than yours.
    thanks for the tip blink

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center