flaye's Recent Forum Activity

  • Thank you so much GeometriX!

    I owe you a beer.

    Cheers.

  • GeometriX: I've tried doing that with the variable, but I think I'm getting a bit lost in translation.

    I'm attaching the capx.

    cannon test

    Any ideas? Thanks.

  • How would you go about switching the touch focus from one object to another?

    I'm building a circus based game where a clown is being shot out of a cannon. I got the shooting out of the cannon bit working, based on the first touch (click of mouse).

    Now that the clown is airborne, I want to focus the touch action so everytime the player touches the screen, the clown will flap his hands and give him some "lift", based on a set amount of points. Every touch will decrease those points, until none is left and the clown crashes on the ground.

    At the moment, whenever the touch option is enabled, a new clown get's generated and shot out of the cannon.

    I've tried using "on Nth touch" but I don't think I'm getting it right.

    Also, in order to keep things neat, how would you use Groups for this?

    I'm thinking of using one Group for the cannon function, and one Group for the clown flying function.

    Any ideas on how to solve this?

    Cheers.

  • Thanks 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Have you seen this post?

    snap to grid

    Take a look at the .capx that's provided. It should set you on the right path.

  • 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.

  • Seems that I'm not quite getting the knack of this.

    The idea is to have the cannon rotate between two points. Once the mouse/touch is released, the bullet flies out based on the direction the cannon was aimed, and the scrollTo function follows it.

    I've created a dummy object that gets destroyed when the mouse-click is released, and instead spawns the actual flying object.

    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

    5. ScrollTo follows object

    6. Object is affected by gravity

    7. Cannot create additional flying objects until it game is over (object crashes)

    Next steps:

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

    cannon_test.capx

    Your help is greatly appreciated.

  • drappdev - quick question..

    What did you set the FLOOR variable to? I'm trying to rebuild as per your example, but I can't find the connection of it to the cannon sprite.

    Thanks.

    [edit]

    Nevermind. Floor is a math function.

  • Thank you, drappdev! That works well.

    I guess I was trying to overcomplicate things with variables and loops.

    My thought process was as follows:

    1. Set a starting and end angle variables.

    2. Create a loop that will rotate the cannon from start to end value.If end value is reached, rotate from end to start.

    3. Continue until LMB/touch are pressed. Find stopped angle

    4. Stop rotation of cannon. Play fire animation and shoot projectile at stopped angle value.

    I come from 3D background and do a lot of animation scripting. Sometimes the simple elegance of C2 requires to slow down and smell the roses :)

    So based on your example, the values that are being sent to the text object can then be used to set the projectile angle of the fired object.

    I'm assuming I should use a bullet object with physics, since I want a parabolic arc.

    The point of the game is to keep the fired object afloat as long as possible.

    I'm trying to get mechanics similar to this:

    Subscribe to Construct videos now

    Thanks.

  • Just found the perfect behaviour to do this, compliments of RexRainbow. It's called swing, and can be found here:

    http://www.scirra.com/forum/behavior-swing_topic46029.html

    Thank you.

    My question is: how can this be emulated in the event sheet without that behaviour?

    Cheers.

  • Hi,

    I'm trying to do a simple circus cannon example, where the cannon object constantly rotates from it's pivot (positioned opposite the barrel opening) and upon mouse down/touch, it fires.

    The Sine behaviour is close to what I want, but I can't seem to control the right angle limits of the cannon.

    Any ideas?

    (image explaining concept below)

    http://imgur.com/vYaoiqb

    Thanks.

  • Staying away from ALT then.

    Back to the scaling uniformly from centre question - is there a way to do so in C2, or does it only scale uniformly from a corner?

    Thanks.

flaye's avatar

flaye

Member since 8 Dec, 2011

None one is following flaye yet!

Trophy Case

  • 12-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies