How do I a Target System?

Get help using Construct 2

Post » Thu Jul 02, 2015 9:04 pm

I'm trying to create a target system. Pressing the A key, an icon appears on the monster and every time you press the F to punch action. The character must look in the direction of the target. Using behavior 4 direction.

I tried this way did not work.

Image

Can someone help me? :?
B
6
Posts: 15
Reputation: 287

Post » Fri Jul 03, 2015 5:13 am

Not sure if its the core of the problem, but I thought compare angles needed to have the low number first.

ie is between 45 and 135 degrees.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Fri Jul 03, 2015 12:31 pm

No, this is not the real problem. I've tried every way with this example showed.But it does not work, just turn to one side.

I need to know if there's another way.
B
6
Posts: 15
Reputation: 287

Post » Fri Jul 03, 2015 12:38 pm

Well, you could use:


enemy.X > player.X enemy is to the right of the player

enemy.X < player.X enemy is to the left of the player
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Fri Jul 03, 2015 12:45 pm

Thanks, i will try. *---*
B
6
Posts: 15
Reputation: 287

Post » Fri Jul 03, 2015 12:58 pm

My game has 8 Directions. This does not work, but thanks.
B
6
Posts: 15
Reputation: 287

Post » Fri Jul 03, 2015 7:39 pm

Up.

Can anyone tell me a way to make the character turn to a place immediately and without help control the keyboard. I can continue the work. Please.
B
6
Posts: 15
Reputation: 287

Post » Sat Jul 04, 2015 3:19 am

ShiinxD wrote:Up.

Can anyone tell me a way to make the character turn to a place immediately and without help control the keyboard. I can continue the work. Please.


If you are using a sprite for your targeting icon, you can use the action "set angle towards position" and then for the X and Y positions type in "TargetingIcon.x" and "TargetingIcon.y" where "TargetingIcon" is the name of your sprite.
B
8
S
2
Posts: 35
Reputation: 572

Post » Sat Jul 04, 2015 4:35 am

When you use this code your player instead of looking to the south, north, east or west. It spins like being inside of a tractor wheel.
B
6
Posts: 15
Reputation: 287

Post » Sat Jul 04, 2015 5:34 am

You're going to need to provide more details if you want help. Are you using the 8-direction behavior for the player? Have you got your targeting icon to work properly? Are you wanting to make your player face in the exact direction of the target, or just in one of 8 directions? Etc.
B
8
S
2
Posts: 35
Reputation: 572


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Casimir, tarek2 and 11 guests