Angry Birds Slingshot using Bullet

Get help using Construct 2

Post » Sun Feb 03, 2013 12:55 pm

Hey Guys,

I am building a game where i'd like the user to be able to drag back from the MainCharacter and fire a bullet in the opposite direction, like the angry birds slingshot firing system.

I can find plenty of examples using physics but none using the Bullet Behaviour.

Any ideas?
B
7
S
2
Posts: 75
Reputation: 1,100

Post » Sun Feb 03, 2013 2:28 pm

What's wrong with using physics? That's the approach I would take, why a bullet behaviour? This is possible with the bullet behaviour, but I would like to know why the approach before I help if that's no problem.
B
17
S
4
G
5
Posts: 226
Reputation: 4,042

Post » Sun Feb 03, 2013 2:35 pm

Use this principle;

Give your bullet the following behaviors;

a) Drag & Drop
b) Pin
c) Bullet (initial speed of 0)

1) Pin the bullet to the character using rope-style.
Combined with the Drag&Drop behavior, you will be able to move the bullet around like in angry birds by dragging.

2) On Drag&Drop (when the player drops the bullet);

a) Unpin the bullet
b) Disable Drag&Drop
c) Set bullet speed to a value (can be based on distance to character)
d) Set bullet angle of motion (based on angle to character)

The sling part of the system is just a visual trick. It doesn't actually serve any mechanical function.
B
12
S
4
G
2
Posts: 59
Reputation: 3,739

Post » Mon Feb 04, 2013 5:17 am

@David How do we calculate the Angle exactly? I realise the sling is just aesthetic and I can get my character to fire a bullet i'm just having trouble getting the bullet to fire from the character but at the right angle. Thanks for the reply!

@dcrew the game is on a mobile platform and avoiding physics if possible is always best.
B
7
S
2
Posts: 75
Reputation: 1,100


Return to How do I....?

Who is online

Users browsing this forum: abdalghani, Kagubro and 21 guests