NinjitsuWarrior on DeviantArthttps://www.deviantart.com/ninjitsuwarrior/art/Waves-v-2-69447870NinjitsuWarrior

Deviation Actions

NinjitsuWarrior's avatar

Waves v.2

Published:
7.1K Views

Description

Things I added this time:
Freeze, so the water doesn't moves.
Blue points.
Weird curves.
Adjustable intervals of the water waves.

Still need to add:
Nice curves (can someone help me with that?)
Good mouse effect.
Things you can drop in.

Code:

ystore = new Array();
key = false;
onEnterFrame = function () {
calc = Math.ceil((slide._x-(bar._x-75))/10);
num = calc;
inter = calc;
p1._y = _ymouse;
if (Key.isDown(1)) {
if (slide.hitTest(_xmouse, _ymouse, true)) {
drag = true;
}
} else {
drag = false;
}
if (Key.isDown(1)) {
if (bar.hitTest(_xmouse, _ymouse, true)) {
drag = true;
}
} else {
drag = false;
}
if (Key.isDown(1)) {
p1._y = lasty;
inter = 9999;
} else {
lasty=p1._y;
ystore.unshift(p1._y);
}
if (drag == true) {
slide._x = _xmouse;
p1._y = 200;
}
if (slide._x>bar._x+75) {
slide._x = bar._x+75;
}
if (slide._x<bar._x-75) {
slide._x = bar._x-75;
}
clear();
lineStyle(3);
beginFill(0x3366FF, 100);
moveTo(p1._x, p1._y);
c1._y = (p1._y+p2._y)/2;
p2._y = ystore[inter];
curveTo(c1._x, c1._y, p2._x, p2._y);
c2._y = (p2._y+p3._y)/2;
p3._y = ystore[inter*2];
curveTo(c2._x, c2._y, p3._x, p3._y);
c3._y = (p3._y+p4._y)/2;
p4._y = ystore[inter*3];
curveTo(c3._x, c3._y, p4._x, p4._y);
c4._y = (p4._y+p5._y)/2;
p5._y = ystore[inter*4];
curveTo(c4._x, c4._y, p5._x, p5._y);
c5._y = (p5._y+p6._y)/2;
p6._y = ystore[inter*5];
curveTo(c5._x, c5._y, p6._x, p6._y);
c6._y = (p6._y+p7._y)/2;
p7._y = ystore[inter*6];
curveTo(c6._x, c6._y, p7._x, p7._y);
c7._y = (p7._y+p8._y)/2;
p8._y = ystore[inter*7];
curveTo(c7._x, c7._y, p8._x, p8._y);
lineTo(p8._x, 410);
lineTo(-5, 410);
};
onMouseDown = function () {
if (key == false) {
key = true;
c1._alpha = 100;
c2._alpha = 100;
c3._alpha = 100;
c4._alpha = 100;
c5._alpha = 100;
c6._alpha = 100;
c7._alpha = 100;
p1._alpha = 100;
p2._alpha = 100;
p3._alpha = 100;
p4._alpha = 100;
p5._alpha = 100;
p6._alpha = 100;
p7._alpha = 100;
p8._alpha = 100;
} else {
key = false;
c1._alpha = 0;
c2._alpha = 0;
c3._alpha = 0;
c4._alpha = 0;
c5._alpha = 0;
c6._alpha = 0;
c7._alpha = 0;
p1._alpha = 0;
p2._alpha = 0;
p3._alpha = 0;
p4._alpha = 0;
p5._alpha = 0;
p6._alpha = 0;
p7._alpha = 0;
p8._alpha = 0;
}
};
Image size
550x400px 1.41 KB
© 2007 - 2024 NinjitsuWarrior
Comments28
Join the community to add your comment. Already a deviant? Log In
OrangeChicken2Legs's avatar
hay you should make one where the wave bounces back off the wall.... like having a piece of string tied to something and making it go up and down. then i can look at harmonics! HARMONICS!