mrtumbles's Forum Posts

  • Functions are incredibly powerful. Not using them is like cooking with blunt knives - you'll probably get the job done, but you'll make a mess and frustrate yourself in the process. Take an afternoon one day to get your head around them.

    I have a capx I keep that's just full of Functions that replace common expressions that C2 is lacking - they're easy to move from one project to another (each project only needs the 'Function' object in it), and they usually serve to dramatically tidy up your event sheets.

    Essentially, any event you find you're having to write again and again in a slightly different format - or any odd calculation you find yourself frequently having to do that there's no shorthand for - thats where Functions come in. Anyway, good luck

  • One thing I tend to do with a larger project is the majority of game logic ends up in one sub-group, which can be switched on and off at a whim. I usually have to write a Function to switch it on and off which also handles things like timescale management and enabling/disabling certain animations or behaviours. Maybe this solution might work for you?

    It's worth bearing in mind that "every X seconds" events will still work when the timescale is 0 - so you can always add a 'fake tick' that only runs when paused by using a very low number there. Not sure how advisable this is with regards to frame-rate consistency or independence.

    [tld;dr: Don't know about subjective time but have workarounds for the same problem.
  • What cell border have you determined in the Pathfinding behaviour's properties? It is "-1" by default - I'm not sure what this actually means, but could be related to your issue. Post a screenie of your Pathfinding properties if you can, it might help

  • On start - check item exists

    On item exists - get item

    On get item - set variable to localstorage.itemvalue

  • The first action, on start - it needs separating.

    Essentially, everything from local storage is brought in 'blobs' - every time you retrieve anything, it has to check the blob, then fetch that blob first - which is two whole interactions, each of which take (a very small amount of) time. So when you use 'Check item exists' you have to use another action to call when the blob check has finished (otherwise it will try and do it in the same tick - which won't work, because the blob hasn't been... blobbed (?) yet).

    The action you need is 'On item exists [CurLocation]' - then use 'Get item [CurLocation]' action in that event. Then you need another event 'On get item [CurLocation]', in which you can FINALLY set the variable! Seems crazy I know.

  • Sure thing - using the object condition 'Pick by unique ID'

  • A few ways come to mind. The simplest one to me seems to be:

    On layout start

    For "enemies" from 0 to EnemyCount

    Wait loopindex("enemies") seconds

    Create object [Enemy]

  • On load complete

    Stop all music

    Start playing new music

  • Are you using the 'Physics' behaviour on the spaceship or the asteroid? If you are you make sure you're using it on BOTH of them

  • You'll want to learn arrays - they're tricky at first, but the gateway to much more powerful stuff! And they're a lot simpler than you think - an array is essentially a basic spreadsheet (Imagine the 'Z' axis as being 'Sheets' on the spreadsheet).

    Back to your problem: you you could try

    on [player] collision with [enemy]

    for each [item]

    where [item] is overlapping [inventorybox]

    drop items (however that works)

    That should identify your items one-by-one for you, and make it easy to create the necessary logic to create the dropped items on the floor.

  • How does your inventory work? eg; Is it object-based? Is data held in an array? Is it just a set of ten variables?

    What behaviour is currently exhibited - do they drop one of their items, none of their items, do they drop items they don't have?

    Your games sounds fun by the way

  • Fixed - those events work - but not in the same event that creates the Line sprite objects! D'oh.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is what I'm doing. Any suggestions?

  • Has anyone answered the original question here yet?

  • I want to build polygons from lines, which are sprites.

    I would like the lines to pin to one another, so that the polygons can be moved as units.

    Any suggestions? I'm trying using families but having no success.