How do I rotate a shield to fixed positions

Get help using Construct 2

Post » Fri Mar 07, 2014 7:19 am

Message: skozax can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hello,

Yesterday, I posted this: viewtopic.php?f=147&t=97937

It was about creating a shield that can be controlled around the player.

Now, I would like to know, when the shield rotates around the player I want it to go only to fixed positions left, right and up.
How is this possible?

Thank You

PS: I am new to these forums and I don't know if I have to post on the old one again, or create a new one.
@coyowl

coyowl.com

Game studio with a portfolio of 3 Apple Featured games.
B
31
S
7
G
2
Posts: 111
Reputation: 2,417

Post » Fri Mar 07, 2014 7:23 am

Add a variable to the shield called "direction"

Every tick
Set "direction" to angle(shield.x, shield.y, mouse.x, mouse.y)
Shield set angle to round(shield.direction/90)*90
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Fri Mar 07, 2014 7:30 am

It didn't work.

Those are my shield events
You do not have the required permissions to view the files attached to this post.
@coyowl

coyowl.com

Game studio with a portfolio of 3 Apple Featured games.
B
31
S
7
G
2
Posts: 111
Reputation: 2,417

Post » Fri Mar 07, 2014 7:36 am

You have another event just below also changing the angle of the shield
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Fri Mar 07, 2014 7:48 am

Thanks this worked!

One last request, how can I disable the direction that goes down?
@coyowl

coyowl.com

Game studio with a portfolio of 3 Apple Featured games.
B
31
S
7
G
2
Posts: 111
Reputation: 2,417


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, R0J0hound, trance, yiuyiu6666 and 4 guests