Forum Topic: Action script problem

(263 views • 6 replies)

This topic is 1 page long.

<< < > >>
Angry

SoulOfDarkness

Reply To Post Reply & Quote

Posted at: 8/27/05 05:38 AM

SoulOfDarkness DARK LEVEL 16

Sign-Up: 02/05/05

Posts: 123

i'm making a minigame , and i it there is 3 positions UP, MIDDLE, and DOWN.
this script should work but it doesnt:
onClipEvent (load) {
stand = true;
jump = false;
lay = false;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
if (stand=true) {
_root.the.gotoAndPlay("h");
jump = true;
stand = false;
lay = false;
}
if (lay=true) {
_root.the.gotoAndStop("m");
jump = false;
stand = true;
lay = false;
}
if (jump=true) {
}
}
if (Key.isDown(Key.DOWN)) {
if (stand=true) {
_root.the.gotoAndPlay("l");
jump = false;
stand = false;
lay = true;
}
if (jump=true) {
_root.the.gotoAndStop("m");
jump = false;
stand = true;
lay = false;
}
if (lay=true) {
}
}
}

note : "h" - is the frame where the character is up,
"m" - is in the middle
"l" - is down

what's wrong?


None

Go0gley

Reply To Post Reply & Quote

Posted at: 8/27/05 05:40 AM

Go0gley LIGHT LEVEL 19

Sign-Up: 07/08/04

Posts: 218

You need to use strict equality (==) for IF functions.


Questioning

MpT

Reply To Post Reply & Quote

Posted at: 8/27/05 06:50 AM

MpT LIGHT LEVEL 05

Sign-Up: 07/19/05

Posts: 2

Do you made a ground from where to jump???


Happy

MpT

Reply To Post Reply & Quote

Posted at: 8/27/05 06:56 AM

MpT LIGHT LEVEL 05

Sign-Up: 07/19/05

Posts: 2

Try this script:

onClipEvent (load) { moveSpeed = 10;}onClipEvent (enterFrame) { if (Key.isDown(Key.RIGHT)) { this._x += moveSpeed; } else if (Key.isDown(Key.UP)) { this._y -= 0; } else if (Key.isDown(Key.DOWN) && !fall) { this._y += 0; } else if (Key.isDown(Key.LEFT)) { this._x -= moveSpeed; }}onClipEvent (enterFrame) { if (Key.isDown(Key.SPACE) && !jumping) { vel_y = 36; jumping = true; } if (jumping == true) { vel_y -= 2; if (vel_y<=-15) { vel_y = -15; } this._y -= vel_y; } if (_root.ground.hitTest(this._x, this._y+35, true)) { vel_y = 0; jumping = false; }}onClipEvent (enterFrame) { this._y += 16; if (_root.ground.hitTest(this._x, this._y+1, true)) { this._y -= 16; }}

Give the ground instance: ground


None

Paranoia

Reply To Post Reply & Quote

Posted at: 8/27/05 07:03 AM

Paranoia DARK LEVEL 31

Sign-Up: 04/22/05

Posts: 9,119

At 8/27/05 06:56 AM, DMXtreme wrote: Try this script:

stuff

Eugh! Nasty!

A rate of change in sanity with respect to time.

BBS Signature

Happy

SoulOfDarkness

Reply To Post Reply & Quote

Posted at: 8/27/05 07:25 AM

SoulOfDarkness DARK LEVEL 16

Sign-Up: 02/05/05

Posts: 123

thanks, ur the only one who understanded me


None

Nitrocity

Reply To Post Reply & Quote

Posted at: 8/27/05 07:12 PM

Nitrocity LIGHT LEVEL 08

Sign-Up: 07/19/05

Posts: 62

At 8/27/05 07:25 AM, alexTar wrote: understanded

With English like that I'm not surprised...


All times are Eastern Standard Time (GMT -5) | Current Time: 11:13 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!