Prevent sprites from flipping when going up and down.

Get help using Construct 2

Post » Thu Aug 11, 2016 1:49 am

I got the movement down for sprites. Up down, left right. Left to right a sprite is fine. But going up and down, the Sprite flips on its side...I messed around with set angle in the properties and set angle in the code itself, but it always flips when going up and down.

Set Angle yes gets it to move down, but it's turned on its side.

Any help would be appreciated.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Thu Aug 11, 2016 5:52 am

Phoenixbowman wrote:I got the movement down for sprites. Up down, left right. Left to right a sprite is fine. But going up and down, the Sprite flips on its side...I messed around with set angle in the properties and set angle in the code itself, but it always flips when going up and down.

Set Angle yes gets it to move down, but it's turned on its side.

Any help would be appreciated.



Are you using platform behavior or 8 directions? if is 8 direction behavior check its settings at left site were says "angle" and set it to no probably you had the 360 angle
B
38
S
22
G
62
Posts: 231
Reputation: 35,050

Post » Fri Aug 12, 2016 2:05 am

I am using the Bullet behavior because I want the sprites to move automatically. Might the 8 direction behavior work better?

I tried set bullet speed to 180 and it moves, but it goes across the screen. Angle is set to no in bullet behavior. I have Simulate press down but it's going across the screen. Simulate press down and it moves to the right. Simulate Down means down...but the sprite moves to the right.

Now i got rid of bullet, set acceleration and max speed to 180, set Simulate Down and the sprite is just staying in one spot.

Is there a way with the bullet behavior to make the Sprite so it wont flip when it moves up and down?

PS: I did set Flipped, now it's still sideways...but flipped. The top down space shooter sprites arent flipped when they're dropping down,t he one that comes with construct 2. What's wrong? :(
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Fri Aug 12, 2016 4:05 am

Problem solved! I duplicated the Sprite, but rotated the sprite in the Sprite editor 90 degrees to the left.

Basically, Bullet Behavior set angle is Yes. In the actual code, Set angle to change direction. Make sure you have Bullet speed set.

0 degrees moves Left to Right
-180 degrees moves Right to Left
90 degrees moves Up to Down
-90 degrees moves Down to Up
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Fri Aug 12, 2016 8:11 am

cool, nice to hear that, well done m8,
B
38
S
22
G
62
Posts: 231
Reputation: 35,050

Post » Fri Aug 12, 2016 8:19 am

Yes the "default" direction (angle 0) for any sprite is facing to the right. If you create your sprite facing any other direction to this, then it won't move facing the direction you want it to. :)

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish, Nicolas951, tarek2 and 6 guests