Forum Topic: help with AS!!!

(48 views • 3 replies)

This topic is 1 page long.

<< < > >>
None

kickapkapk

Reply To Post Reply & Quote

Posted at: 9/4/05 07:30 PM

kickapkapk NEUTRAL LEVEL 12

Sign-Up: 07/04/05

Posts: 596

ok this is the AS i have for my character...

---------
onClipEvent (load) {
gravity = 10;
maxJump = 2;
scale = _xscale;
walkSpeed = 7;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_xscale = -scale;
_x -= walkSpeed;
this.gotoAndStop(2);
}
if (Key.isDown(Key.RIGHT)) {
_xscale = +scale;
_x += walkSpeed;
this.gotoAndStop(2);
}
}
onClipEvent (enterFrame) {
if (air == true) {
this._y += gravity;
}
if (this.hitTest(_root.platforms)) {
air = false;
} else {
air = true;
}
if (air == false) {
jump = false;
}
if (jump == false) {
air = false;
}
if (air == false) {
jump = true;
jumpcount = 0;
jumpSpeed = 22;
}
if (Key.isDown(Key.UP)) {
jumpcount += 1;
}
if (Key.isDown(Key.UP) && jump == true) {
_y -= jumpSpeed;
this.gotoAndStop(3);
}
if (jumpcount>maxJump && jumpSpeed>-2) {
jumpSpeed -= 2;
}
}
onClipEvent (keyUp) {
this.gotoAndStop(1);
}

------this is the code i have for my ground

-----------
onClipEvent(load) {
active = false;
this._visible = false;
this.onEnterFrame = function(){
if (this.hitTest(_root.player)) {
active = true;
} else {
active = false;
}
if (active) {
xmin = getBounds(_root).xMin;
xmax = getBounds(_root).xMax;
ymin = getBounds(_root).yMin;
ymax = getBounds(_root).yMax;
pymax = _root.player.body.getBounds(_root).yMax;
px = _root.player._x;
if (px<xmax and px>xmin and pymax<ymax and pymax>ymin and _root.player.grav<=0) {
_root.player.jumping = false;
_root.player.grav = 0;
} else {
_root.player.jumping = true;
}
}
}
}

--------
when i put the movie clip on the game twice only one works.
when i put to line in the platform movieclip the lines are longer than they show.... they go across the whole screen.

someone please help me with this(preferibly denvish)


None

Denvish

Reply To Post Reply & Quote

Posted at: 9/4/05 07:32 PM

Denvish DARK LEVEL 42

Sign-Up: 04/25/03

Posts: 15,933

At 9/4/05 07:30 PM, kickapkapk wrote: someone please help me with this(preferibly denvish)

I'm not the only one in this forum who knows AS, you know. Also, I'm drunk, and I can't be arsed analysing your code. Sorry.

- - Flash - Music - Report Abuse - -
Not around any more, see last news post.

BBS Signature

None

Diglet

Reply To Post Reply & Quote

Posted at: 9/4/05 07:33 PM

Diglet FAB LEVEL 08

Sign-Up: 07/24/05

Posts: 459

ugh i need this code to mine didnt work -.-

Best thread ever. Please bump it :(


None

SpamBurger

Reply To Post Reply & Quote

Posted at: 9/4/05 07:36 PM

SpamBurger NEUTRAL LEVEL 15

Sign-Up: 07/12/05

Posts: 4,620

At 9/4/05 07:32 PM, Denvish wrote:
At 9/4/05 07:30 PM, kickapkapk wrote: someone please help me with this(preferibly denvish)
I'm not the only one in this forum who knows AS, you know. Also, I'm drunk, and I can't be arsed analysing your code. Sorry.

Your always drunk... lol

"However, the game received only two orders, one of which Molyneux speculated was from his mother." -Peter Molyneux's first game The Entrepreneur


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

<< Back

This topic is 1 page long.

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