How do I make an archer?

Get help using Construct 2

Post » Thu May 11, 2017 4:33 am

Well, i have an arcade game where there is archers. I want them to shoot a single arrow every time they are at the frame 13 of the attack animation. But, actually they are some times passing through frame 13 without shooting and some times shooting 2 arrows at same time when passing through frame 13. What may be the problem adn how can I solve this?
Image
B
21
S
8
G
1
Posts: 29
Reputation: 2,000

Post » Thu May 11, 2017 8:26 am

Using a frame number for a trigger is unreliable as the the framerate could be low, making it skip frames.

You could narrow it down a bit with making it something like frame > 13 combined with a trigger once.

But personally I would use an user interaction, such as key press or touch etc.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Thu May 11, 2017 2:00 pm

I can't use user interaction because the archer is only a troop in middle of many. Every archer fights the enemy troops automatically when they see 'em so i need them to shoot their arrows in th exact moment they are at frame 13, to be more realistic.
B
21
S
8
G
1
Posts: 29
Reputation: 2,000

Post » Thu May 11, 2017 2:04 pm

Perhaps split up the animation

Frame 0 to 12 "first_part"
Frame 13 to X "second_part"


Event
.....
action
Start the animation "first_part" because of what ever reason


Event
On animation "first_part" finished
action
fire the arrow
Start animation "second_apart"
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Thu May 11, 2017 3:38 pm

Good idea. Thank you bro.
B
21
S
8
G
1
Posts: 29
Reputation: 2,000


Return to How do I....?

Who is online

Users browsing this forum: Lancifer and 30 guests