mekonbekon's Forum Posts

  • You might be able to use the system event "Compare two values" and then use:

    Audio.PlaybackTime(Tag)

    Get the current playback time in seconds of a sound with a tag. This starts at 0 and counts up to the duration, except for looping sounds which keep counting up past the duration.

    e.g.

    Compare two values: Audio.PlaybackTime("yourSound") > 2 |Trigger once : Your action

  • dop2000 , well at least Wossi won't need to ask why the sprite now only turns white!

  • Wossi

    I think it's because the color settings for SetColor range between 0-100, not 0-255. I've made the same mistake myself!

  • Would something like this work for you?:

    https://www.dropbox.com/s/t9btkztlopfsj ... .capx?dl=0

  • jatin1726:

    The regex defines what can and can't appear in the email address; this part:

    ^[A-Z0-9._%+-]+

    ...defines what characters can appear before the "@". The "@" ensures that there has to be an instance of the "@" symbol.

    This part defines what can appear after the "@":

    [A-Z0-9.-]+\.[A-Z]{2,}$

    Note that neither of these parts allow "@"

    This isn't the only regex that can validate emails. If you google "regex" and "email" you will find a whole bunch of other examples, some more thorough than others.

  • The capx I shared above demonstrates this as described. Here's the link again:

    https://www.dropbox.com/s/qw6a0rp9f5srf ... .capx?dl=0

    Type the email address into the text box, press enter. The text above the text box will change depending upon whether the email is valid or not.

  • sahesadega

    You can use something like this:

    https://www.dropbox.com/s/k6h7iu16nls7z ... .capx?dl=0

    The important bit is in function "AB":

    If (A=0 & B=1) show "TRUE", else if (A=1 & B=0) show "TRUE", else show "FALSE"

    At runtime click on the A and B values to toggle between 0 and 1

  • jatin1726

    In the demo I supplied the following shows as valid:

    ...and these all show as invalid:

    ex@mple@gmail.com

    example@gm@il.com

    ex@mple@gm@il.com

    example@@gmail.com

    Please can you supply an email address that is working incorrectly?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • jatin1726 I'm not sure I understand. Do you mean that invalid email addresses with 2 "@" symbols are being marked as valid, or that emails with 2 "@" are not being allowed in the demo I supplied? Can you give me some written examples of some emails that aren't working correctly?

  • I would guess northern European, definitely not British (I'm a Brit). Sometimes it sounded a bit French, others Scandinavian. Am I close?

  • RobertoFreemano

    You can use the modulo (%) expression to achieve this:

    If score%10 = 0

    If score != 0 | play reward animation

    Modulo checks the remainder when you divide the number to the left of % by the number to the right.

    You need to check that the score isn't 0, as 0%10 = 0.

  • jatin1726

    You can use the "System|Test regex" condition to test the text in a text input box:

    String: TextBox.Text

    Regex: "^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$"

    Flags: "gi"

    This should capture pretty much all email configs. Use an "else" statement beneath this condition for your invalid email actions.

  • Thanks, you too!

  • 25games It's essentially the same problem in both examples:

    In the first example the issue is with event 3; you don't actually have any enemies picked, so if *any* enemy's distance is less than the min distance then *all* the enemies will stop. You can either use a "for each enemy" condition or swap the condition around to check if enemy.minDistance > distance(Enemies.X,Enemies.Y,Player.X,PlayerY) to ensure each is checked individually.

    In the second example the problem is with the Else conditions in event 7 and 8: event 6 will check all Characters for "attacking"; If *any* Character is not attacking then *all* Characters whose velocity > 10 will be set to run, but the "Else" in 8 means that if *any* Character's velocity is less than 10 then *all* Characters will be set to idle.

    The trick here is to use inverse conditions: swap the Else in event 7 for "Character is NOT attacking". Make the velocity check and event 8 sub-events of event 7 and swap that second else for character velocity <= 10.

    As a general rule, avoid using Else for checking against objects, especially where multiple instances are concerned.