dop2000's Forum Posts

  • If the boxes should not move, simply set them as immovable.

    If they need to be moving, it may be difficult to get rid of that twitching. You can try experimenting with settings like elasticity, friction etc. Or briefly (for 0.1 seconds) set them immovable with an event, maybe this will calm them down..

    If your main concern is the gap, you can decrease the size of collision polygon in the box sprite by 1px at the top of the box.

  • I suggest using Tween instead. Here is a demo

    dropbox.com/s/z52d010zta1fvkv/TweenValue.c3p

  • Your link says "Access denited".

    Here is a simple demo:

    dropbox.com/s/qlyw8d44vz8zfbo/MoveToCell.c3p

  • It's not clear what exactly is your question. The easiest way to move a sprite to a certain distance is with MoveTo behavior.

    Since your game is played on a grid, you can also try TileMovement. There are example templates in C3 you can check.

  • You can save the active instance UID in a local variable, then do this:

    System Pick All Sprite
    System Pick Sprite by evaluate Sprite.UID<>savedUID
    

    Or, if you need to still have the original instance picked, you can add this sprite to a family. This way you can pick one instance of the sprite and the remaining instances of the family, and work with them all in the same event.

  • Can you dig in rectangular blocks? This way you could use a tilemap with large tiles, which will not have performance issues. Check out this example:

    dropbox.com/s/8zap7yuhwdb0pcb/Farming_TileSet.capx

    It's for top-down view game, but you can use the same method for platformer ground. Left-click to dig, or press R to randomly change all tiles.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to give more details about your game. Is this a platformer? What do you do with the tunnel?

    The example I gave you is for a fully destructible terrain. If you need to dig in blocks or in a straight line, there may be other and easier options.

  • You don't need to close the file. You can destroy JSON if you want, but it's not necessary either.

  • A large tilemap with 1x1 px tile size will be bad for performance.

  • It's possible to do this with a tilemap, but this method will only work with small levels. Here is an example:

    howtoconstructdemos.com/create-a-destructible-terrain-as-in-scorched-earth-with-a-tilemap-capx

    You can use the same tilemap as a mask for your ground sprite. Check out the official "Blend modes" template in C3

  • JSON.Parse, then set a variable t to JSON.Get("datetime")

    Then you can extract year, month and date from t using left() and mid() expressions.

    For example:

    Set year to int(left(t, 4))

  • MovementX expression only works with mouse pointer lock (useful in 3D games).

    What you need here is save click position in a variable

    | Global number clickedX‎ = 0
    + Mouse: On Left button Clicked
    -> System: Create object Sprite on layer 0 at (Mouse.X, Mouse.Y), create hierarchy: False
    -> System: Set clickedX to Mouse.X
    
    + Mouse: Left button is down
    + Sprite: Sprite = 0
    -> Sprite: Set width to Mouse.X-clickedX
    

    If your game is grid-based, I suggest using a tilemap instead, and draw walls on the tilemap.

  • "Else" event will not work correctly with multiple enemies. Instead of Else use "Enemy has NO LOS to player" condition.

  • I think the problem is with "Wait 2 seconds" action. You should never use Wait in events which run on every tick. This creates hundreds of delayed threads for each enemy. And even if this enemy gets LOS to the player, those delayed threads continue firing..

    Add a "state" instance variable to enemies and use Timer behavior instead of the wait.

    When enemy is in "chase" state and no longer has LOS to the player, switch to "patrol" state and start a timer for 2s. In the timer event find a path to last known location.

    When enemy is in "patrol" state and gets LOS, stop the timer and switch to "chase" state.