dop2000's Forum Posts

  • Well, the best solution is to add enemy and gun sprites into a container.

    Without the container you will need two separate events - Bullet on collision with Enemy, and Bullet on collision with Gun. And in the second event you will need to pick the Enemy instance which the gun belongs to.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you need to stop both child and parent loops, add two "Stop loop" actions.

  • Is enemy gun sprite added to the same container with the enemy sprite? If not, this would explain why all enemy instances are picked when bullet collides with a gun.

  • Who knows, maybe there was some glitch with saving the project. Make sure to create backup copies, or configure automatic backup in C3 settings.

  • Most people use this tool to make spritefonts:

    construct.net/en/forum/game-development/tools-and-resources-27/sprite-font-generator-v3-64038

    It will generate spacing data for you.

    Even if you prefer the spritefont you made yourself, you can try recreating the same font with that tool and compare the spacing data string to see where you made a mistake.

  • That's a dictionary. Add a new Dictionary object and rename it to StorageData or some similar name.

  • Like I said, TileToPositionX() expression requires tile number. It won't work if you use Sprite.x as a parameter.

    You can do this:

    TileToPositionX(int((Sprite.X-Tilemap.X)/16))

    but it will be the same as SnapX(Sprite.x)

    .

    If you need to get tile number (or index) for a given position, use PositionToTile expressions.

  • Is there any alternate way to be able to preserve the saves if user choose to ?

    In NWJS export you can save game to a disk file. But if you need a cross-platform solution, then I think the only way is to use some cloud service like Playfab or Firebase.

    I am currently using the save/load feature which is working fine, except that I am unable to clear or include a new save.

    It's not possible to delete a saved slot. What you can do is use it in combination with Local Storage. Save a flag in Local Storage - "GameIsSaved=Yes/No". On start of your game load this flag, and if it's "No", then simply ignore the saved slot, don't load it.

    Also I realized that if I publish new version of game with a different name for the save

    Why do you change the save slot name? Unless you've made significant changes to the project, the old saved state should be compatible. With Local Storage you should also use the same key names when publishing a new version.

  • TileToPosition expression takes tile number as parameter, not a layout coordinate. You probably need SnapX/SnapY expression here instead.

  • It may be a long and difficult process, but I would try to find a pattern to these freezes, or a reliable way to reproduce them. After that you can start investigating into what may be causing them and how to fix them.

    Try running the game on an old slow PC or in debug mode, see if it makes the issue worse.

  • For storing a few values definitely go with Local Storage, it works on any platform. I have a simple example:

    howtoconstructdemos.com/easily-save-multiple-values-in-local-storage

    Note, that it's local, which means that the save will be lost if players uninstall your game or clear browser data in a browser version.

  • I believe in Chrome you need to clear "Hosted app data", not just the cache.

  • Looks like some files in the project are missing or corrupted.

    Check the files mentioned in the console error messages, for example gg_anim-faling-000.png

    If this file exists, try opening/saving it with a program like Paint. Or try restoring it from older backups, or replace it with another file of similar resolution. See if it makes the error message in the console to go away. Do this for other files.

  • Not sure I understand the question.

    If you are spawning the same sprite, then why destroy one and create another? Simply change the animation frame on it.

  • I usually do this by inserting tags into text. For example:

    "Hello, %playername%! You have %coins% gold."

    Then replace these tags before displaying the text:

    Set t to replace(t, "%playername%", Player.name)

    Set t to replace(t, "%coins%", NumberOfCoins)