mekonbekon's Forum Posts

  • You can do this using the drag and drop behaviour on the cards and the SnapX and SnapY expressions on a tilemap object for the grid:

    dropbox.com/scl/fi/ka9ie69h1lheupyqr5sfy/SnapToGrid.c3p

  • You need to pass the UID of the button to the function:

    dropbox.com/scl/fi/ycpmkxpdqtbwxli8r9bzk/pickButton.c3p

    EDIT: Oops, sorry Dop, didn't see your reply!

  • Big thanks dop2000,

    Your demo pointed me in the right direction - I ran with it and came up with this:

    dropbox.com/scl/fi/n2f8flncqguagojf734so/FillTheBlankWord2.capx

    This version also allows you to delete letters and then test the word by pressing enter.

  • I have a text object (txt_fact) displaying a sentence that includes one word replaced with a line of blanks. I want the user to be able to replace the blanks with the missing word, or at least write on top of the blanks.

    Currently I use the following method:

    1. Add a second text object (txt_answer) that sits over the blanks in txt_fact.

    2. Add a textbox object with the CSS set to render it invisible.

    3. Focus the textbox and set txt_answer to display whatever text is typed into the textbox.

    This would work fine, except fonts in a text object display differently depending upon the browser/device, so I can't guarantee that the position of txt_answer will always lie precisely over the blanks.

    Is it possible to derive the coordinates of characters in a string? e.g. find x,y for the 3rd "_" in "I laughed at the _______ dog."

    Failing that, is this something I can handle with regex? I figured I might be able to use a replace expression, but I'm unsure how to handle the user deleting characters that have been added once the blanks have been replaced.

    Or maybe there is another way?

  • I've also popped a few neurons trying to decipher the debug output from 3D arrays.

    Ashley maybe it would make things a little bit more readable if the z layers were bracketed?

    Fengist's x=0 would then look like:

    (370,-1,-1,-1),(222,-1,-1,-1),(913,-1,-1,-1)...

    ...which is a lot easier to parse.

  • You can use the conditional operator "?" in expressions as follows:

    variableA="player"?"PLAYER":"ENEMY"

    Which translates as "if variableA equals "player" then set expression target to "PLAYER", else set it to "ENEMY".

    You can stack these up as follows:

    variable=1?A:variable=2?B:C

    As you mention, "|" is the OR operator; "&" is the AND operator.

    There are more operators here:

    construct.net/en/make-games/manuals/construct-3/project-primitives/events/expressions

  • No problem :-)

  • You're welcome :-)

  • You can shuffle a 1D array to create a randomised sequence of numbers, then step through them:

    dropbox.com/scl/fi/zyz381zu7vom50r2d8p0a/arrayShuffle1D.capx

  • Open the C3 start page and check out the game templates and examples - there are lots of simple games there to get you going.

    Whilst playing through the examples have a think how you could modify the mechanics to make them more interesting and extend the gameplay.

    I put together this tutorial a while back that you might find useful:

    construct.net/en/tutorials/designing-itsy-bitsy-games-1116

  • You can create as many probability tables as you want. You need to set the table before using the AdvancedRandom.Weighted expression to generate a value from the desired table:

    dropbox.com/scl/fi/1yx0atrkp5pure4ol6e12/Advanced-Random.c3p

    It would be nicer to be able to call the table directly from the expression itself e.g. AdvancedRandom.Weighted("Table1").

    I believe you can have multiple entries on the table with the same name, hence the requirement to state the weighting. Why you would want duplicates I'm not sure - perhaps because you can't change a weighting for an entry once it's been added?

    It would also be nice to be able to import a table from json rather than having to set all the entries as actions.

  • For homing bullets:

    Add the bullet behaviour to your bullet. Make sure "Set Angle" is ticked on the project properties.

    If you want you bullet to always target the nearest enemy, even if the nearest one changes, then do the following every tick:

    System condition: For each bullet, pick nearest enemy to bullet.X, bullet.Y

    Bullet action: rotate n degrees toward enemy.X, enemy.Y

    The greater the value of n the more the bullet will home in.

    If you have a lot of bullets and performance is suffering swap every tick for every t seconds and increase n.

  • Here's one way:

    1. Give the character a boolean variable: isIdle

    2. Add your idle animations: "breathing", "looking", "twitching" to the character. Make sure they're not set to loop.

    3. When your character is on the ground and not moving set isIdle to true.

    4.Add an event with these conditions and action:

    Condition: Character isIdle

    Condition: Character Compare Frame is equal to Character.AnimationFrameCount-1,

    Action: Set Animation to choose("breathing", "looking", twitching) from beginning.

    Remember to switch isIdle to false when the character starts moving or is off the ground.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Colludium Good to know, cheers!

  • This looks really cool Colludium, looking forward to trying it out.

    Is it compatible with this method for creating a "blobby" water effect?:

    construct.net/en/tutorials/create-water-games-2172