dop2000's Recent Forum Activity

  • First of all, remove all "Trigger once" conditions from all events. You are using them wrong and this way they will only introduce bugs.

    Do you need to shoot each banana multiple times to destroy? Then "hit" or "health" instance variable needs to be defined on the banana sprite.

    Let's say each banana needs to be hit 3 times:

    For each banana : Banana add 1 to hit
    	Banana hit=3 : Banana Play Animation "boom"
    
  • No, NWjs plugin only works in NWjs export. You need to use Local Storage.

  • Try running the game in debug mode and check what's going on. If both Platform and MoveTo behaviors are active at the same time and both try to move the object, this may prevent "On arrive" event from triggering.

  • According to the documentation:

    So you need something like this:

    .

  • If you are exporting your game for desktop using "NW.JS" option, then you can add NWJS object to your project (the same way you add other objects like Mouse, Touch etc.)

    And then use NWJS Write File action.

  • Use "Browser Invoke Download" action if it's a browser game, or "NWJS Write File" in NWJS export.

  • It's difficult to understand the problem without a project file. But my guess is you need to regenerate the obstacle map for Pathfinding, after changing the Tilemap. Use "Regenerate map" or "Regenerate region", then "Wait 0.1", then "Find path"

  • I don't know Javascript that well. I think you can do something like runtime.GlobalVars.forEach(....), and compare prefix.

    But like I said, there is no way to get the default value for each variable, so you can only reset them all to 0 or "".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Code will detect the variables declared in the current event sheet and reset only them

    No, this is not possible, because global variables are not really assigned to event sheets.

    Maybe if you add a specific prefix to a group of variables (for example EnemySpeed, EnemyDamage), you will be able to loop through all variables with this Enemy* prefix in a script. But still I don't think it's possible to get their default values to reset them to.

  • Local static variables are similar to global, but you can't reset them all with one action.

    If you need lots and lots of variables, you can use a global object (invisible sprite) to store them. This way if you need to reset them, you can destroy and recreate the sprite.

    You can have several of such "dummy" objects, for example one to store variables related to game settings, another to store game statistics/scores etc.

    Or use dictionaries.

  • jobel Variables placed inside a group will become local. Local variables are reset on every tick, unless they are set as static. And there is no easy way to reset all static local variables. So OP will still have to reinitialize each such variable individually on start of the layout.

  • I've tried the persist

    And you were on the right path, but you needed to add "Timer is NOT running" condition to the first event.

    Question with global objects that text box will take up that space on all layouts and how can I stop the running timer, lets say the user went to a home page?

    You will have to destroy this text on all other layouts. I don't like Global objects, but they may be useful sometimes.

dop2000's avatar

dop2000

Online Now

Member since 26 May, 2016
Last online 18 Oct, 2026

Twitter
dop2000 has 280 followers

Connect with dop2000

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies