AllanR's Forum Posts

  • beardman

    just took a look at your capx, and when the Roc is flying to the left, it is never hitting the centerline, or the farleftPt. The path ends before it makes contact with the line, so it never sets a new path. Probably because of where origins are... or something like that. Also, the Roc doesn't seem to want to fly very close to the left edge of the screen.

    So, I moved the farleftPt out from the edge (set its x to 25). And when finding a path to the left, I told it to subtract 50 from the x of the target to make sure it was going to hit the line: Find Path to (centerLine.X -50, centerLine.Y) or Find Path to (FarLeftPt.X -50, FarLeftPt.Y)

    I didn't have to change the path finding when it was flying to the right.

    After those changes it continuously flew back and forth just fine.

  • LaDestitute

    ok, I took a quick look, and the problem is in the Main event sheet - On Start of Layout. You create the Rupees object on layer 4. But your HUD layers are now 5 and 6. (Since you probably inserted a new layer to be the Shadows layer). Create Rupees on layer 5 or 6 and it works fine.

    It is a good idea to always reference layers by name, not their id number. That way you don't have to worry about inserting new layers... So, create Rupees on layer "BottomHUD" instead of 5, and then it will always work regardless of how many layers you add or delete (unless you delete the bottomHUD layer of course, lol)

    One time while testing and going into one of the houses I ended up out side the house some how... I did look at the code but there is some bug in there somewhere when you enter a house. (it only happened once - although, I didn't try very many times).

  • djohoe28

    Oh, ROJOhound beat me too it! I was going to suggest that, as well as saying you could also use "Pick top instance" because the last one created would be the highest in the z-order (unless you manually change it).

    You could also save the UID in a global variable every time you create an instance. Then you have that available any time you need the sprite without having to make C2 loop through all the instances.

  • dondosh

    When you left-click and move Sprite3 over the blue box, the object collides with the box for several ticks, so the impulse is applied multiple times - and that makes it fly off so fast you can't see it move.

    so, you need to find a way to apply the impulse only once - by moving the object just above the box (so it will fall on it like the way the right-clicked ones do), or use an instance variable that gets set when the impulse is applied that prevents it from happening again.

    Also, the angle of impulse you are using (150) is down to the left (180 would be straight to the left). Your picture shows you want an upward impulse, so I was using 255 degrees and an impulse of 4 to get something close to what you are after. I also set the velocity to 0,0 just before applying the impulse and that gave more consistent results.

  • fathijack1999

    chipmunk physics is a plugin made by RojoHound, and is better than the built in physics (has more features).

    if you have trouble installing the plugin, just look at the older version I posted above. It doesn't leave the trail of dots after the shot, or allow zooming, but is close enough to give you an idea of what can be done. (and it doesn't use chipmunk physics.)

  • Ach3rryontop

    I helped someone last year with a coloring example - not quite what you are after, but uses Rojohound's canvas plugin...

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

  • fathijack1999

    I made an angry birds type game last year for someone - it has the little white dots to help aim, stretching sling-shot, and a camera that follows the action, plus you can zoom in and out.

    demo: http://www.rieperts.com/games/birds/

    capx (needs chipmunk physics): http://www.rieperts.com/games/forum/angry_birds_chipmunk.capx

    older version, regular physics: http://www.rieperts.com/games/forum/angry_birds.capx

  • fisholith

    Very nicely done! - and nicely commented too.

    One minor bug - you defined glideSpeed, but then didn't use it in the lerps... I put it in, and set it to around 0.8 and then it felt nice and snappy - the way I would want it anyway!

  • czar

    I took a very different approach to moving the blocks - but works pretty well. I added a bar under the row of blocks so that we can align the blocks to it. When you start to drag a new block over the bar, all the other blocks get re-positioned effectively making room for the new block (which snaps to its position when you drop it). If you pull a block off the bar, the remaining blocks snap back together. (You could, of course, disable drag and drop for blocks when they are dropped so you can't remove them).

    I thought about lerping the blocks to their new positions, but I like the snappiness and simple, clean code.

    my capx: http://www.rieperts.com/games/forum/MoveApart.capx

  • dirkdrie

    overlapping at offset is a good way, although you would have to check above, below, left and right individually.

    You could do it all in one go with a larger invisible "detector" sprite, center it over the selected instance, and then pick all the instances that it overlaps - just make sure it is the right shape to select only the ones you want...

  • fun4thebrain

    Construct 2 doesn't have as simple a way to load an array.

    The two easiest ways are to build a json string to load into the array, or use TokenAt to loop through a delimited string...

    json example = "{'c2array':true,'size':[2,7,1],'data':[[['3 x 0'],[2],[3],[0],[1],[4],[0]],[['3 x 1'],[3],[5],[2],[16],[9],[3]]]}"

    token delimited string = "3 x 0|2|3|0|1|4|0|3 x 1|3|5|2|16|9|3"

    see: https://www.scirra.com/forum/initialize-an-array_t117058 for more...

  • Critchalow

    it sounds like the "CreatureCore is overlapping CreatureCore" is the problem. That is ambiguous... C2 can't tell which instance you want to copy from, and which one to copy to.

    The way to work around that problem is to create a family (called something like CreatureFamily), and add CreatureCore to the family.

    Then you would compare "CreatureCore is overlapping CreatureFamily & CreatureCore is playing Egg". CreatureCore Set Body to CreatureFamily.Body, CreatureCore Set Tail to CreatureFamily.Tail, and so on....

    that way it is clear which is the source (parent) and which is the child...

  • rinesjoseph and ankushtaneja

    The easiest way to do it is to only handle one touch at a time - and use the On Nth touch Start, Has Nth touch, and On Nth touch End.

    Use N=0 (zero), so you will have events for On touch 0 Start, Has touch 0, and On touch 0 End. Your game will ignore 2nd, 3rd or more simultaneous touches, but at least it will work. The vast majority of the time, for a simple game, people will only try to use one touch at a time anyway.

    If you want to properly handle multi-touch, you use On any touch Start, Is in touch, and On any touch End. But then you have to use touchID to tell the various active touches apart. Use Touch.XforID and Touch.YforID to track where the touches are going. And then On any touch End you check the touchID to see which of the touches has ended, and process accordingly.

    I would start with the single touch method until you have a good handle on how it all works, and only add multi touch support if you really need it.

  • UpendraWatwe

    You are in the "add action" window... you need to do it a level higher - under "add event".

    it shouldn't matter how you break up the image... but if you have multiple sprite objects with different names, and only want one set of functions to handle everything, then you would want to put the different sprite objects in a family.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • add an event for the sprite/object you want, scroll down and look under the "Misc" section, look for "Pick by unique ID"

    if you are picking it inside a function, (and passed the UID as a parameter) then you would give it the value "function.param(0)"