Cannon launch help

Get help using Construct 2

Post » Sun Sep 15, 2013 8:24 am

Hello, I am working on a game that i am very excited about but i have run into a problem. here is the scenario.

you press a button to set the power of the launch (how fast the cannon ball travels), then you press a button to set the angle of the cannon. I have that part figured out. I need assistance on how to have a third button that when it is pressed, the cannon ball with shoot out starting from the left, moving to the right, kind of like kitten cannon or toss the turtle physics.

any and all help is always greatly appreciated. thank you!
B
7
S
1
G
1
Posts: 13
Reputation: 492

Post » Sun Sep 15, 2013 9:01 am

Enable bullet behaviour on the cannon ball. Use 'Set Angle Toward' for the direction of the ball.
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Sun Sep 15, 2013 9:17 am

Thank you for the reply, i have never thought to use the bullet behavior, I dont seem to be getting the results i am looking for though. It seems that using the bullet behavior, when i apply force to the cannon ball it continues moving onward even after hitting the ground instead of slowly stopping.

To clarify, I am looking for a way to shoot the ball using the randomly generated power and angle that i have setup. once that information is input....i need a button that when pressed it will launch the ball at that speed and angle until it hits the ground and slowly comes to a stop.
B
7
S
1
G
1
Posts: 13
Reputation: 492

Post » Sun Sep 15, 2013 10:59 am

When you say "force", I assume that means you're using the physics behaviour? You should never combine physics with any other movement behaviour, as they have conflicting effects on the object.

But, I was in the mood to do a simple cannon game using physics, so here you go. This should be more than enough to get you started.

Up/down/left/right to adjust angle and power; spacebar to launch. Pay particular attention to the physics properties of the ball, such as density, friction and angular damping.
B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Post » Sun Sep 15, 2013 11:11 am

Geometrix, i cant thank you enough for pointing me in the proper direction. Yes i have been attempting to combine 8 direction, physics, platformer in many different ways. i have just recently dropped platformer and 8 direction. I am in full physics mode now.

You have been an immense help, the only thing i could get from my poking at physics has been lulz.
B
7
S
1
G
1
Posts: 13
Reputation: 492


Return to How do I....?

Who is online

Users browsing this forum: evillair, marcinkowski, unicornspitfire and 13 guests