making events happen at specific milestones

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hi everyone.

    I've been playing around with MMF and have been doing well so far, but I've hit a bit of a brick wall. Here's my problem:

    I have some enemies appearing every 5 seconds. However, I want to increase the amount of he times they appear based on milestones, thus increasing difficulty. I'm having trouble making the enemies appear more frequently for every 10 points you score, for example, not WHEN they get 10, but EVERY 10 points (20, 30, 40 etc).

    Could this be done? I'm not sure how...

    Thanks in advance everyone.

    Personal portfolio: Please login to see this link.
    2D designer for: Please login to see this link.

  • To test the score in multiples of 10, do if score = Round(score/10.0)*10

    At this point you could have it test in the same event line if a variable doesn't equal the score, then set the variable to the score and decrease a variable associated with the time it takes for enemies to spawn.

    I see you.

  • Let's take an object and give it some alt.values. Points will serve as the score counter.

    Active Alt.A = tracker
    Active Alt.B = frequency
    Active Alt.C = multiplier


    Always
    -->Set multiplier of ("Active") to ("Points")/10
    (This allows us to to have an alterable value that sets itself to the score but divided by 10 in order to allow spawning every 10th point.)

    tracker of ("Active") < Frequency of ("Active")
    --> Add multiplier of ("Active") to tracker of ("Active")
    (When the tracker is lower than the frequency rate, add the multiplier to the tracker.)

    tracker of ("Active") >= Frequency of ("Active")
    --> Create enemy
    --> Set tracker of tracker of ("Active") to 0
    (When the tracker reaches the frequency value, it creates the enemy and sets it self back to 0 and the cycle repeats.)

    The higher the frequency, the longer it'll take for enemies to spawn. You'll have to adjust the frequency based on the max amount of points you expect the player to receive. Press right to add to the score and watch how it spawns faster every 10th point.

    Example
    Please login to see this link.

    There is probably a better method but i'm in a rush so i'll hopefully post a better example later.

  • don't use seconds as timers, instead use variables, like this:

    +Always -> Add 1 to the variable creationTimer
    (if your game runs at 50 FPS that means a second has passed when the counter is = 50)

    now set a variable that specifies how often enemies will be created. Based on the info above 5 seconds = 250,
    so set the variable like this creationFrequency=250

    When the timer is = to the creation frequency you create an enemy, and reset the timer:

    +creationTimer=creationFrequency -> create enemy, creationTimer=0

    If you want to create enemies more frequently change the creationFrequency variable
    +EVENT -> substract 10 to creationFrequency

    I think you got the idea and it's much easier to work with dynamical timers like these.

  • What's the advantage of variable timer, compared to timers; does the variable timer work better on slower machines/devices?

    Personal portfolio: Please login to see this link.
    2D designer for: Please login to see this link.

  • the advantage is that they are dynamical, when you use the timer, something like
    +Every 5 seconds -> do stuff
    and you no longer want it to be 5 seconds, you cannot change it, there are workarounds to do that that involve groups and/or variables but is messy and lengthy.

    They should work the same if you don't activate frame skipping (machine independent speed) which i don't suggest you use anyways. In fact they are better as they are attached to the frame rate and not time, meaning, if the machine is too old and can't draw 50 frames a second the variable timer will slow down with it but if you use the built-in timer, 5 seconds will be "real life" 5 seconds getting your game out of synchrony. (that's if the internal timer isn't dependent on frame rate to start with) but in any case, it cannot be worse.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!