Cannon mechanics

Get help using Construct 2

Post » Wed Jun 05, 2013 7:23 pm

I've been experimenting with various setups for a relatively simple game based on a circus cannon. I'm still having issues with some elements outlined below. Any ideas how to resolve them

Here's the file:

circus cannon test

Ideally:
1. As mouse button is pressed, energy increases to a max of 100 (done)
2. Cannon stops when mouse button is released
3. Object shoots out in the direction the cannon was aimed, at the speed set by the energy (no luck with this yet)
5. ScrollTo follows object (somewhat done - but I'd like it to follow and not dissapear once it reaches uper border of screen)
6. Object is affected by gravity (physics work, but when button is pressed, the object gets lifted up)
7. Pass control from cannon to flying object. In other words, stop the creation of additional fired objects and instead give "lift" to the currently flying object.

Next steps:

Create a visual "flight bar" that gives air push to the object when mouse/touch is pressed, but decreases in value.

What I have at the moment is not very elegant. Any ways to optimize the logic would be appreciated.
Thanks for the help.flaye2013-06-05 21:45:10
B
19
S
5
G
6
Posts: 32
Reputation: 4,194

Post » Wed Jun 05, 2013 11:55 pm

have the cannon ball shoot by applying a force toward a position*power and then and set unbounded scrolling to no and change the layout so it will work
B
40
S
11
G
7
Posts: 514
Reputation: 9,626

Post » Thu Jun 06, 2013 1:00 am

Thanks @sosensible. I think there's something similar already in place in terms of power and position. Unbounded scrolling is set to no. Actually, it works better when set to yes, but that also wrecks the overall layout.


The fired object keeps shooting upwards rather than in the trajectory the cannon is aiming at.

I need also to limit it so that once the object is fired, no more objects can be fired.

Suggestions?

Thanks.
B
19
S
5
G
6
Posts: 32
Reputation: 4,194

Post » Wed Oct 09, 2013 9:30 am

@flaye

It is cool but how it work on touch event i Changed mouse event into touch but after that it didn't work properly..... so Any Idea
B
12
S
2
G
3
Posts: 57
Reputation: 3,439

Post » Wed Oct 09, 2013 8:51 pm

@flaye, trying to answer point 3.

Set angle of object being fired to that of angle of cannon.
Use bullet behaviour on object and in properties keep "set angle" at yes.

This should get the angle correctly set on creation.
B
13
S
4
Posts: 67
Reputation: 1,270

Post » Wed Oct 16, 2013 4:15 pm

Sorry for delay in replying. Life kinda got in the way

@rob: not sure why it's not working. It is in mine.

@AngelEyes: Thanks for the tip. Worked!
B
19
S
5
G
6
Posts: 32
Reputation: 4,194


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests