Yann's Forum Posts

  • if you do a

    set scroll to lerp(scroll,player,dt)[/code:29x80mzq]
    
    just use a variable as intermediate.
    [code:29x80mzq]set scrollVar to lerp(scrollVar,player,dt)
    set scroll to scrollVar[/code:29x80mzq]
    
    Then you can easily add any noise you want on that
    [code:29x80mzq]set scrollVar to lerp(scrollVar,player,dt)
    set scroll to scrollVar + random(-20,20)[/code:29x80mzq]
    
    (note: I didn't split things into X and Y... I'll let you do that )
  • You do not have permission to view this post

  • Maybe you can:

    • store the current velocity of the object in variables
    • teleport the object
    • set the velocity to 0,0 to avoid weird behavior
    • and then reset the velocity as it was next tick.

    If you have some rotation you might need to store/lock/reset angular velocity as well.

    Never tested though

  • Hmmm you can always set a timer (global/instance variable) when you play a sound, you increment it and when this timer variable reach a specific value you stop the sound. (But you should preload it first to be sure it's as sync as it can be)

    Global number timer = 0
    +On what you want
      -> Audio: Stop sound tag "mySound"  // to stop the sound if you don't want two sounds playing at the same time
      -> Audio: Play sound tag "mySound"
      -> System: set timer to 5
    +System: Every tick
      -> System: set timer to max(timer-dt,0)
    +System: timer = 0
      -> Audio: Stop sound tag "mySound"

    Should work

  • did you try audacity?

  • Could paste all your game into a canvas object (see plugins). (that's for the snap part)

    For the sharing part you need a way to send image data in an ajax query. But as the default Ajax object use Get method I don't think you have enough room to send any screen size image.

    There's an Ajax plugin that use POST method somewhere in the plugin list but you still need a way to convert your canvas into image data and probably a php page to interprete it.

    And remember. I can be totally wrong with the sharing part but for the snap part that's how I would do it.

  • But you can still do that

    sineSwitch.capx

  • open your sound files in Audacity and file > export "WAV (Microsoft) signed 16 bits PCM"

    c2 should import them properly.

  • Or use another object for the "death" animation. An object that isn't set to collide.

    Or use a boolean on the object itself, if the boolean is set to true, don't hit.

    As far as pretty things goes like fx you have to wait for the scirra team to decide when it will be the time to add them. As it will probably be a webGL only feature, and for now they keep the c2 into a canva 2D/WebGL compatible state.

    draw box/circle/ etc ... yeah missing that kind of plugin, but you can still do some stuff with canvas (:

  • randomAngledArea.capx

    What I wrote earlier works fine for me...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It depends. If it's just the simple mecanisms (detecting right/wrong moves, winning/losing condition), It's fairly easy.

    If you're talking about game AI to play against. I becomes way harder.

  • Be carefull, the layerangle is a bit tricky. I would advise to not use it, especially if you use scrolling. It behave pretty weirdly.

    I think that Ash did say somewhere that it's not the layer that rotate but something like, rotate layout -> paste Layer into main canvas -> rotate back. So event layerangle is reversed...

  • newt

    well, it's really generate a random point and then take it's angle AND distance from the origin.

    It's not just a random angle

    it's not just a random distance frome the origin

    it's not event a random angle and a random distance, 'cause you have to stay within the rectangle boundaries. If you take a random angle and then a random distance from the origin (from 0 to how much?), you can't be sure you are within the rectangle. Angle and distance are linked to discribe a specific point.

    So it's really a random point you convert into distance and angle from origin -> rotate -> translate.