PDA

View Full Version : uhhm......


Bunzing
06-04-2002, 06:13 AM
i have this so far:

onClipEvent (load) {
speed = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)) {
_x -= speed;
_rotation = 270;
}
if (Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT)) {
_x += speed;
_rotation = 90;
}
if (Key.isDown(Key.UP) && !Key.isDown(Key.DOWN)) {
_y -= speed;
_rotation = 0;
}
if (Key.isDown(Key.DOWN) && !Key.isDown(Key.UP)) {
_y += speed;
_rotation = 180;
}
}

and this worx all hunky-dory. i have an instance called 'beetle' on stage with the above code on it. then i have an instance called 'wall' on stage. when the beetle hits the wall, i want the movie to go to the next scene. now i know has something to do with hittest, but i can't figure that one out...i am very stupid, so please explain in words even i can understand. thanx!

White Leviahan
06-04-2002, 07:08 AM
i never made anything like this but i'd find out where your wall is, like 300 px from the left side of the flash movie, or something like that, and have add to your:

if (Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT)) {
_x += speed;
_rotation = 90;
}

code to check after it add the speed if _x is now on or past the wall like:

if (Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT)) {
_x += speed;
_rotation = 90;
If (_x >= _where-ever-the-wall-is-on-the-x-axis_) {
_goto next scene_
}
}

my best guess..

oh! and please use better thread titles -_-, "uhhm......" isn't very helpfull =)

farafiro
06-04-2002, 07:23 AM
well, may I first ask y u r using the NOT EQ sign here ??

then u need to ADD this code to your onClipEvent (enterFrame)
onClipEvent (enterFrame) {
if(this.hitTest(_root.wall)){
_root.gotoAndPlay("scene2","frameLable")
}
}
also look for a movie called "SPIDER" in the movies section it may helps you

Bunzing
06-04-2002, 07:27 AM
so, that would be:

if (Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)) {
_x -= speed;
_rotation = 270;
if (_x<=15) {
gotoAndStop("Scene 2", 1);
}
}
that doesn't work...................................

farafiro
06-04-2002, 07:40 AM
????
who told u to do that??

Bunzing
06-04-2002, 07:43 AM
white leviathan
i have this now:

onClipEvent (load) {
speed = 5;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.wall)) {
_root.gotoAndPlay("scene 2", "start");
}
if (Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)) {
_x -= speed;
_rotation = 270;
}
if (Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT)) {
_x += speed;
_rotation = 90;
}
if (Key.isDown(Key.UP) && !Key.isDown(Key.DOWN)) {
_y -= speed;
_rotation = 0;
}
if (Key.isDown(Key.DOWN) && !Key.isDown(Key.UP)) {
_y += speed;
_rotation = 180;
}
}
i am guessing frameLabel is refering to a label on scene 2
anyway, it doesn't do the trick.....what am i doing wrong???

Bunzing
06-04-2002, 11:09 AM
thanx ya'll....i got it working now..........