Zephlon's Forum Posts

  • One more thing, how about this one?

    Event: System->Compare x = 1 / Action: System->Set value X = 0

    Event: System->Else / Action: System->Set value x = 1

    After this runs, what is the value of x? <img src="smileys/smiley4.gif" border="0" align="middle" />

    If x = 1, then x will still = 1 and X will = 0. (Unless Construct 2 is case-insensitive.)

    If x = 0, then x will = 1.

  • Just create a new condition or event System->Pick Random Instance.

    http://www.scirra.com/manual/124/system-conditions

  • Have you tried using the sine behavior?

    http://dl.dropbox.com/u/52788071/bees.capx

  • Try this.

  • What i don't know is how many impulses are being executed.

    Create a number variable, add one to it after applying impulse, and log it to the Chrome Console. That should tell you how many times it applies impulse.

  • First, you should give all of the Sprite## objects names. I made some changes to your capx.

    Try this.

  • I changed it to apply an impulse of 5 instead of a force of 200 and use Sprite2.X, Sprite2.Y instead of Sprite.sx, Sprite.sy. I also made it shoot when the mouse button is released. Now it works much better.

  • Create a System>Compare two values event, double click on the object you want to check for, and double click on Count.

    To reset the level, create a System>Go to Layout (By name) event, double click System, and double click LayoutName.

  • I calculated the velocity that the ball starts moving at and realised that the formula assumes that the cannon is at (0, 0). So I subtracted the cannon's coordinates from the mouse's coordinates.

    <img src="http://dl.dropbox.com/u/52788071/cannon_angle2.png" border="0" />

    Note: I blurred out parts that are unrelated to the problem.

    Now, when the mouse is anywhere to the left of the cannon, it points almost straight up (270.00009316509215 degrees). When the mouse is anywhere to the right of the cannon, it points almost straight down (89.99999794984215 degrees).

    Also, the formula assumes that (0, 0) is in the bottom-left corner instead of the top-left. I'm not sure how to correct this.

    Can anyone please help?

  • http://dl.dropbox.com/u/52788071/cannon_fire2.jpg

    The "manual_fire" key is just a way to access a backup option in case the "automatic" one doesn't work. (Which it's not right now.)

    I'm not very good at physics calculations; what did I do wrong in the formula? Or do I have the wrong formula?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How can I have a cannon shoot a ball (with physics behavior) so that the ball's trajectory goes through the point where the user clicks?

    This is what I tried to do to get the cannon at the right angle, but the cannon doesn't rotate at all (0 degrees):

    <img src="http://dl.dropbox.com/u/52788071/cannon_angle.png" border="0">

    I got the formula from Wikipedia.

    The ball gets shot with an impulse of 0.6 at Cannon.Angle. I convert this to velocity using the formula <img src="http://easycalculation.com/physics/classical-physics/images/impulse-velocity.gif" border="0"> that I found here.

  • I read that we're supposed to use the free edition of Construct 2, and then I read that we shouldn't worry about the rules. I'm confused. <img src="smileys/smiley5.gif" border="0" align="middle" />

    I started working on a game using the licensed version of Construct 2 around 3/17/2012 and it has 127 events and 1 family. And at least 10 of those events is just to keep the event sheets organised. Can I enter it into the contest, or do I need to try to trim down the number of events?

  • Kind of. I have a level selection menu made:

    http://dl.dropbox.com/u/52788071/Poggle/index.html

    I was hoping to have the game check if each level exists, and mark the ones that don't as "Coming Soon". I guess I'll just leave it as it is.

    But one thing I can't figure out is how to have multiple pages of levels, and a sliding animation to switch between them. Angry Birds's level select menu has this. I tried having the level buttons in the own layer, and setting the parallax on the other layers to "0,0", but that caused those layers to appear too far up and left.

  • I was trying to find a way to have a level selection menu be automatically generated. Until this is possible, I'll use Kyatric's idea. Thanks.

  • I think he means via events.

    Oh sorry, I forgot to mention that.

    Yes, go to the projects bar on your right, and look in the layouts folder. If this makes no sense, go to the VIEW tab on the top of construct2 and check off "Project Bar"

    I'm not an idiot, I know how to look in the list of layouts, but I don't know how to teach the game to do that. <img src="smileys/smiley17.gif" border="0" align="middle" />