dop2000's Forum Posts

  • Tile size is 16, pathfidning cell size is 32, that's why it doesn't work. Put 16 or less.

    Also, never use "find path" on every tick! Change it to "Every 1 second", or only search for path when the sprite is not moving.

  • If you remove the delay, I think the platform gets destroyed before your character lands on it. Try using "On landed" event instead of "Is Overlapping at offset".

    If it still doesn't work, try "Wait 0" to wait just one tick.

  • Please post your capx, or a screenshot of your event sheet.

  • Black tiles should be empty (erased), or without the collision polygon. Also, you need to properly set cell size and border for Pathfinding.

    I suggest you try EasyStar.js addon.

  • You need NWJS. You can check if the file exists in NWjs.AppFolder, NWjs.ProjectFilesFolder and maybe NWjs.UserFolder&YourGameFolder

    If the file is not there, just display a message that the file is not found. Because searching the entire PC is a difficult task and will take a very long time.

  • You need to set only some tiles on the tilemap, leaving other empty. Or remove collision polygon from tiles that should be walkable. Check this demo:

    howtoconstructdemos.com/using-an-invisible-tilemap-as-an-obstacle-map-for-pathfinding-capx

    I also highly recommend this addon, it's optimized for tilmaps and works better and faster than the official Pathfinding behavior. And you can specify which tiles are walkable there:

    construct.net/en/forum/extending-construct-2/addons-29/behavior-easystar-js-pathfindi-96215

  • Here you go:

    dropbox.com/s/2izh7wqm1hs4hqa/HP%20Change%20-%20using%20TWEEN%20-%20TEST%20.c3p

    I used Bounce easing for fun :)

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You can also try Tween with different easing options.

    Every time the health changes (increases or decreases), restart the tween for healthbar width. End value: maxWidth*(currentHealth/maxHealth)

  • HP is drained in the first event, 4 points at a time. In your game you'll of course have a different event for this.

    The expression for health bar width explained:

    lerp(Self.Width, 300*(hp/60), dt*2)

    Self.Width is the current width. 300 is the initial width (at full health). 60 is the maximum (full) health value. dt*2 is how fast the bar will react to health changes.

  • I made this for another post:

    dropbox.com/s/tjowni4xr1fgkc9/Healthbar.c3p

  • You are creating 4 instances of Sprite2 at the same time. How Sprite is supposed to find path to all four of them?

    One pathfinding instance can have only one active path. If you tell it to find another path, the previous path will be lost.

    Also, Find Path is an asynchronous action. Depending on the map size and other things, it may take different amount of time to find path for different objects. That's why you see only two "a" in the text. On a slower machine or on a larger map it will be just one "a".

  • You do not have permission to view this post