Making the character turn

For questions about using Classic.

Post » Sat Jan 12, 2008 12:38 pm

Hi, I was wondering how you would make the player look left and right with platform movement.
B
4
S
2
G
4
Posts: 164
Reputation: 2,178

Post » Sat Jan 12, 2008 1:20 pm

Make a sprite that is your character, but looking at the opposite way. Then go to the event sheet, and make it so when you press the button, it won't only move the character, but change it's sprite too.
e.g.:
you press right, the character looks right.
you press left, the character looks left.
B
1
G
4
Posts: 4
Reputation: 1,033

Post » Sat Jan 12, 2008 1:33 pm

I'm new to construct could you explain it a bit more and how would I copy a sprite but not change if I change a different one
B
4
S
2
G
4
Posts: 164
Reputation: 2,178

Post » Sat Jan 12, 2008 4:23 pm

In the Animator bar when the Sprite is selected, you can add animation angles - there'll be a default one for 0 degrees, which is facing right. If you add one for 180 degrees, that'll automatically show whenever your character is facing left.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Sat Jan 12, 2008 9:16 pm

Ashley that doesn't work for me.
B
4
S
2
G
4
Posts: 164
Reputation: 2,178

Post » Sun Jan 13, 2008 11:03 am

[quote="Ashley":3saf05zp]In the Animator bar when the Sprite is selected, you can add animation angles - there'll be a default one for 0 degrees, which is facing right. If you add one for 180 degrees, that'll automatically show whenever your character is facing left.[/quote:3saf05zp]
For me they seem to loop all the time...
B
1
G
4
Posts: 4
Reputation: 1,033

Post » Sun Jan 13, 2008 4:37 pm

If you take a look at the .cap for Phys-Box you can see how I've done it.

Create a new animation and add the angle 0 degrees to it. Call it "WalkLeft" for this example.

Add your left-facing frames to WalkLeft. Add your right-facing framed to Default.

Now add an event, so that when he changes directions (on your key press is a good place to put it) from right to left, add "Set Animation - WalkLeft". To the event for changing left to right, add "Set Animation - Default". Ensure that they are separate animations, and that WalkLeft is not a sub-animation of Default (I am unable to reference sub-animations, I do not know if this is a bug or if I'm simply doing it wrong).
B
3
S
2
G
4
Posts: 130
Reputation: 1,735

Post » Sun Jan 13, 2008 6:55 pm

I now wondering how to not make him walk while not moving
B
4
S
2
G
4
Posts: 164
Reputation: 2,178

Post » Sun Jan 13, 2008 8:28 pm

Ok now my sprite only fires a bullet one way is there any way to make him fire left and right.
B
4
S
2
G
4
Posts: 164
Reputation: 2,178

Post » Sun Jan 13, 2008 9:43 pm

Perhaps you should take a long, hard look at the logic of your event code.

Or share it so we know what is going on.
B
4
S
2
G
6
Posts: 161
Reputation: 2,597

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests