View Full Version : Help with my game
I'l try to make this as clear as I can.
I need to make my mc fly. From frame 1 to frame 13 is my mc floating, frame 14 is my mc flying right and frame 15 is my mc flying left.This is my code inside the mc:
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
gotoAndStop(14);
this._x += 20;
}
}
if (Key.isDown(Key.LEFT)) {
gotoAndStop(15);
this._x -= 20;
}
if (Key.isDown(Key.UP)) {
this._y -= 20;
}
if (Key.isDown(Key.DOWN)) {
this._y += 20;
}
}
My mc floats before I press any buttons. When I press left or right my mc flies to left or right, but when I release any buttons i've pressed the mc doesint go back to frame 1. I've tried:
If (!Key.isDown(Key.RIGHT) & !key.isDown(Key.LEFT)){
gotoAndPlay(1);
}
But then it just goes to frame 1 and stops. I want it to go to frame 1 and play until frame 13.In frame 13 I have gotoAndPlay(1).
tatorhead
06-17-2005, 03:53 AM
add a gotoAndPlay(1) onto frame 13\
edit: wait nevermind, i didnt read that right.
edit2: maybe try putting a play() in frame one
already tried uting a play(); i'm not stupid :P
add a gotoAndPlay(1) onto frame 13\
this whould do perpectly... if it whould work...
please do not double post
my bad...well youre post wasint at all helpful.
i can help you, but since your a stupid n00b and too lazy to search, im not helping
WTF? **** you ass hole! I always thought that youe a nice guy, but now BITE ME!
lui, that was a bit uncalled for, ill be honest i doubt you actually help him
and o moto, there was no reason for swearing.
ok i'm sorry... Hope lui apologises... SO can anyone help me?
Freddy
06-17-2005, 07:35 AM
squeeze in some 'else's.
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
gotoAndStop(14);
this._x += 20;
}else if(Key.isDown(Key.LEFT)) {
gotoAndStop(15);
this._x -= 20;
}else if (Key.isDown(Key.DOWN)) {
this._y += 20;
}else if(Key.isDown(Key.UP)) {
this._y -= 20;
}else{
gotoAndPlay(1);
}
}
Try that. Im not 100% sure it will work since I didnt try this out myself.
Its worth a shot though.
tatorhead
06-17-2005, 10:41 AM
i can help you, but since your a stupid n00b and too lazy to search, im not helping
oh, he's too lazy to search? lol
Homakruz
06-17-2005, 11:04 AM
Im at school right now but ill be home in 10 mins or so, so i might be able to help you then... until then, lui your one to talk.... trying to have me give you my hittest coding cause your to LAZY to use the internet and search for the a basic tutorial, hmmm ... the one on kirupa basically told me what to do.
K i got home and did some work... didnt take too long lol
is this what you want??
http://img133.echo.cx/my.php?image=motohelp5wz.swf
Shadow I've tried using }else{ before I posted in forum and it doesint help. And homa... now it floats when i move right or left, but i want it to float when i'm not moving anywhere...
Homakruz
06-18-2005, 12:20 PM
Hmmm... so basically the opposite of what i did?.... When your moving, no floating. Otherwise float if you not.... sec ill fix it :) lol
WOOHOO I finaly done it! :D I only used 3 frames. In the first frame I put in another mc witch has the floating animation.Frame 2 is moviong right and frame 3 is moving left. And the code was:
onClipEvent(enterFrame){
if(Key.isDown(Key.RIGHT)){
this._x+=20
gotoAndStop(2);
}else{
gotoAndStop(1);
}
if(Key.isDown(Key.LEFT)){
this._x-=20
gotoAndStop(3);
}else{
gotoAndStop(1);
}
if(Key.isDown(Key.UP)){
this._y-=20
}
if(Key.isDown(Key.DOWN)){
this._y+=20
}
if(Key.isDown(Key.RIGHT) & !Key.isDown(Key.LEFT)){
gotoAndStop(2);
}
if(Key.isDown(Key.LEFT) & !Key.isDown(Key.RIGHT)){
gotoAndStop(3);
}
}
Homakruz
06-19-2005, 07:23 AM
lol that is the same thing i did lol just didnt have time to post it ... :P guess illl delete the file now
x-stick
06-19-2005, 09:45 AM
what's the game your making called? or it's not a game,then what is it
Its not called anything yet :D first i gota finish it.
vBulletin® v3.7.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.