99Instances2Go's Forum Posts

  • Pick the 'self' & that 'object'

    Compare 2 values .... distance(Pickedself.Y,Pickedself.Y,Object.X,Object.Y) ... > ... 2

    ______ lerp (dt corrected)

  • How do you want it 'un-triggered' ?

    To trigger it on 'each click' it must be in a state of 'not triggered' b4 the click.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Make animTick static.

  • hrozno

    The problem is that the animation frames are never the same size, have wobbling origins, and dancing collision polygons.

    The character 'falls' during playing an animation, even when it is standing on a platform. The 'is stopped' never triggers. Either vector X or vector Y is always shaking. As a result almost none of the build in platform triggers is reliable.

    Solution: or fix the animations,

    or use a basic sprite with the platform behavior and pin the animations (as the eye-candy) on it.

    I did choose for the last one. Once the animations are 'messed up', it is hard to fix them.

    https://www.dropbox.com/s/zlgnz0l6f3w0t ... .capx?dl=0

    Besides that, plz consider using tilemaps, instead of big sprites.

  • clamp(x, lower, upper)

    Return lower if x is less than lower, upper if x is greater than upper, else return x.

    As long as X is between 'lower' and 'upper', the result = x

    If x is lower then 'lower', the result is 'lower'

    If X is higher then 'upper', the result is 'upper'.

    Say you want to constrain the Y position of a sprite between 100 pixels and 500 pixels.

    Set y of the sprite to clamp(sprite.y , 100 , 500)

    sin(angle).

    Say you have a bullet flying at an angle. If the bullet travels 1 unit (in the direction of the angle) then it travelled a distance of sin(angle) on the Y and cos(angle) on the X.

    Easier said: To move a bullet at a angle of 60 degrees, you move it cos(60) in the X and sin(60) on the Y.

    And that is all there is to say about cos(angle) and sin(angle), except maybe that is scalable.

    If you move a bullet at x= cos(60) * 50 & y=sin(60) * 50, it still moves at an angle of 60 degrees, just 50 times faster.

  • On any finished

    Compare 2 values "Shoot" = left(Sprite.AnimationName,5)

    Is playing

    "Shoot" = left(Sprite.AnimationName,5) ? Sprite.AnimationName : "" ----<---- fill in the animation field

    On finished

    "Shoot" = left(Sprite.AnimationName,5) ? Sprite.AnimationName : "" -----<---- fill in the animation field

  • Oh wow! I was reading the event page wrong this whole time, thank you.

    I never thought to reference the waypoint in the condition.

    Once you get the hang of it, you will love it.

    There are still some quirks to overcome. But those you meet when its time.

  • "Shoot" =? left(Sprite.AnimationName,5)

  • DevinMurray

    Coming from Unity, you got to 'forget' a few things.

    Plz read this first: https://www.scirra.com/manual/75/how-events-work

    I changed some things in you capx.

    https://www.dropbox.com/s/ybj6p5mf1tnee ... .capx?dl=0

    If you have read that 'how events work' then i can introduce you to the 'picklist'. Do not read conditions as 'if this .. then that'. Read them as 'what do they add/remove from the 'picklist'.

    If you look at my capx, to event nr 4. This reads as ...

    Pick each instance obj_enemy one by one. The picklist contains now that one obj_enemy.

    Add all instances of obj_waypoint's who's instance variable 'BelongsTo' is the same as the instance variable 'Owner' for the previous picked obj_enemy to the picklist. The picklist contains now that one obj_enemy instance + 4 obj_waypoint instances.

    Pick from the previous picked obj_waypoint's the one instance with instance variable 'order' = zero. The picklist contains now one obj_enemy + 1 obj_waypoint

    The action(s) now work only with those two instances of the two sprites in the picklist.

    That is, in a nutshell, the base of C2.

  • Is the main character on the same X/Y coordinates when you start with layout 1 and go to layout 2 ... compared to starting in layout 2 ?

    Is the main character global ?

    Are you aware of 'Unbounded scrolling' ?

    https://www.scirra.com/manual/67/layouts

    Do you have a global 'HUD layer' (with parallax to zero, as should) that sits in layer 1 and auto creates in layout 2 when changing from layout 1 to layout 2?

  • If you use a tilemap, and you should, then the tilemap has expressions to help you.

    PositionToTileX(positionx)

    PositionToTileY(positiony)

    Convert an X or Y layout co-ordinate in to the corresponding tile number in the tilemap. For example, this can be used to get the tile position under the mouse.

    SnapX(positionx)

    SnapY(positiony)

    Snap an X or Y layout co-ordinate to the nearest tile. This also returns a layout co-ordinate, but aligned to the nearest tile in the tilemap.

    TileToPositionX(indexx)

    TileToPositionY(indexy)

    Convert a tile position to layout co-ordinates. For example, this can be used to position a Sprite object on top of a given tile.

    Using snap.

    When a box is placed.

    Set the position of the box to

    x = tilemap.SnapX(box.X)

    y = tilemap.SnapY(box.Y)

    Using the other two.

    When a box is placed.

    Set the position of the box to

    x = TileToPositionX(PositionToTileX(box.X))

    y = TileToPositionY(PositionToTileY(box.Y))

    If you dont use a tilemap.

    When a box is placed.

    Set the position of the box to

    x = (round(box.X/32)) * 32

    y = (round(box.Y/32)) * 32

    But, that will not be exact.