dop2000's Forum Posts

  • justme5555

    It crashes because you made an infinite loop.

    here is my capx:

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

  • ,

    I read about square root being CPU costly before. After your comment I decided to compare (in C2):

    When I disable either event #3 or #4 and run the project in debug mode, there is almost no difference between two methods.

    With distance expression I'm getting 21-22 fps, and with squared values about 22-23 fps. CPU load is the same, around 97-100%.

    Is the difference really that small or am I doing something wrong?

  • Nice work, but how is it different from array? What are the advantages?

  • netdzynr

    You function sometimes produces results like "hellowXrld" when limit field is set to 3.

    Here is a slightly shorter version:

    The word should contain at least 3 letters, otherwise it will go into an infinite loop.

    You can add another condition to the While loop, for example "Loopindex<50" to prevent this from happening.

  • You can't pick any "abstract" object by UID.

    What you can do is to add all sprites to a family. Then in your function you pick a family member by UID.

    If you want your function to be even more universal and be able to process not just sprites, but also text objects, tiledbackgrounds etc, then you need to make several families, and your function can look like this:

    On Function "ApplyEffectToAnyObject"

    ...SpriteFamily pick by unique ID = Function.Param(0) -> do something with picked SpriteFamily instance

    ...TextFamily pick by unique ID = Function.Param(0) -> do something with picked TextFamily instance

    ...

  • You can set target angle to this expression:

    LiteTween Set Target to (currentlAngle<180 ? 0 : 360)

    This means "if current angle <180, then target angle 0, else target angle 360"

  • Mouse : Cursor is over object -> display info

    Else -> Remove info

  • Here you go:

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

    I suggest you use MoveTo or LiteTween behavior to move menu items instead of lerp. You can get much nicer looking movement and you'll be able use events that trigger when the movement has ended.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • And what do you expect to happen?

    Here is a demo:

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

    Run it.

    Change the date on your PC to tomorrow's date.

    Run again.

    Change the date on your PC to the day after tomorrow's date.

    Run again.

    Change the date on your PC to next week date.

    Run again.

  • AnD4D Just set the target angle to 360.

    It doesn't work like "anglelerp" because you might want to rotate from 0 to 720 for example, to make two full rotations. Anglelerp in this case will not move at all.

  • Enemy-> On destroyed
    (press B to add a sub-event)
          System -> Compare two values -> random(10) is less than 1   :   Enemy -> Spawn PowerUp[/code:2wzdw65n]
  • It's a demo...

    It adds this date to a timestamps and shows how many days in a row the app was running - "0"

    Then it adds another date and the number of days changes to "1".

    You will need to add a real date to the timestamp, every time your app starts.

  • You can do something like this:

    On enemy destroyed
       random(10)<1   :   Enemy spawn PowerUp[/code:2ro2445l]
    
    Every time an enemy is destroyed, there will be a 10% chance to drop a power up.
  • Many possible solutions.

    You can add a variable "TouchEnabled", set it to 1 when the game starts. Change your event to this:

    On button1 touched

    (and) TouchEnabled=1 -> Set TouchEnabled=0 ; do stuff

    Then set TouchEnabled to 1 again when you are ready to ask the next question.

    Also, I suggest you use "On tap object" for buttons.

  • I think by "height" he meant "distance" - after bouncing off solids the object should travel the same distance back.