-
(Swish1)This is making me mad...(Game Help)
So I have no clue whats going on with this. I left Swish and just came back and am having trouble with my sprites.
Okay,
For some reason, not only do my sprites not get read (they can't be found when I use _root.Sprite), But when I am trying to move them left and right (the character sprites) it just isn't working. They slide, they don't animate. I have no f - ing clue why the hell it won't work. This is the basic idea of my code on my characters I am trying to move.
if (Key.IsDown (Key.D)) {
gotoAndPlay(20);
_x += 4;
} else {
gotoAndPlay(15);
Basically...this code which is on my character sprite says when they key "D" is down, it plays the frame which has a nested sprite animation of my character running right. Else, it will play the idle sprite (Frame 15).
Any ideas?
If you need more info. let me know.
Thanks in advance,
WeiseGuy
-
I decided to post some more of my script. This is what I am talking about when the program isn't reading "_root.Tetris" or any of my sprites in general. Basically, when the scene loads, on the sprite is says gotoAndPlay(1), which is the frame where my nested sprite for an idle animation is placed. When you press "A" or "D," etc. it plays frame(_) which is the frame where the animation for running in that direction is placed. For some reason it isn't running the sprite when it goes to the frame and it can't reference _root.Tetris (or whatever else my sprite may be named).
onEnterFrame(includingFirstFrame) {
// If player 1 or Player 2 is Tetris (3)
if (_root.P1 == 3 or _root.P2 == 3) {
_visible = True;
}
//Player 1 is Tetris
if (_root.P1 == 3) {
//Movement
//Move Right
if (Key.IsDown (Key.D)) {
gotoAndPlay(65);
_x += 4;
} else {
gotoAndPlay(45);
}
//Move Left
if (Key.IsDown (Key.A)) {
gotoAndPlay(20);
_x -= 4;
} else {
gotoAndPlay(1);
}
}
Any ideas?
-
Is there any other info I can provide to help you help me?
-
Well, coming up to 100 views. Is there any other information I can provide to help you help me? I really need to solve this, I've halted development for 2 weeks now.
-
Could be many things. How do you feel about posting the file to look at?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|