-
It's not 1997 ?!
AS Directions
Ok, how would I go about making a character face left or right using actionscript?
I want to use the same frame sequence for both.
Man, I need a new signature.
-
Pumpkin Carving 2008
Code:
onEnterFrame = function() {
getKeys();
}
function getKeys() {
if(Key.isDown(Key.RIGHT)) {
char._xscale = 100;
char._x += 5;
} else if (Key.isDown(Key.LEFT)) {
char._xscale = -100;
char._x -= 5;
}
}
That's assuming your animation is facing to the right by default. If it is the reverse, swap "100" and "-100", and also swap "+=" and "-=".
The 'Boose':
ASUS Sabertooth P67 TUF
Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
8GB G.Skill Ripjaws 1600 DDR3
ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
New addition: OCZ Vertex 240GB SATA III SSD
WEI Score: 7.6
-
It's not 1997 ?!
That works for the foundation of what I'm trying to do, but as far as fine tuning goes, the transition is a bit rough.
Man, I need a new signature.
-
Pumpkin Carving 2008
You'll need to elaborate. You have a turning animation where the player turns from facing one direction and faces the other? If that's the case, yeah, it's a bit lacking. You really need to be less vague about specifically what you're trying to do before you get to the askin' part.
The 'Boose':
ASUS Sabertooth P67 TUF
Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
8GB G.Skill Ripjaws 1600 DDR3
ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
New addition: OCZ Vertex 240GB SATA III SSD
WEI Score: 7.6
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
|