-
Bug? If so can I have some help?
I am trying to get collisions, but IF statements are giving me pain. Only the first 2 work, whichever those are. I've tryed switching them, and I've tried variables, but it doesn't work. Well, here's the mess:
if (pacman.up.hitTest (wall)) {
creatures["Pacman"]["Moving"] = "up";
}
else {
if (pacman.down.hitTest (wall)) {
creatures["Pacman"]["Moving"] = "down";
}
else {
if (pacman.left.hitTest (wall)) {
creatures["Pacman"]["Moving"] = "left";
}
else {
if (pacman.right.hitTest (wall)) {
creatures["Pacman"]["Moving"] = "right";
}
else {
creatures["Pacman"]["Moving"] = "all";
}
}
}
}
I also looked at a thing on switches, but they didn't seem like they would work... Any help?
-
-
It's hard to know what's happening without more code.
What I would do is add trace functions throuout this piece of code. This way you know which parts are exceuting and which aren't.
From that information, you'll be able to trace which functions are giving you an error.
-
-
there are some good introductory games writing tutorials here http://oos.moxiecode.com/ which should cover what you are trying to do.
Hope this helps.
-
-
Thanks. Tracing did help, but it wasn't script after all. I had movie clips for the sides of pacman, and it was them. It's fixed now. Also, I think I'll look at the tutorials.
-
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
Bookmarks