lennaert's Forum Posts

  • I use them quite often really, often for use custom made movements using lerp and anglelerp and sometimes the calculations are a bit off due to input or coordinates, giving negative numbers or suddenly huge numbers .. or for instance with healthbars, and a player picks up something which increases the healthbar, and to prevent a healthbar becoming to wide, I can constrain the size, i.e.

    healthbar.width=clamp(HealthVar*WidthMultiplier, 0, 100)

    Making the formula to determine the width of the healthbar never go into a negative size or over the maximum allowed width. (player gets more damage then has health)

    The "dt" bits can really make a difference across devices with varying performance, so they all look the same and or move the exact same amounts.

    60 * dt = 1 second

  • Example

    A value which is suposed to be between 50 and 100. And occasionally you get a minus value or in the multiple 100s.

    Clamp (value, 50,100)

    So in effect yes, your framing the allowed value between 50 and 100.

    Value = -50 makes it 50

    Value = 1000 makes it 100

    I didn't look at your events but from what I read from 99instances to go there was another issue.

    An application of clamp could have been something along:

    × = clamp( lerp(Self.X,CanvasX,6*dt), 0, CanvasWidth)

    Which would return a value which actually exists within your canvas x coordinates.

    Note I used 6*dt which is the same as your 0.1; but the 6*dt makes the lerping framerate independent.

  • Whenever my lerps causes issues with odd values I use clamp () to prevent excessive values.

    clamp (the_value, min_preset, max_preset)

  • Great concept ... Just runs incredibly slow on mobile.

    Took like 30 seconds to make it half way the screen.

    Perhaps try and apply delta time for movement and such.

  • Ran into this issue earlier too, parralax effect not showing in pasted objects.

    R0J0hound, any ideas ?

  • Did you try it without the extra conditions ?

    Your response appears to be zero, but the second condition requires it to be higher or equal to 3.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • click somewhere in the layoutview on a blanc space and in the left window will show an option to increase layout size

  • Rex Pushout solid

    Unziip and place the folder in construct2/exporters/html5/behaviors/

    restart c2 and add the behavior to the zombies.

  • If you have multiple windows open, and you restart preview, it generally should reload all windows, if not, press restart preview again and it should.

    It actually goes pretty quick ....

  • Am at work arm so can't check for you.

    There is also a plugin on the forum somewhere called "pushout solid" which makes the application a lot simpler.

  • Add the behaviour Custom movement to the zombies, and use the function action pushout solid when overlapping

    You can also spawn zombies outside of the Viewport or at a certain distance from the player (player.X +1000 for example)

    Automatically generating levels for infinite layout style can be found in the infinite runner example

  • In your project properties, set the "First Layout" to your desired layout

  • 1. Add a subevent event to the mouse click, add system compare 2 values, player.count > 0 (will not work as intended for actual multiplayer obviously)

    2. Make the zombies solids and use the custom movement behavior with Push out solid

    3. Use invisible spawning objects/sprite and spawn on those objects

    4. You cant, I believe the max is 100kx100k atm (most likely more then enough) Or , you have to make an infinite scroller type of thing where layout stuff is generated around you as you "appear" to move closer to them

  • Hit Ctrl + Shift + N with chrome opened

    This will open an incognito browser,. you can open as many as you like, great for multiplayer testing

  • Did you rename the ajax object to "score" ??

    if not, rename int(score.LastData) to int(Ajax.LastData)

    EDIT: nvm

    Just noticed you did.

    Check your console for the ajax request response and see if you actually get a value from your request