AllanR's Recent Forum Activity

  • if you select by the Boolean variable, and another condition "not is pinned"

    then you would only delete the new duplicates.

    I know how you feel about creating something only to destroy it. But that may be less expensive than any other system of tracking and deciding what to recreate. It is probably only a little pointer you are wasting - don't think of it as some giant image : )

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you can easily identify which of the recreated objects should be pinned, but aren't, can you just destroy those?

  • Proxyma

    Here is a similar approach I took to create an angry bird type game. The farther you pull back on the slingshot, the more velocity you give the projectile... it plots a dotted line to show where the bird will go.

    http://www.rieperts.com/games/forum/angry_birds.capx

  • KyleSousDor

    set a global (or local) variable ReturnPoint to > Choose(1,2,3,4)

    then find path to > base.imagepointx(ReturnPoint) base.imagepointy(ReturnPoint)

    that assumes that imagepoint 0 is the origin and not one of the possible return points...

  • BattleJenkins I might see if I can do it without using collisions, but that would mean finding another way to keep track of where bubbles are...

  • OK, I wrote some functions that do the absolute minimum work - no extra looping. The match testing only runs when needed (when a bubble has settled), and the connected testing only runs if bubbles have been destroyed. Both tests set a flag on each bubble so that it knows which ones have been tested and which ones still need to be tested.

    For the match testing, it starts with the bubble that has just settled, and only tests the ones around it that are the same color, and stops when it can't find any more - so there is no wasted testing. Then, if bubbles are destroyed it calls the connected test - which uses a very similar technique starting at the top, and working its way down, all in one pass.

    It runs nice and fast on my iPhone...

    http://www.rieperts.com/games/forum/CBPuzBob.capx

  • The great thing about Construct 2 is that you are only limited by your imagination - there certainly are a number of ways you could do that, but it is hard to make a suggestion when we don't know what you have in mind.

    Do you mean something like a planet rotating on its axis while it orbits around the sun?

  • The Wait x seconds command does not stop all execution of code. It only affects the lines immediately after it.

    So, the last two lines of the function "onCollision" will happen after the wait, but the rest of your game code will continue to run every tick (1/60 of a second). That means if you call "RestartFunction" right after calling "onCollision" then that will happen in the SAME tick.

    Another thing to be careful of is that after the wait time is up, when those last two lines do execute, the function will no longer have the same objects picked. In your case you may only have one explosion object, so it would probably be ok. But if your function is meant to do something to one enemy, then lines after a wait command would apply to all enemies unless you re-pick the one you want.

    You could move calling the RestartFunction inside the onCollision function (after the Wait line). Or have a Game Over message pop up, and have the user decide when to restart while the explosion is still running in the background...

  • you need to add the layer's name to the touch x and y reference to get the correct coordinates for the scaled layer.

    Touch.X("Layer 0")

    Touch.Y("Layer 0")

    just replace Layer 0 with the name of your layer...

    EDIT: I see Usman Haq beat me to it, however in that thread the suggestion was to use the layer number. Using the layer name is safer because if you add layers later (like another background layer at the bottom), you may break your code because layers will get re-numbered but the name will stay the same.

  • Mylon someone just recently posted a tutorial for how to edit a capx, so an older version of C2 can open it.

    https://www.scirra.com/tutorials/4778/make-your-construct-2-project-backward-compatible

    as long as the project isn't using any new features, it should work fine.

  • i was going to suggest setting the child's position to:

    child x = Parent.X+cos(Parent.Angle)*ParentRadius

    child y = Parent.Y+sin(Parent.Angle)*ParentRadius

    you would then have to add an angle offset that you add to the parent angle to get the child lined up to a particular spot on the parent image, but that is where just placing an imagepoint where you want the child makes the whole process a lot easier...

  • After the Wait 3 seconds, you turn off ColbaPower, but you don't re-enable collisions.

    The twitching is probably from constantly setting the vector Y to -1800 (that will happen every tick)

    The distance function may be getting confused if there are multiple Platforms...

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies