dop2000's Recent Forum Activity

  • Here is my attempt:

    dropbox.com/scl/fi/vbfmptsy0qdcl823c9kaw/8Direction_Gamepad.c3p

    Sliding, acceleration, deceleration - all work. The speed also changes based on how far you tilt the stick.

  • You can use "Simulate control" action. It will only work for 8 directions though, as the behavior name suggests.

    Another option is to use vectors and handle acceleration/deceleration with events.

  • and when I'm in the title screen scene, my ‘LanguageIndex’ variable resets

    Is it a global variable? Global variables are not reset by themselves. There must be an event in your code that resets it.

  • Ashley himself says you don’t need delta time there!

    During the aiming stage and trajectory calculations, delta time is irrelevant. You only need it after firing the projectile to adjust its speed.

  • im_pro_viz An average of dt would be the same as time/tickcount.

    I agree with R0J0hound - you don't need to use dt at all in your case.

  • Other options are: dictionary, array, static local variable, an instance variable on a global object.

  • if we do the same for “round”, this method also shows itself well.

    Yes. But floor(random(0,6)) is easier to type and understand than round(random(-0.5,5.5))

  • choose(0,1,2,3,4,5) = round(random(0,5))

    igortyhon

    No, that’s not correct. The correct expression is int(random(0,6))

    choose(0,1,2,3,4,5) = int(random(0,6))

    Using round(random(0,5)) skews the distribution — both the lowest and highest numbers in the range will have a 50% lower chance of appearing compared to the others.

    See this demo:

    dropbox.com/scl/fi/kpnbq43gc6786r9blg7xn/RandomDemo.capx

  • Can you show your code, or share the project file?

  • In most cases, you don’t need For Each because the engine automatically loops through instances. For example,

    Enemy: Set HP to random(50,100)

    This will assign random HP values to each enemy instance, not the same value to all.

    However, you do need For Each if you specifically need to process each instance separately. For example:

    For Each Enemy → Call Function DealDamage(Enemy.UID)

    Without For Each, the function would only be called once for the first enemy instance.

    Another interesting fact I only recently learned: when multiple objects with multiple instances are referenced in the same event, the engine tries to process them in pairs.

    For instance:

    Enemy: Set size to Box.size

    This works fine if there’s only one Enemy or one Box. But if there are multiple instances of both, the engine will match them like this:

    • Enemy(0) → Box(0)
    • Enemy(1) → Box(1)
    • Enemy(2) → Box(2)

    Once it runs out of Box instances, it loops back to the beginning, meaning Enemy(15) might get Box(0)’s size.

    To avoid this, you’d need a For Each loop or another way to pick the correct instances.

    .

    Here’s a more obscure example of the same issue. Since the "On Timer" event picks both Tree instances, the engine compares Leaf.treeID with Tree.ID in pairs. As a result, some of the leaves are not picked.

    A "For Each Tree" loop is needed here:

  • So far, I have found this method: dividing time by tickCount. It seems much more stable.

    For what purpose? Where do you use this value?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi Tom,

    There's no notification again.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 280 followers

Connect with dop2000

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies