Forum Topic: Look at this!!!!

(15,152 views • 1,050 replies)

This topic is 36 pages long. [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 92236 ]

<< < > >>
Happy

Fargate

Reply To Post Reply & Quote

Posted at: 12/2/02 07:27 PM

Fargate LIGHT LEVEL 09

Sign-Up: 10/30/02

Posts: 229

I Think everyone should find these useful!!!!! Please post if you have any questions or If you have any other good scripts.thx.

Movie Clip Follows Mouse
_________________________________

onClipEvent(enterFrame) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}

*********Dragging Script
_____________________________________

onClipEvent (enterFrame) {
if (drag) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
}

Runaway from Mouse
__________________________________________

onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse,_root._ymouse,true)) {
this._x = int(Math.random()*550);
this._y = int(Math.random()*400);
}
}

Random Appearance
__________________________________________

onClipEvent(load) {
chanceOfAppearing = 10;
chance = 0;
}

onClipEvent(enterFrame) {
chance++;
if (Random(chanceOfAppearing) < chance) {
this._x = Random(550);
this._y = Random(400);
chance = 0;
} else {
this._x = -100;
}
}

Random Wandering
_____________________________________________
onClipEvent(load) {
wanderAmount = 300;
leftLimit = 10;
rightLimit = 540;
chanceOfJump = 50;
xPosition = 275;
speed = 10;
chanceOfChange = 0;
}

onClipEvent(enterFrame) {
xPosition += speed;
this._x = xPosition;
chanceOfChange++;
if ((Math.random()*wanderAmount < chanceOfChange) or (xPosition < leftLimit) or (xPosition > rightLimit)) {
speed = -speed;
chanceOfChange = 0;
}
if (Math.random()*chanceOfJump == 1) {
xPosition = Math.random()*(rightLimit-leftLimit)+leftLimit;
}
}

Random Movement
______________________________________________

onClipEvent(load) {
dx = Math.random()*10-5;
dy = Math.random()*10-5;
}

onClipEvent(enterFrame) {
this._x += dx;
this._y += dy;

if (Math.random() > .9) {
dx = Math.random()*10-5;
dy = Math.random()*10-5;
}
}

Tell Targets
___________________________________

on (release) {
tellTarget ("../bar") {
nextFrame ();
}
}

Replacing Mouse (PLACE SCRIPT IN FRAME NOT IN MOVIE CLIP)
___________________________________________________________
startDrag("_root.cursor", true);
Mouse.hide()

CREATING A MOVING BACKGROUND WITH A MOVIE CLIP
________________________________________________
onClipEvent(enterFrame){
if(_root.character._x > 200){
this._x -= 10
_root.character._x -= 10
}
if(_root.character._x < 100){
this._x += 10
_root.character._x += 10
}
}

SIDE TO SIDE CHARACTER MOVEMENT
___________________________________
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x+=5;
} else if (Key.isDown(Key.LEFT)) {
this._x-=5;
}
}

UP and DOWN DIRECTION MOVEMENT FOR A CHARACTER
______________________________________________

onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
this._y-=5;
} else if (Key.isDown(Key.DOWN)) {
this._y+=5;
}
}

FOLLOW MOUSE SCRIPT 2
_____________________________
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 3;
}
onClipEvent (mouseMove) {
targetx = _root._xmouse;
targety = _root._ymouse;
}
onClipEvent (enterFrame) {
_x += (targetx-_x)/speed;
_y += (targety-_y)/speed;
}

Hope some of this was helpful! Spread the knowledge!

~Fargate


None

ChocolateChipClock

Reply To Post Reply & Quote

Posted at: 12/4/02 04:07 AM

ChocolateChipClock NEUTRAL LEVEL 19

Sign-Up: 08/16/02

Posts: 4,139

wow! thank u! i was wondering how to do random stuff. i hope it works when i try it!


None

Wormtail

Reply To Post Reply & Quote

Posted at: 12/4/02 05:57 AM

Wormtail LIGHT LEVEL 13

Sign-Up: 04/01/01

Posts: 497

:: Car script ::
onClipEvent (enterFrame) {
// right
if (Key.isDown(Key.RIGHT)) {
_rotation = _rotation+move;
}
// left
if (Key.isDown(Key.LEFT)) {
_rotation = _rotation-move;
}
// up
if (Key.isDown(Key.UP)) {
if (move<8) {
move++;
}
} else if (move>0) {
move--;
}
// down
if (Key.isDown(Key.DOWN)) {
if (move>-10) {
move--;
}
} else if (move<0) {
move++;
}
// enter
if (Key.isDown(Key.ENTER)) {
_x = 200;
_y = 200;
_rotation = 0;
move = 0;
}
// _x & _y position
if (_rotation>180) {
_y = _y+(move*Math.cos(Math.PI/180*_rotation));
_x = _x-(move*Math.sin(Math.PI/180*_rotation));
}
if (_rotation<180) {
_y = _y-(move*Math.cos(Math.PI/180*_rotation));
_x = _x+(move*Math.sin(Math.PI/180*_rotation));
}
}


None

ChocolateChipClock

Reply To Post Reply & Quote

Posted at: 12/4/02 07:04 PM

ChocolateChipClock NEUTRAL LEVEL 19

Sign-Up: 08/16/02

Posts: 4,139

hey, one question, how do u make it so u can give something the effect that it jumps and then comes back down when u release.


None

Fargate

Reply To Post Reply & Quote

Posted at: 12/4/02 07:24 PM

Fargate LIGHT LEVEL 09

Sign-Up: 10/30/02

Posts: 229

You mean making a character jump? A jumping script.

onClipEvent (load){
vel_y = 0;
jumping = false;
}
onClipEvent ( enterFrame){
if (Key.isDown(Key.SPACE) && !jumping) {
vel_y =20;jumping = true;}
if (jumping == true) {
vel_y -=1;
if ( vel_y <=-10){ vel_y=-10;}
this._y -= vel_y;}
if (_root.ground.hitTest (this._x,this._y+45,true))
{vel_y = 0; jumping = false;}
}

Put this code in your character MC. And don't forget to make an MC and LABEL it ground. then place it below your character.(This MC will stop your character when he falls back down).

vel_y =20;jumping = true;}

This line of code determines how high your character will jump. Fiddle with the number if you like.

I hope this has answered your question, if not please post here again! :)

~Fargate


None

Fargate

Reply To Post Reply & Quote

Posted at: 12/5/02 10:45 PM

Fargate LIGHT LEVEL 09

Sign-Up: 10/30/02

Posts: 229

This thread seems to be dying out! What's up with that! Please post more guys. I'm happy to answer any questions I can.


None

jjb2004

Reply To Post Reply & Quote

Posted at: 12/5/02 10:56 PM

jjb2004 NEUTRAL LEVEL 15

Sign-Up: 06/02/01

Posts: 170

im trying to make one of those retarded space fighter games, i got it so i can fire, move, have enemies and everything, but i cant get the enemys to fire back? do you know how? :-p


Happy

Mr-Y

Reply To Post Reply & Quote

Posted at: 12/6/02 12:09 AM

Mr-Y NEUTRAL LEVEL 19

Sign-Up: 04/28/00

Posts: 385

Good job guys, this is pure gold to many people... more FLASH PROS should join this BBS noteposting sessions! Wow, this might really come in handy to so many people... many n00bs for FLASH. Keep up the good work! I wish that I could help posting up actionscripts, but I memorized only the basics, and I can't find the flash file I had that has all the cool actionscripts I know!! DAMN.


None

Wormtail

Reply To Post Reply & Quote

Posted at: 12/6/02 01:29 AM

Wormtail LIGHT LEVEL 13

Sign-Up: 04/01/01

Posts: 497

Seriously guys. Don't let this topic die.


None

kickass8227

Reply To Post Reply & Quote

Posted at: 12/6/02 02:06 AM

kickass8227 NEUTRAL LEVEL 04

Sign-Up: 11/28/02

Posts: 43

yeah i have one question...how the hell do u guys do these things??? thats pretty good


Happy

Mr-Y

Reply To Post Reply & Quote

Posted at: 12/6/02 07:55 AM

Mr-Y NEUTRAL LEVEL 19

Sign-Up: 04/28/00

Posts: 385

"Look at this!!!" is a pretty attractive topic name, but it should've been more specific, like "Add and Collect Actionscripts" or something, so the NewGrounds users know that when they come here, they're gonna find valuable things, instead of thinking that this topic is only about looking at dumb pics, and not stopping here.

I posted another message here, right now, just to keep the topic alive.


None

Fargate

Reply To Post Reply & Quote

Posted at: 12/6/02 03:32 PM

Fargate LIGHT LEVEL 09

Sign-Up: 10/30/02

Posts: 229

At 12/6/02 07:55 AM, Mr_Y wrote: "Look at this!!!" is a pretty attractive topic name, but it should've been more specific, like "Add and Collect Actionscripts" or something, so the NewGrounds users know that when they come here, they're gonna find valuable things, instead of thinking that this topic is only about looking at dumb pics, and not stopping here.

I posted another message here, right now, just to keep the topic alive.

Yeah I know, when I made it I didn't think it was going to be so popular. Oh well, the number of replies on the topic might attract people anyways...


Happy

Fargate

Reply To Post Reply & Quote

Posted at: 12/6/02 03:35 PM

Fargate LIGHT LEVEL 09

Sign-Up: 10/30/02

Posts: 229

By the way here are some updated corrections and More handy scripts.

Dragging Script(CORRECTED, THE ONE IN FIRST POST IS WRONG!!!!!!!!)
_____________________________________

onClipEvent(mouseDown) {
if(this.hitTest(_root._xmouse, _root._ymouse)) {
this.startDrag(true);
}
}
onClipEvent(mouseUp) {
this.stopDrag();
}

jumping Character Script ( PLACE SCRIPT IN CHARACTER MC)

* Don't forget to name Mc called ground if using exact script!!!!
_____________________________________________________________________
onClipEvent (load){
vel_y = 0;
jumping = false;
}
onClipEvent ( enterFrame){
if (Key.isDown(Key.SPACE) && !jumping) {
vel_y =20;jumping = true;}
if (jumping == true) {
vel_y -=1;
if ( vel_y <=-10){ vel_y=-10;}
this._y -= vel_y;}
if (_root.ground.hitTest (this._x,this._y+45,true))
{vel_y = 0; jumping = false;}
}

Racing Game Script ( Place in Racing Car MC)
___________________________________________________________________
onClipEvent (enterFrame) {
// right
if (Key.isDown(Key.RIGHT)) {
_rotation = _rotation+move;
}
// left
if (Key.isDown(Key.LEFT)) {
_rotation = _rotation-move;
}
// up
if (Key.isDown(Key.UP)) {
if (move<8) {
move++;
}
} else if (move>0) {
move--;
}
// down
if (Key.isDown(Key.DOWN)) {
if (move>-10) {
move--;
}
} else if (move<0) {
move++;
}
// enter
if (Key.isDown(Key.ENTER)) {
_x = 200;
_y = 200;
_rotation = 0;
move = 0;
}
// _x & _y position
if (_rotation>180) {
_y = _y+(move*Math.cos(Math.PI/180*_rotation));
_x = _x-(move*Math.sin(Math.PI/180*_rotation));
}
if (_rotation<180) {
_y = _y-(move*Math.cos(Math.PI/180*_rotation));
_x = _x+(move*Math.sin(Math.PI/180*_rotation));
}
}

~Fargate

Keep Adding More!!!!!


None

ibanezrocks

Reply To Post Reply & Quote

Posted at: 12/6/02 03:49 PM

ibanezrocks EVIL LEVEL 07

Sign-Up: 07/23/02

Posts: 240

WOW MAN!!! ur one good scripter i give u props but lets see if u know this one becuase i dont!lol ne wayz im making a fighting game where there will b all the diff symbols from diff macromedia products like flash,fireworks,dreamweaver u know and they will each there own perosality but i have no idea how to it when u punch it takes away his health and the same when he punches if u could get the scripts thad b the koolest!!!!or mayb do u wanna team with me and work on it(not expectin u will or ne thing jus threw the chance out for the hell of it)ps.im a good animater


Questioning

DANNYESLOCO

Reply To Post Reply & Quote

Posted at: 12/6/02 05:29 PM

DANNYESLOCO EVIL LEVEL 18

Sign-Up: 12/01/02

Posts: 152

Im reading some book on actionscripting and ive probably read it over 3 times the past year and i have absoleteley no idea how people can become use to this? How long did it take you guys to learn actionscript?


Thinking

Fargate

Reply To Post Reply & Quote

Posted at: 12/6/02 05:52 PM

Fargate LIGHT LEVEL 09

Sign-Up: 10/30/02

Posts: 229

At 12/6/02 03:49 PM, ibanezrocks wrote: WOW MAN!!! ur one good scripter i give u props but lets see if u know this one becuase i dont!lol ne wayz im making a fighting game where there will b all the diff symbols from diff macromedia products like flash,fireworks,dreamweaver u know and they will each there own perosality but i have no idea how to it when u punch it takes away his health and the same when he punches if u could get the scripts thad b the koolest!!!!or mayb do u wanna team with me and work on it(not expectin u will or ne thing jus threw the chance out for the hell of it)ps.im a good animater

First of All do you know how use Tell targets and Hittest? If not there is some serious explaining in order. Just a general note, when you guys post stuff be exact about what exactly you know or don't know.thx.

~Fargate


Questioning

BazzMann

Reply To Post Reply & Quote

Posted at: 12/6/02 06:38 PM

BazzMann EVIL LEVEL 17

Sign-Up: 06/08/02

Posts: 4,675

Hey Fargate, firstly you are a thanks for the help so far... im a pretty good designer, but need help for a few things

Okay, basically I know about telling targets, but its a specific hittest idea im not sure of. Actually, 3 problems needing 3 scripts... sorry :(
#1: I have designed a game, where a movieclip in the shape of a basic 'maze' outline is on top, and a character is in between. On a hittest that touches one of the first MC 'walls', ive got it to stop moving, as in not passin through a wall. Thats fine... but how can i get it so you can back away from the wall afterwards? I did it so that

if (wallconflict=1){
onKeyPress(up/down/left/right/orwhatever)
getProperty(movie1, _x)+10
}else{
codeiwrote for nothing to happen
}
Sorry about the coding, its makeshift for wot i actually wrote and it worked... but say if you do collide with a wall, i dont just want it to stop dead, i want you to b able to back away from it again!! Help!

#2: Multi-hit tests! lets say for example, we have 'x' number of movieclips, and you want to test individual/group collisions with one object, lets say a human-controlled clip... how do you do it without multiple hittests? is there some sort of loop?

#3: Duplicating movie clips... ive designed something where a tween shooting a 'bullet' is duplicated on key press, and i used a code that creates one (or many) duplicates on a keypress (i.e. machinegun fire). How do i get these individual DUPLICATES of the movie to have a hit-test, as in react to an object they hit? I used a 'depth' script, so you have a counter called x' that goes up 1 when each is duplicated, and names the duplicate ("movieclip" add x). Conflicts for these?

Thank you so much if you can give me any amount of help/scrpts for any, or all, of these problems! to see some of my pretty okayish animation, check my profile.. dont worry, i wont use ur scripts to make useles example junk cluttering the portal! cheers again, and im sorry for takin so much time and space! but ive got several very good projects planned!


None

ibanezrocks

Reply To Post Reply & Quote

Posted at: 12/6/02 07:38 PM

ibanezrocks EVIL LEVEL 07

Sign-Up: 07/23/02

Posts: 240

At 12/6/02 05:52 PM, Fargate wrote:
At 12/6/02 03:49 PM, ibanezrocks wrote:

First of All do you know how use Tell targets and Hittest? If not there is some serious explaining in order. Just a general note, when you guys post stuff be exact about what exactly you know or don't know.thx.

~Fargate

ya i no hittest and telltraget fine.its almost required to mkae ne thing good in flash nowadays

ya im confortable with hittest u need to do no it to b able to make ne thing that ppl will like on NG


Questioning

kickass8227

Reply To Post Reply & Quote

Posted at: 12/6/02 08:36 PM

kickass8227 NEUTRAL LEVEL 04

Sign-Up: 11/28/02

Posts: 43

hey thanx a lot u guys have been a big help for me, keep making more because u guys are very good


Happy

Spardadmc

Reply To Post Reply & Quote

Posted at: 12/6/02 10:51 PM

Spardadmc EVIL LEVEL 04

Sign-Up: 12/05/02

Posts: 9

Woa thanx man!


Happy

Cypher

Reply To Post Reply & Quote

Posted at: 12/6/02 11:46 PM

Cypher NEUTRAL LEVEL 22

Sign-Up: 11/12/02

Posts: 131

Wow this has been really helpful to me...maybe now I can make some 'decent' movies.

Thanks a lot Fargate, you must be working up something really good for NG.

:)

Anyhow. I shall make a movie now..I shall ask if I need anything.

~Refkinson


None

Fargate

Reply To Post Reply & Quote

Posted at: 12/7/02 10:00 AM

Fargate LIGHT LEVEL 09

Sign-Up: 10/30/02

Posts: 229

At 12/6/02 11:46 PM, Refkinson wrote: Wow this has been really helpful to me...maybe now I can make some 'decent' movies.

Thanks a lot Fargate, you must be working up something really good for NG.

)
Anyhow. I shall make a movie now..I shall ask if I need anything.

~Refkinson

haha. I wish I was making a good movie.I've tried.I may be an intermediate scripter, but my graphics are the dumps. If I could only master Freehand 10. Then I could make something decent. Mind you, I've learned a lot since my last attempt. Ah well, Practice, Practice.


None

ibanezrocks

Reply To Post Reply & Quote

Posted at: 12/7/02 10:26 AM

ibanezrocks EVIL LEVEL 07

Sign-Up: 07/23/02

Posts: 240

fargate lets team up and make a game u said ur graphics were the dumps but ur a kikc ass scripter im a good grapihc artist well think about it and get bac to me thanxs


None

Fargate

Reply To Post Reply & Quote

Posted at: 12/7/02 05:18 PM

Fargate LIGHT LEVEL 09

Sign-Up: 10/30/02

Posts: 229

At 12/7/02 10:26 AM, ibanezrocks wrote: fargate lets team up and make a game u said ur graphics were the dumps but ur a kikc ass scripter im a good grapihc artist well think about it and get bac to me thanxs

Ok First of all, I looked at your only submission. No offense or anything,but I'd say my graphics are about as good as that( Not that I mean to say your graphics are crap).So.. what would the point be... I don't want to offend you or anything, don't get me wrong.


None

ibanezrocks

Reply To Post Reply & Quote

Posted at: 12/7/02 06:54 PM

ibanezrocks EVIL LEVEL 07

Sign-Up: 07/23/02

Posts: 240

ya i no that suxs i pumped it out in about a hour i would have more stuff on newgrounds but im not the best scripter i can make racing games 1st person shooters and simple platform but turly i can draw amazing things if u have or a email i could show u some things and i swear u will b amazed


Shouting

FFfan06

Reply To Post Reply & Quote

Posted at: 12/8/02 05:10 AM

FFfan06 NEUTRAL LEVEL 05

Sign-Up: 10/05/02

Posts: 57

I know what action scripts are but how do you use them?


Happy

EviLudy

Reply To Post Reply & Quote

Posted at: 12/8/02 09:33 AM

EviLudy LIGHT LEVEL 39

Sign-Up: 08/17/02

Posts: 4,525

You actionscript guys rule! Last half year i only studied a bit with my books html 4.01 but now i see how great you guys are... TOMMOROW I BUY I BOOK FLASH ACTIONSCRIPT!

Swing a Little more!
.. ROCK OUT!

BBS Signature

None

Wormtail

Reply To Post Reply & Quote

Posted at: 12/8/02 09:38 AM

Wormtail LIGHT LEVEL 13

Sign-Up: 04/01/01

Posts: 497

At 12/8/02 09:33 AM, eviLudy wrote: You actionscript guys rule! Last half year i only studied a bit with my books html 4.01 but now i see how great you guys are... TOMMOROW I BUY I BOOK FLASH ACTIONSCRIPT!

YAY!


Happy

Fargate

Reply To Post Reply & Quote

Posted at: 12/8/02 11:33 AM

Fargate LIGHT LEVEL 09

Sign-Up: 10/30/02

Posts: 229

Damn the number of posts in this thread is sky rocketing!!!! :) :)


None

Wormtail

Reply To Post Reply & Quote

Posted at: 12/8/02 12:43 PM

Wormtail LIGHT LEVEL 13

Sign-Up: 04/01/01

Posts: 497

We'll break a world record!


All times are Eastern Standard Time (GMT -5) | Current Time: 11:51 AM

<< Back

This topic is 36 pages long. [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 92236 ]

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!