dop2000's Forum Posts

  • Why do you need the array? Why not set animation simply to "ID_Card"&card_num ?

    I'm always telling people that many things that usually require arrays, in Construct can be done easier without them. I'm pretty sure you don't need any arrays here. You can generate all cards in advance, or simply put them on the layout in editor and set their animation names. See these examples:

    dropbox.com/s/b7qmdni2wn9zedn/CardHand.capx

    dropbox.com/s/mz2fdnt7g3levqp/CardHand2Players.capx

    Dealing the whole deck of cards without any arrays!

    Edit: oops, forgot to mention, you will need MoveTo behavior to open these files. It's a great addon, I highly recommend installing it.

  • This is a bit tricky..

    You can generate the size of the next sprite in advance. Say, you're spawning sprite #1 (small), and at the same moment you randomly choose the size of sprite #2 (which will be created next) and save it in some variable.

    Let's say sprite #2 will also be small. Since you know that current sprite and next sprite are both small, you can use Timer behavior to schedule next spawn event in 1 second. If next sprites is big, you increase the delay and spawn it in 2 seconds. If both current and next sprites are big - in 3 seconds. This way the distance between sprites of different size will be roughly the same.

    This was just off the top of my head, there may be other solutions.

  • The point of fetching the cpu util during each loop was to get the highest main thread across the entire loop run, without waiting for the above condition to finish.

    And I'm telling you, this is wrong :)

    cpuutilization in that loop returns exactly the same value a million times. And that value is useless, because it shows what cpu utilization was before the loop started (when the app was idle).

  • have you tried googling?? Took me 5 seconds to find.

    construct.net/forum/extending-construct-2/effects-31/effect-2-5d-platformer-109594

  • It's done using shadows. See this post for a collection of different 3D effects you can do in Construct:

    construct.net/forum/construct-2/how-do-i-18/how-do-i-make-3d-game-in-const-117027

  • Depends on the behavior you are using.

    With Platform, if you need to push the player back, you should do something like this:

    Player is mirrored -> Player Platform set VectorX to (Player.VectorX+1000)
    Else -> Player Platform set VectorX to (Player.VectorX-1000)
    

    Similar with 8-Direction - add some value to Vector X or Vector Y (or both), depending on the angle of pushing.

  • So a is the ammo in your magazine, b the "ammo in your pocket"

    Create a local variable reloadAmmo, then do this:

    Set reloadAmmo to min(12-a, b)
    Subtract reloadAmmo from b
    Add reloadAmmo to a
    
  • Just set the correct angle before pinning. You can try "Set angle towards GreenSprite" and then "Rotate 90 degrees counterclockwise".

    Or "Set angle to (angle(Self.x, Self.y, GreenSprite.x, GreenSprite.y)-90)"

  • Here is the 1000.000 loop example , you will also say that the 20% -80% difference in cpu usage

    You are doing it wrong.. There is no point in checking cpuutilization one million times inside of the loop, because the loop is done in one tick (however long). And cpuutilization will return the CPU load for the previous second, that was before the loop.

    Here is the more correct way (both events run on every tick):

    I'm getting maybe 2-5% lower CPU utilization with choose(). Yes, it's a bit more efficient, but only if you need to use it hundreds of thousands times every second. Definitely not worth worrying about if you need to spawn just one explosion.

  • Here is a very simple example:

    dropbox.com/s/uw1sg69g0hlbg3d/PushingBox.capx

    You can add more conditions to make sure the box is not dragged when player is moving parallel to it etc.

  • If you want to remove last character from the string, you can do this:

    Set s to left(s, len(s)-1)

  • Tom, you are a rock star! :)

    Thank you!

  • WackyToaster Unfortunately, many forum topics are not archived. And the latest snapshot is from March 2016, so there are no posts from the last 2 years.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I estimate that in 1,2 or 3 days maximum I(alone) would browse manually the whole old forums and post links as new posts to new forums.

    Mate, there are 649,094 posts on this forum :) Even if only 1-2% of them have broken links, it would take you weeks if not months to fix them manually.

  • Yep, working in incognito, thanks.

    What about the missing links?