Forum Topic: Actionscript codes here!

(210,154 views • 8,558 replies)

This topic is 286 pages long. [ 1141280 | 281 | 282 | 283 | 284 | 285 | 286 ]

<< < > >>
None

picofan27

Reply To Post Reply & Quote

Posted at: 10/17/09 01:48 AM

picofan27 EVIL LEVEL 08

Sign-Up: 02/01/08

Posts: 47

hey i need help making a tower defence game


None

LiquidOoze

Reply To Post Reply & Quote

Posted at: 10/17/09 07:54 AM

LiquidOoze NEUTRAL LEVEL 18

Sign-Up: 05/13/08

Posts: 233

I'm sure this has been asked already but I'm not going to look through al the 285 pages so... how do I get a saving function for levels?

BBS Signature

Winking

hdxmike

Reply To Post Reply & Quote

Posted at: 10/18/09 10:27 AM

hdxmike LIGHT LEVEL 08

Sign-Up: 09/11/09

Posts: 1,738

At 10/17/09 07:54 AM, LiquidOoze wrote: I'm sure this has been asked already but I'm not going to look through al the 285 pages so... how do I get a saving function for levels?

Depends , AS2 or AS3 ?

Look up Local shared objects LSO
Its mega easy

OOP AS3 || Flash 8,CS3,CS4 || PC or MAC ? || one month of sarcasm !

BBS Signature

Elated

lgnxhll

Reply To Post Reply & Quote

Posted at: 10/18/09 02:50 PM

lgnxhll EVIL LEVEL 05

Sign-Up: 06/24/09

Posts: 436

how would you make it so when your character runs over an object it disapeers and text box puts adds one number starting at zero too your money count also how would you make the text box displaying howmuch money yuo have stay at top left of the screen no matter where you goor what you do

look at it and visit my pofile

BBS Signature

None

lgnxhll

Reply To Post Reply & Quote

Posted at: 10/18/09 03:12 PM

lgnxhll EVIL LEVEL 05

Sign-Up: 06/24/09

Posts: 436

At 12/19/06 09:44 PM, Axlenz-FlashElite wrote: Aww doenst work for some reason...

At 12/19/06 03:04 AM, West-End-Pro wrote: use the V-CAM and put:

onClipEvent(enterFrame){
this._x = player._x;
this._y = player._y;
}

an easier substitute for a v-can would be an api look in the first few pages of this topic for the code

look at it and visit my pofile

BBS Signature

None

lgnxhll

Reply To Post Reply & Quote

Posted at: 10/18/09 04:05 PM

lgnxhll EVIL LEVEL 05

Sign-Up: 06/24/09

Posts: 436

sorry for triple post but hears some code and all i need is them too fix the ground hittesting cause it doesent work very well dont do anything else too it
ive got everything set up right but the ground hittest wont work help heer it is send it back when you can thanks onClipEvent(load){ _root.grav=0; _root.xmove=0; _root.attack=false; _root.airatk=false; } onClipEvent(enterFrame){ //CEILING SCRIPT while(_root.ceiling.hitTest(_x,_y-25,tru e)&&_root.grav<0){ _root.grav++; } //WALL SCRIPT while(_root.wall.hitTest(_x+117,_y,true)
&&_root.xmove>0){ _root.xmove--; } while(_root.wall.hitTest(_x-17,_y,true)&
&_root.xmove<0){ _root.xmove++; } //GRAVITY SCRIPT _root.grav+=1; this._y+=_root.grav; while(_root.ground.hitTest(_x,_y,true)){ _y--; _root.grav=0; } if(Key.isDown(Key.UP)&&_root.ground.hitT est(_x,_y+3,true)&&_root.attack==false){ _root.grav=-15; } if(_root.grav>15){ _root.grav=15; } //MOVEMENT SCRIPT this._x+=_root.xmove; if(Key.isDown(Key.LEFT)){ _root.xmove-=1.1; _xscale=-100; } if(Key.isDown(Key.RIGHT)){ _root.xmove+=1.1; _xscale=100; } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&_root.xmove>0){ _root.xmove-=2; } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&_root.xmove<0){ _root.xmove+=2; } if(_root.xmove>0&&_root.xmove<1.1||_root .xmove<0&&_root.xmove>-1.1){ _root.xmove=0; } if(_root.xmove>1&&_root.xmove<2&&!Key.is Down(Key.RIGHT)){ _root.xmove=0; } if(_root.xmove>10){ _root.xmove=10; } if(_root.xmove<-10){ _root.xmove=-10; } //DISPLAY SCRIPT if(!_root.xmove==0){ _root.attack=false; } if(_root.airatk==false&&!_root.ground.hi tTest(_x,_y+3,true)){ this.gotoAndStop(5); } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&!_root.xmove==0&&_root.ground.
hitTest(_x,_y+3,true)){ this.gotoAndStop(3); } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&_root.xmove==0&&!Key.isDown(65 )&&_root.attack==false&&_root.ground.hit Test(_x,_y+3,true)){ this.gotoAndStop(1); } if(_root.ground.hitTest(_x,_y+3,true)&&_
root.attack==false&&Key.isDown(Key.LEFT)
){ this.gotoAndStop(2); } if(_root.ground.hitTest(_x,_y+3,true)&&_
root.attack==false&&Key.isDown(Key.RIGHT )){ this.gotoAndStop(2); } //ATTACK SCRIPT if(Key.isDown(65)&&_root.xmove==0&&_root .ground.hitTest(_x,_y+3,true)){ this.gotoAndStop(4); _root.attack=true; } if(Key.isDown(65)&&!_root.ground.hitTest (_x,_y+3,true)){ this.gotoAndStop(6); _root.airatk=true; } if(!Key.isDown(65)){ _root.airatk=false; } } onClipEvent(enterFrame) { if(_root.player.hitTest(_root.portal)) { nextFrame() } } onClipEvent(enterFrame){ if (_root.this.hitTest(_root.ground){ (_x,_y,true)){ this.gotoAndStop(1); } }

look at it and visit my pofile

BBS Signature

None

Jawdyn

Reply To Post Reply & Quote

Posted at: 10/18/09 04:15 PM

Jawdyn LIGHT LEVEL 25

Sign-Up: 05/15/07

Posts: 3,664

At 10/18/09 04:05 PM, lgnxhll wrote: sorry for triple post but hears some code and all i need is them too fix the ground hittesting cause it doesent work very well dont do anything else too it
ive got everything set up right but the ground hittest wont work help heer it is send it back when you can thanks

Bro, put your code inside code tags god dammit! =P

CODE IN HERE

remove the spaces from tags though.

onClipEvent(load){ _root.grav=0; _root.xmove=0; _root.attack=false; _root.airatk=false; } onClipEvent(enterFrame){ //CEILING SCRIPT while(_root.ceiling.hitTest(_x,_y-25,tru e)&&_root.grav<0){ _root.grav++; } //WALL SCRIPT while(_root.wall.hitTest(_x+117,_y,true)
&&_root.xmove>0){ _root.xmove--; } while(_root.wall.hitTest(_x-17,_y,true)&
&_root.xmove<0){ _root.xmove++; } //GRAVITY SCRIPT _root.grav+=1; this._y+=_root.grav; while(_root.ground.hitTest(_x,_y,true)){ _y--; _root.grav=0; } if(Key.isDown(Key.UP)&&_root.ground.hitT est(_x,_y+3,true)&&_root.attack==false){ _root.grav=-15; } if(_root.grav>15){ _root.grav=15; } //MOVEMENT SCRIPT this._x+=_root.xmove; if(Key.isDown(Key.LEFT)){ _root.xmove-=1.1; _xscale=-100; } if(Key.isDown(Key.RIGHT)){ _root.xmove+=1.1; _xscale=100; } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&_root.xmove>0){ _root.xmove-=2; } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&_root.xmove<0){ _root.xmove+=2; } if(_root.xmove>0&&_root.xmove<1.1||_root .xmove<0&&_root.xmove>-1.1){ _root.xmove=0; } if(_root.xmove>1&&_root.xmove<2&&!Key.is Down(Key.RIGHT)){ _root.xmove=0; } if(_root.xmove>10){ _root.xmove=10; } if(_root.xmove<-10){ _root.xmove=-10; } //DISPLAY SCRIPT if(!_root.xmove==0){ _root.attack=false; } if(_root.airatk==false&&!_root.ground.hi tTest(_x,_y+3,true)){ this.gotoAndStop(5); } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&!_root.xmove==0&&_root.ground.
hitTest(_x,_y+3,true)){ this.gotoAndStop(3); } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&_root.xmove==0&&!Key.isDown(65 )&&_root.attack==false&&_root.ground.hit Test(_x,_y+3,true)){ this.gotoAndStop(1); } if(_root.ground.hitTest(_x,_y+3,true)&&_
root.attack==false&&Key.isDown(Key.LEFT)
){ this.gotoAndStop(2); } if(_root.ground.hitTest(_x,_y+3,true)&&_
root.attack==false&&Key.isDown(Key.RIGHT )){ this.gotoAndStop(2); } //ATTACK SCRIPT if(Key.isDown(65)&&_root.xmove==0&&_root .ground.hitTest(_x,_y+3,true)){ this.gotoAndStop(4); _root.attack=true; } if(Key.isDown(65)&&!_root.ground.hitTest (_x,_y+3,true)){ this.gotoAndStop(6); _root.airatk=true; } if(!Key.isDown(65)){ _root.airatk=false; } } onClipEvent(enterFrame) { if(_root.player.hitTest(_root.portal)) { nextFrame() } } onClipEvent(enterFrame){ if (_root.this.hitTest(_root.ground){ (_x,_y,true)){ this.gotoAndStop(1); } }

if i ignored you, it's probably because you're gay
if i replied to you, it's probably because i felt the need to tell you that you're gay

BBS Signature

None

Jawdyn

Reply To Post Reply & Quote

Posted at: 10/18/09 04:17 PM

Jawdyn LIGHT LEVEL 25

Sign-Up: 05/15/07

Posts: 3,664

At 10/18/09 04:15 PM, Jawdyn wrote: remove the spaces from tags though.

Urgh, spaces still made it work.

Replace the brackets [ + ] with < + >

[code] [/code]

if i ignored you, it's probably because you're gay
if i replied to you, it's probably because i felt the need to tell you that you're gay

BBS Signature

None

lgnxhll

Reply To Post Reply & Quote

Posted at: 10/18/09 04:29 PM

lgnxhll EVIL LEVEL 05

Sign-Up: 06/24/09

Posts: 436

errors fix please
Syntax error.hitTest(_x,_y+3,true)){ this.gotoAndStop(3); } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&_root.xmove==0&&!Key.isDown(65 )&&_root.attack==false&&_root.ground.hit Test(_x,_y+3,true)){ this.gotoAndStop(1); } if(_root.ground.hitTest(_x,_y+3,true)&&_

Statement must appear within on/onClipEvent handler&&_root.xmove>0){ _root.xmove--; } while(_root.wall.hitTest(_x-17,_y,true)&

Unexpected '&' encountered&_root.xmove<0){ _root.xmove++; } //GRAVITY SCRIPT _root.grav+=1; this._y+=_root.grav; while(_root.ground.hitTest(_x,_y,true)){ _y--; _root.grav=0; } if(Key.isDown(Key.UP)&&_root.ground.hitT est(_x,_y+3,true)&&_root.attack==false){ _root.grav=-15; } if(_root.grav>15){ _root.grav=15; } //MOVEMENT SCRIPT this._x+=_root.xmove; if(Key.isDown(Key.LEFT)){ _root.xmove-=1.1; _xscale=-100; } if(Key.isDown(Key.RIGHT)){ _root.xmove+=1.1; _xscale=100; } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&_root.xmove>0){ _root.xmove-=2; } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&_root.xmove<0){ _root.xmove+=2; } if(_root.xmove>0&&_root.xmove<1.1||_root .xmove<0&&_root.xmove>-1.1){ _root.xmove=0; } if(_root.xmove>1&&_root.xmove<2&&!Key.is Down(Key.RIGHT)){ _root.xmove=0; } if(_root.xmove>10){ _root.xmove=10; } if(_root.xmove<-10){ _root.xmove=-10; } //DISPLAY SCRIPT if(!_root.xmove==0){ _root.attack=false; } if(_root.airatk==false&&!_root.ground.hi tTest(_x,_y+3,true)){ this.gotoAndStop(5); } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&!_root.xmove==0&&_root.ground.

Unexpected '&&' encountered&&_root.xmove>0){ _root.xmove--; } while(_root.wall.hitTest(_x-17,_y,true)&

look at it and visit my pofile

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 09:12 PM

<< Back

This topic is 286 pages long. [ 1141280 | 281 | 282 | 283 | 284 | 285 | 286 ]

<< < > >>
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!