Headbang Games's Forum Posts

  • 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).

  • 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.

  • As far as I know you can't set/read a string value with an exported string, you need to reference the string by name directly in your events. It might be possible with scripting, though I haven't tried that.

    I would recommend you use a dictionary to store all your strings and values, then you can easily set/read them with a string. By splitting the text using tokentat based on spaces.

    tokenat(strVar,0," ") will get you the string name

    tokenat(strVar,1," ") will get you the valuation

    tokenat(strVar,2," ") will get you the result

    Then you can use dictionary.get(tokenat(strVar,0," ")) = tokenat(strVar,2," ")

    Since you can't also inject a valuation string and need to directly write it in your event, you would probably need to do a separated check for each type of evaluation.

    if tokenat(strVar,1," ") equals ("==") >

    Dictionary.Get(tokenat(strVar,0," ")) = int(tokenat(strVar,2," ")) ? "correct" : "incorrect"

    if tokenat(strVar,1," ") equals (">=") >

    Dictionary.Get(tokenat(strVar,0," ")) >= int(tokenat(strVar,2," ")) ? "correct" : "incorrect"

  • Works just fine for me.

    You probably did something wrong...

    Try this (rename zip to c3p after download)

    https://headbangames.com/html_background.zip

  • You basically can't.

    Any DOM object, like html, text input, buttons, lists, etc is not rendered inside the canvas but on top of it.

    That being said, if the html element is just a background element, you might be able to make your layout background transparent (all layers need to be transparent) then manually change the Z index to bring the canvas above the html object (html z-index 0 canvas z-index 1, and you'll need to add a position to the canvas (relative/absolute).

    Alternatively you can set the html z-index to -1, but then you will need to set the body background to transparent.

  • You can try adding the "On changed" condition for the textbox.

    If you don't need to continue showing the text after validation, just clear the textbox.

  • You can scroll the offset of a tiled background image, just use that.

  • You are welcome to contact me (email or socials) so we can discuss the details.

    https://headbangames.com/devblog/contact

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You probably have the "set angle" property enabled on whatever behavior you're using for movement.

  • Set the animation speed to a negative number and the repeat-to frame to the last frame instead of the first frame.

  • You are welcome to contact me (email or socials).

    https://headbangames.com/devblog/contact