Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


MiniTut#4: SwarmTut!

Authors

Andrea (Andrea364)

Contact | Site | Add Artist to Favorites

Haley87

Contact | Site | Add Artist to Favorites

Soul-Eating-Reaper07

Contact | Add Artist to Favorites

Date Submitted

08/14/2007 | 09:22PM EST

File Information

Movie | 10.1 KB

Add Movie to Favorites

Current Score

2.49 / 5.00

Score Rank: #83,443
Popularity Rank: #109,408

299 votes | 769 views

Click an icon to vote on this!

You are not logged in.

If you log in to vote, you could win $100!

Related Submissions

Submissions by Andrea (Andrea364):

Submissions by Haley87:

Submissions by Soul-Eating-Reaper07:

Everyone Suitable For All Audiences
MiniTut#4: SwarmTut!
Watch this Movie!
Pop-Up | Add to Favorites

Author Comments

THE ACTIONSCRIPT IS IN THE COMMENTS! LOOK FOR THE AS BELOW!

Yay 4th MiniTut in the series! Well, this time it's all about swarming, hope you enjoy. The only drawback is, we couldn't fit the AS into the movie, so we had to put it in here. It's only one frame, hence the name "MiniTut" (short for miniature tuturial) so please do not leave pissy reviews.

***Please review!***

ACTION SCRIPT FOR SWARMING:

fly = function () {
this.animate = function() {
this.targetX = _root._xmouse;
this.targetY = _root._ymouse;
this.distX = this.targetX-this.meX+thi s.flockX;
this.distY = this.targetY-this.meY+thi s.flockY;
if ((this.targetX == this.oldTargetX) && Math.random()>0.9) {
this.flockX = (Math.random()*100)-50;
this.flockY = (Math.random()*100)-50;
} else if ((this.targetX<>this.oldT argetX) && Math.random()>0.8) {
this.flockX = (Math.random()*400)-200;
this.flockY = (Math.random()*400)-200;
}
this.meX = Math.round(this.meX+(this .distX)/20);
this.meY = Math.round(this.meY+(this .distY)/20);
this._x = this.meX;
this._y = this.meY;
this.oldTargetX = this.targetX;
};
this.initialize = function() {
this.targetX = 0;
this.targetY = 0;
this.distX = 0;
this.distY = 0;
this.meX = this._x;
this.meY = this._y;
this.oldTargetX = 0;
this.flockX = (Math.random()*200)-100;
this.flockY = (Math.random()*200)-100;
};
this.initialize();
this.onEnterFrame = this.animate;
};
var i:Number = 0;
var bugClip:MovieClip;
for (i=0; i<30; i++) {
bugClip = this.attachMovie("bug", "bug"+i, i);
fly.apply(bugClip);
}
- - -

These are rather simple script components, but don't underestimate them. They are rather hard to individually explain, so I'd reccommend asking someone like Luther or S-S-X for explanations. I personally did not get the code, my teammate S-E-R07 (Soul-Eating-Reaper07) did, so i guess you could ask him...

- - -

Credits:

Andrea364: instructions, flashing it out
Haley87: Layout, inspiration, etc.
Soul-Eating-Reaper07: ActionScript.

- - -

Comments-

Andrea364: I'm happy with this work, since it should help people in need of such script and instructions. I'll definitely have room to be proud of it in the long run when I eventually update it.

Haley87: Well, it's done, and in less than a day too! I wonder what our next project will be? Look forward to something on Clock Day!

Soul-Eating-Reaper07: -no comment-

- - -

Well, Enjoy!

6 reviews | Log in to write a review | Share this!

The people have spoken

Average Score: 4.8 / 10

Score: 10
DrakstonOfDoom

"ur good at this"

date: September 23, 2007

good tut i lernt stuff frum it

Rate this review:
Helpful!
Useless.
Flag as abusive.
No users have weighed in on this review.

Score: 8
JoAlice

"I don't know what swarming is, but ok."

date: August 29, 2007

This is one of your better tuturials I'd say. Considering that it's for n00bs like me, it's pretty great. Nice teaching there, sis. I know you can do beter than this though.

September 3, 2007

Author's Response:

Jeez, do you have to review EVERYTHING I submit? ... .. ...... you bore me...

Rate this review:
Helpful!
Useless.
Flag as abusive.
No users have weighed in on this review.

Score: 1
bittleon

"Flash please"

date: August 19, 2007

newgrounds is a website for flash...not for stupi text, i did not read it because this sucks, you have been blammed by me!

August 23, 2007

Author's Response:

You idiot, you can't blam a flash that has already passed. Stop being ignorant and take hold of the opportunity to actually learn something. If I wasn't a girl I'd have you pinned against something and have your eyes jabbed out. Alas, I can just flag your review instead, because that is enough for me. Go read the review rules you dull prude.

Rate this review:
Helpful!
Useless.
Flag as abusive.
People think this is a useless review.

Score: 10
sixflab

"small but helpful"

date: August 14, 2007

I'm new to flash and even though it was small it was very helpful.

August 15, 2007

Author's Response:

Why thankyou very much, I'm glad you got some use out of it.

Rate this review:
Helpful!
Useless.
Flag as abusive.
People find this review helpful!

Score: 0
nekoheehee

"didnt work"

date: August 14, 2007

no idea what went wrong but i got 4 errors

**Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 5: Syntax error.
this.distX = this.targetX-this.meX+thi s.flockX;

**Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 6: Syntax error.
this.distY = this.targetY-this.meY+thi s.flockY;

**Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 10: ')' expected
} else if ((this.targetX<>this.oldT argetX) && Math.random()>0.8) {

**Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 19: Unexpected '}' encountered
};

Total ActionScript Errors: 4 Reported Errors: 4

August 14, 2007

Author's Response:

Sorry, but you have to do it in an empty keyframe and on level one for it to work I think. D:

Rate this review:
Helpful!
Useless.
Flag as abusive.
People find this review helpful!