Headbang Games's Recent Forum Activity

  • After picking the 9 or more instances add a sub event

    Repeat -> 6 times

    Pick nth instance -> loopindex

    Set boolean selected -> true

  • Sure, no problem.

    I wasn't aware of the "all sets complete" trigger, it's pretty new.

    Though keep in mind that this will only work if all your sets are fired at the exact same time, most likely from the same event, if there is any delay between them, they might not get batched together, then the all set will trigger multiple times.

  • First of all, if this is not a subevent of a taking damage function/event you should put a "trigger once" on it, otherwise it will run a whole bunch of times.

    To make sure everything is saved you need to move the wait 5 seconds and everything below that to when the "item set" is triggered (though in general 5 second should be more than enough to save everything, which is a bit strange).

    You can loop your saving, meaning once the first is set run the second and when that is set run the third, then do the rest.

    You can put them all in one event with a "wait for previous action to complete" after each set item action.

    But I would recommend to just push all your save data into a dictionary and just save that once with the dictionary.asJson expression.

    You can read the values directly from it too without using globals and you can clear it - same as resetting globals.

  • Yeah, the rest looks pretty much fine.

    There is one extreme condition that might happen, where you manage to kill a baddie before the get complete and restored to the saved value, then it wouldn't count that one. But if you can't kill anyone in the first second or two (depends on the speed of the device reading the local storage) of the gameplay it's not an issue.

  • Any action with the clock icon is not completed instantly.

    You might be switching layouts before the storing is completed.

    You need to wait for the "item set" trigger to happen before allowing switching/restarting layout.

    Also the line baddies=>500 will trigger constantly when it reaches 500, add another valuation if unlockedYce = 0

  • Here's an idea I think may work if you're looking for instant real-time feedback you're going the wrong way...

    1. Add a fence on at least one side of your track (or just an invisible sprite)

    2. Add a unique sprite on the left and a unique sprite on the right side of your car.

    3. Assuming the wall you added will always be on the left if you're going straight - Every tick check if the left side sprite on the car is closer to the wall than the right side sprite.

    I would think the left side of your vehicle should always be closer to the left side of the track if you're going the right direction, right?

    Of course you can add extra layers of checks like if the right side is closer for more than X seconds, or elevation checks if your track overlaps...etc. this might prevent some glitches.

    A little tip.

    My rule of thumb is to use every tick only when it is absolutely crucial for gameplay and mechanics. Especially when it comes to picking instances from a large batch.

    You can check for this once a second or even more and still get a good result for your needs.

  • I took a quick peek into the Race Track example.

    You have the road sprite there, and they are pointing in the direction the car should be moving.

    So you can check if the car is not between that angle -X +X

    Though you have to make sure you're always setting the right angles for the road, when building new tracks.

  • It is possible that your bullet is too fast and is missing the collision with the wall.

    Try enabling the "Step" property in the bullet behavior.

    Either way, I think using tilemaps and the tile based movement for this would be better for you.

    Some other movement behaviors are set to no go through objects with "solid", so that is also an option to try.

  • It really depends on your game.

    If you just need to save some variables to restore the state, use a dictionary/json/array and save that to file.

    If your layouts changes dynamically with lots of objects changing states, use the save system.

  • I don't recommended saving the local storage directory directly.

    It contains lots of files and they are user/browser based and possibly won't work well for syncing.

    I write the save data to the "current user document directory\gamename"

    You can get the url to that with the NWjs plugin.

    I simply write it with the "write text" action of the NWjs plugin, never had any issues (my save files are usually under 1mb).

    Though that was before the binary plugin was released, so it's probably safer to use that (especially if your save data can get very big).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use the "File system" or "File chooser" plugins to load up local files.

  • I usually don't do Mac exports, but I always do a Linux version (statistically there are more Linux Steam users than Mac), especially nowadays with Steam Deck.

    I haven't tested WebView2 yet, but I think there are a few main things to consider:

    1. The obvious Steam overlay and SDK support.

    2. File handling should have more features. Getting the OS %USER% and %APPDATA% directory and saving/loading files directly to them without having to select the folder manually.

    This is crucial for Steam cloud save support and for managing local game data.

    3. It should work well with video capturing apps, such as OBS and the built-in Nvidia recorders. I'll point out that capturing from NWjs is smoother than from a chrome browser. Not sure why that is.

    4. Control over the window, such as setting the window size or starting the app maximized.

    5. Fullscreen command should work without user input.

    Last but not least, performance should be at least equivalent to NWjs.

Headbang Games's avatar

Headbang Games

Member since 5 Dec, 2012

Twitter
Headbang Games has 1 followers

Connect with Headbang Games

Trophy Case

  • 11-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies