AllanR's Recent Forum Activity

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

  • 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)"

  • UpendraWatwe

    you don't need an instance variable to do this - they already have an instance ID (called IID) and you can also use their unique ID (or UID).

    You also don't really need the global variable. If the sprites are all instances of the same object you can use IID, or if they can be different objects that are part of a family you should use UID. UID is a direct link to the object that stays constant. IID is relative to how many instances there are and can change as you create or destroy instances - so I usually use UID to avoid confusion.

    You will only need one event checking if the object (or family) has been touched. Then call your function and pass object.UID as a parameter.

    In the function, the first thing you do is pick the object by UID, then you can do whatever you want to it...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Using C2 means search engines (google) can't see your site, so your content wont get indexed and people will not be able to find you by searching.

    I have seen a couple people post that they have used C2 to make their site and it has worked out ok. I have used C2 to make a database app for a customer (using ajax to pass data back and forth to a mysql database) - it is inside a secure area that requires logging in and is only used by employees so they don't care about SEO...

  • Set the Period offset to half of what the period is. The default period is 4 seconds, so then you would set the period offset to 2 to make it start moving the opposite direction.

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

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

20/44
How to earn trophies