mekonbekon's Forum Posts

  • Use Audio play ""&int(random(1,7))

    You'd want int(random(1,8)) or 7 won't get picked, as int just lops off the fraction.

  • It looks like your previous data is already lost, so changing the depth back to 1 won't retrieve it - any new data should be saved though.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think it's because your z size value is set to zero - it should be 1.

  • There should be a json file for the array in the Project>Files folder - if you download this and open it in a text editor you can check to see what data has been saved.

    If you can't see anything obvious wrong with it try sticking it into a json validator like this one: jsonformatter.curiousconcept.com

  • you're welcome :-)

  • If all of your soldiers use a weapon then I'd consider adding them in a container together, so when you pick a soldier its weapon is automatically picked.

    I'd also pin (position only) the weapon to the soldier so that you don't have to keep repositioning it.

    If you do use a container then rather than having a family it might be better to just have a single soldier object and set the team and class with a variable. You would have different animations for the teams and classes on the one soldier object. Same for the weapon: a variable for type, different animations for each type.

    On start set variables and animations for each soldier/weapon then pin the weapon to the soldier.

    Every tick for each soldier set weapon angle to Mouse X,Y.

    The pin should then take care of all the repositioning.

    On change of direction, unpin the weapon, mirror the soldier, mirror the weapon, reposition and repin.

  • If you want to return to layout X from layout Dungeon, on leaving layout X save the name of the layout to a global variable (e.g. "lastLayout").

    When you exit the Dungeon use the Go to Layout (by name) trigger, using the lastLayout variable.

  • No probs :-)

  • You will probably be able to cut down the number of conditions required with some careful grouping of objects into containers and families.

  • Here's one way, assuming you're picking the "n" nearest Object B to Object A and there are multiple instances of A and B:

    Give B the instance boolean "isPicked" and set to false as default.

    1. Pick instance of Object A (using whatever criteria you want)

    ---System: Repeat "n" times

    ----- Object B isPicked is false, Object B: pick nearest B to (A.X, A.Y): Set isPicked to true

    2. Object B: isPicked is true: do your thing.

  • Had another thought about this over night; instead of spawning loads of mask objects, you just use one that tracks the mouse and paste it to a drawing canvas object positioned over the dirty version of the pan - The canvas uses the destination out effect instead of the mask, and the mask is set to invisible.

    Here's an example:

    dropbox.com/s/x7njq8iru5x32m2/dishwasher01.c3p

  • No problem :-)

  • Here's one way of doing it:

    dropbox.com/s/2ooh1o99entx1z2/dishwasher.c3p

    In this example I create a grid of dirt objects that cover the pan - these are invisible, but will be used to track how clean the pan is.

    There are two instances of the object, one with a dirty animation overlaying a another with a clean animation. As you move the mouse over the pan I repeat-spawn a mask object to hide the dirty version wherever it's spawned (using destination out effect), gradually revealing the clean one. Any dirt objects overlapping the mask object are destroyed - a tally is kept and when all have been destroyed the pan is 100% clean.

    Bubbles are created - I have these draining off but if you want them to remain you can disable their bullet behaviour.

    There's a more detailed explanation in the project comments.

  • I'm guessing it's because you haven't changed the txt_answers.no variable for the copy/pasted instances to 6-10.

  • You can use two "for" loops to draw the objects, one for the grid width, one for the grid height:

    dropbox.com/s/c7jaf246dbrvx9o/objectGrid.c3p

    In this example you can change the grid using the gridWidth gridHeight and margin variables.