MultipleChoice's Forum Posts

  • Vanz

    All right man, after your PM I took a quick attempt. Obviously, there are many many different ways, this is just an example... difficult to know, what you exactly need -- that might be the reason, why not many people started to help you, I guess.

    But there you go bro, have fun, I hope it helps you out!

    Good luck.

  • blackhornet : ok man, I got it... thanx

  • No there you have to count too much.. I now think of len(), i tried that, but that also needs a loop to fill up each missing character at the end with a 0.

    Still looking for a more effective solution!

  • Still, I just came to an idea: It might work if I do it for each digit! If no other solution comes up, I will try that. But maybe there is a simpler way?

  • blackhornet

    Thanks, but that does not help, as I described:

    "The clock-solution does not work here, since there you always fill up zeroes from the left."

  • Hi,

    I'm looking for the simplest way to display a constant number of digits on the display, also decimals.

    "Zeropad" does the trick before the dot, but I need to fill up the decimals from behind. (The clock-solution does not work here, since there you always fill up zeroes from the left.)

    Examples:

    00.00 (= Returned Value: 0)

    01.00 (= Returned Value: 1)

    01.10 (= Returned Value: 1.1)

    01.11 (= Returned Value: 1.11)

    BEST would be a solution, where no calculation is needed (like Zeropad) to save CPU.

    Grateful for some advice

  • Actually it is easy... so nothing to dislike, I just did not get it, math classes are ages ago

    If anyone is interested:

    Since the solution is sin(pi*0.5*180/pi), which us equal to sin(x*90), just multiply any value x by 90 placed into the sin function to get the rad value...

    It is nice to use instead of easing (e.g. a fade or motion) with a plain lerp function, since you can predetermine the exact time duration of the fading.

    Just use

    lerp (MinValue, MaxValue, sin(TimeEllapsed*90*1/FadeDuration_in_Sec))

    Cheers

  • Kyatric True that, thanks.

    To be honest, I don't like it this way too much. I still think it is most of the times way more handy the rad-way to be used as a math function...

    However, most important is, it works. Thanks once again for the clearance!

  • Hi guys,

    I am confused, since I would like to use a simple calculation sin(x), but it does not return the values I expect at all.

    sin(1*pi*0.5) should be in my understanding (and is indeed on all calculators) 1.

    If I let that calculate in construct, it gives me back an odd number: 0.0274121336

    Please help me, whats going on. And why? How can be a common sin(x) function something different here?

  • Thanks.

  • Hi,

    since my game is built of sprites and tiles, I wondered if it would run faster, if I convert it all to tilemaps.

    An advantage seems to be some spritesheet optimization and less objects in the layout.

    On the other hand - it seems - I cannot reduce collision-checks as much, as with separate sprites/tile-backgrounds.

    The reason: Since tilemaps are checked for collisions each tile, as they have separated collision-polygons, the number of collision checks is just as high, as if each tile would be a separate object. But separate sprites/tiled-backgrounds can be turned off (solid and collision) when not in range, which cannot be done with separate tiles on one tilemap, or am I wrong?

    So is it really worth using tilemaps instead of sprites/tilebgrs performance-wise?

    Please give me some advice.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Getting better and better... makes me happy

  • animator :

    Your question is a bit complex, because the solution depends on how you solve the ball.

    Physical concept:

    To make a ball drift in a curve, you need to hit it off-center (can be also angled). It gets a spin through that. The spin causes the sideways-offset, since the air flowing around the ball has different speeds (thus density) on each side, so like a plane takes off, the ball goes sideways, because of air pressure differences. The bigger the rotation, the stronger the curve. (If there is no wind and you hit the ball in the middle it will not spin much, and you shoot quite straight.)

    So you could detect an offset of the hit from the center-point of the ball - the more offset, the more you let the ball fly sideways (You can also give it a rotation speed according to that, if you want realism.).

    The only question is, how you let the ball fly? A behavior?

  • danuyos , Like this basically...

  • One more lerping-trick on anlges, if anybody is interested: