-
[HELP] Rotation...?
My movie clip's rotation is very, very choppy. I have the character being able to walk, and then I inserted the rotation code into the mix. When I try to turn, it "rotates" my character to another part on the screen just a little bit away, rather than rotating him on the spot where he is. I have the white center dot placed at his center (which was easy, since I'm using a circle with an arrow on his head for this test), but it still skips him a bit away.
Any suggestions on how to fix this problem? Here's the [very basic] code, if anyone needs it in order to help me:
onClipEvent (load) {
s = 5;
}
onClipEvent (enterFrame) {
if(Key.isDown(Key.RIGHT)) {
_rotation = 90;
_x += s;
}
if(Key.isDown(Key.LEFT)) {
_rotation = 270;
_x -= s;
}
if(Key.isDown(Key.UP)) {
_rotation = 0;
_y -= s;
}
if(Key.isDown(Key.DOWN)) {
_rotation = 180;
_y += s;
}
if(Key.isDown(Key.UP) and Key.isDown(Key.RIGHT)) {
_rotation = 45;
}
if(Key.isDown(Key.UP) and Key.isDown(Key.LEFT)) {
_rotation = 315;
}
if(Key.isDown(Key.DOWN) and Key.isDown(Key.RIGHT)) {
_rotation = 135;
}
if(Key.isDown(Key.DOWN) and Key.isDown(Key.LEFT)) {
_rotation = 225;
}
}
-
Amiga freak
Are you sure your character are in the center of the MC?. Seems like he's not.
-
I'm not quite sure what you're asking, unless you're talking about the white center dot.
Here's what other information I can tell you: I have the white center dot in the middle, which I can confirm because when I manually free transform him in the .fla rather than try to use the arrow keys in the final .swf product, it can do a 360 turn rather than a space-skipping circle like the kind it does in the .swf with the arrow keys.
If that was incoherent (which it may have been xD):
.fla + manual rotation = smooth 360
.swf + arrow keys using the code = choppy skips, forming a circle if I do them in order.
-
Of course, there is that little black "+" sign in the upper left hand corner of the symbol, could that be the problem that I have to move? I don't know how to move that, if that's it.
-
Amiga freak
Yes... the + is the center of the MC.. so if you dont have your char in the center of that, the things you say happen, happens...
which was what I was saying.. center the char.... so the + is in the middle of him.
-
Oh, thanks! Works perfect now, thanks a bunch =)
-
Amiga freak
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
|