shooting game - aiming problem

Get help using Construct 2

Post » Tue Mar 19, 2013 5:55 pm

Hi every one! Im trying to make a simple shooting game and encounetered an early poblem. I want the weapon to point where the mouse is pointing. So i want the "character" sprite to turn around when the mouse is "behind" him. If you can check the game Shotgun Fun Fun, thats exactly what i want to do.


This is everything i've done yet:
https://www.dropbox.com/s/4xcf1gt6k9mpzxz/DHM.capx
B
7
S
1
Posts: 14
Reputation: 753

Post » Tue Mar 19, 2013 6:02 pm

Check if the angle of the gun is between 90 and 270. If so, set your sprite to the "mirrored" state. "Not mirrored" state otherwise.
B
46
S
17
G
18
Posts: 847
Reputation: 13,802

Post » Tue Mar 19, 2013 6:06 pm

How do i "check" it :)
B
7
S
1
Posts: 14
Reputation: 753

Post » Tue Mar 19, 2013 6:19 pm

Check the condition of your "Sprite2". There is one named "Is between angles" under the Angle group.
B
46
S
17
G
18
Posts: 847
Reputation: 13,802

Post » Tue Mar 19, 2013 6:31 pm

Hmmm,, i can't really find "is between angles".. Maybe there is something i forgot
B
7
S
1
Posts: 14
Reputation: 753

Post » Tue Mar 19, 2013 7:27 pm

mouse.x < plaer.x => player ->set mirrored
mouse.x > plaer.x => player ->not mirrored
check this: https://www.dropbox.com/s/b4lr6dxhu71np5p/fra%20%205.capxRoal4652013-03-19 19:31:56
B
9
S
3
G
3
Posts: 36
Reputation: 2,433

Post » Tue Mar 19, 2013 7:30 pm

Click on add action , then on sprite2 , and search for the angle group ...Whiteclaws2013-03-19 19:31:21
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Tue Mar 19, 2013 8:15 pm

Got it!! Thank you guys!! Know my shotgut is upside down when it turns around. I'll try to fix it and let you know
B
7
S
1
Posts: 14
Reputation: 753


Return to How do I....?

Who is online

Users browsing this forum: DemantDigitalArt, farfetchd83, mjj1990 and 6 guests