How do I stop my sprite rotating on start

Get help using Construct 2

Post » Wed Oct 22, 2014 2:07 am

I am making a TD game and I have enemies spawning at the top left of the screen. They spawn facing the right direction but immediately rotate 90 degrees before they start to move. I know there has to be a quick fix but I cant find it. Please help. Thanks.
B
3
Posts: 8
Reputation: 191

Post » Wed Oct 22, 2014 3:51 am

Yes there is. Open each one up in the internal sprite editor (aka double click them) and change their rotation using the little tools on top and rotate them 90 degrees.
The "front" of a sprite (ie. 0 degrees) is the right hand side.

If this doesn't fix it, make sure your not setting an angle somewhere or changing a frame if it has animation.

If that is not the case attach your .capx file and it should be easy to locate the problem.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
65
S
17
G
8
Posts: 636
Reputation: 9,333

Post » Wed Oct 22, 2014 3:58 am

Thanks for the reply. I wish is was that simple. When my spawn point is on the top of the map, my enemy will rotate 90 degrees no matter what before he starts to move. I made it so that it makes him face the right direction but the rotating is still visible on the screen. I don't want to see it rotating before it starts to move.

When I place my spawn point on the left side of the screen it will allow my enemy to stay facing the correct direction (the direction I rotated it to) and it proceeds through the path correctly.

Why does C2 want to rotate my enemy when he spawns at the top but not when he spawns on the left?
B
3
Posts: 8
Reputation: 191

Post » Wed Oct 22, 2014 4:02 am

Hmm without seeing the .capx its tough to guess. One option if its seeing the rotation that bothers you would be to wait a second before making them visible.
In my space shooter the enemies come from the right side, I flipped all my sprites to get it to work right rather than changing their facing via code.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
65
S
17
G
8
Posts: 636
Reputation: 9,333

Post » Wed Oct 22, 2014 8:44 am

You can add at start of layout set angel sprite 0 or 270 or 180 or something else
B
245
S
39
G
15
Posts: 1,944
Reputation: 40,252

Post » Wed Oct 22, 2014 6:25 pm

I'll let you guys know when I get home from work if your ideas worked. Thanks for the replies.
B
3
Posts: 8
Reputation: 191

Post » Thu Oct 23, 2014 1:56 am

I tried the start of layout set angel to multiple degrees but there was no effect at all. My sprites are facing the correct direction before I run the game. The path finding behavior rotates it 90 degrees before the sprite starts to move.

This doesn't happen when I start my sprite at the left of the screen. Only at the top of the screen. If I set it at the top and have it facing south it will rotate 90 degree to the right (pointed west) and then proceed through the path sideways. So I have it faced 90 to the right so that when it rotates 90 to the left it makes it point in the correct direction of travel which is south.

If I place the sprite spawn point at the west side of the layout and point it east it will not rotate. It will travel through the path properly.

I guess I need to know why this does this and if it can be fixed. More complicated then I had thought.
B
3
Posts: 8
Reputation: 191

Post » Thu Oct 23, 2014 3:42 am

If the path finding behavior is rotating the sprite to face along the path you will need to manually change its facing angle.

If you attach a capx. we can probably solve this for you in no time.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
65
S
17
G
8
Posts: 636
Reputation: 9,333

Post » Thu Oct 23, 2014 4:17 am

attach a capx please let's see if I can help you otherwise I am sorry cannot help
B
245
S
39
G
15
Posts: 1,944
Reputation: 40,252

Post » Fri Oct 24, 2014 1:34 am

I attached the capx. I pretty much just changed almost everything from an example capx that I have been messing around with. If you move the spawn point from the top of the layout to the side, the tank wont rotate before moving. But if you leave it where I have it you will see that it rotates 90 before it moves. Thanks for the help guys.
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 8
Reputation: 191

Next

Return to How do I....?

Who is online

Users browsing this forum: stevenode and 9 guests