But if the player mutes the sound and restarts the level, it stays muted — unless the player manually unmutes it.
They probably mean that sound settings should be saved between game sessions. If you mute the sound and close the browser tab with the game, the next time you open it - the sound should already be muted.
The easiest solution is to use min() expression.
Set betAmount to min(betAmount, totalMoney)
or clamp if you also want to prevent negative values:
Set betAmount to clamp(betAmount, 0, totalMoney)
.
Check out the documentation, there are lots of useful expressions!
construct.net/en/make-games/manuals/construct-3/system-reference/system-expressions
See the comments here:
github.com/Scirra/Construct-bugs/issues/8576
If you limit the fish’s turning angle so it can’t make sharp turns, and its body is shorter than the turning circle (i.e. the path it would take to complete a full turn), then it won’t be able to overlap itself.
You can make a list and create objects by name.
Variable list=apple,banana,plum,orange Repeat tokencount(list) times Create object by name: tokenat(list, loopindex, ",")
Develop games in your browser. Powerful, performant & highly capable.
I had to click save several times on each project in order for the save icon to deselect and construct to allow me to close
This actually has been happening for me in the past few days - the save icon stays active for about 20-40 seconds after saving. Maybe the fact that you clicked it multiple times broke something in the project..
You can try sending the project to Construct support email. Don't forget to attach all used addons.
Just to add some additional information — in that example, the JSON contains an array of books: "books":[...] This approach works well when you have many books. However, it's not necessary to store data in arrays when using JSON. In fact, I rarely do that.
For example, if you want to store stats for different weapons in an RPG game, using an array means you'll have to iterate through it every time you need to find a specific weapon:
{ "weapons": [ { "name": "Short Sword", "type": "melee", "damage": 8, "range": 1, "weight": 3 }, { "name": "Longbow", "type": "ranged", "damage": 12, "range": 10, "weight": 4 }, { "name": "Fire Staff", "type": "magic", "damage": 15, "range": 6, "weight": 5 } ] }
To find a weapon you will need to loop thought the array:
JSON For Each element in "weapons" JSON compare ".name"="Short Sword"
It's much easier to store each weapon as a separate object instead:
{ "short_sword": { "type": "melee", "damage": 8, "range": 1, "weight": 3 }, "longbow": { "type": "ranged", "damage": 12, "range": 10, "weight": 4 }, "fire_staff": { "type": "magic", "damage": 15, "range": 6, "weight": 5 } }
Then you can access any weapon and its stats directly with a single expression, for example:
JSON.get("fire_staff.damage")
And of course objects can contain nested objects and arrays:
Did you update any addons?
I can still open earlier versions of my file from yesterday
Can you run an experiment? Open an earlier version of the project in the latest beta, save it, and see if you can open it after that. (make a backup copy of course first)
I posted this link in your previous topic, did you see it?
howtoconstructdemos.com/match-letters-game
There are only 10 events with comments, easy to study.
If that's not what you are looking for, then try searching for tutorials, for example:
construct.net/en/tutorials/creating-memory-match-game-148
Use Timer behavior - start a timer for 2 seconds. While the timer is running, ignore any damage.
Or you can set a variable Invincible to true. Start a timer and on timer event reset it back to false. Add a condition "not Invincible" to all events where the player receives damage.
Run the game in Debug Mode (Shift+F4) and find that sprite in the list of objects on the left. You should be able to see what's going on, perhaps it's invisible, or hidden under other objects.
Assuming the image is on a DrawingCanvas:
-> DrawingCanvas: Save image (PNG, quality 100, offset 0, 0 size 0 x 0)
-> System: Wait for previous actions to complete
-> Browser: Invoke download of DrawingCanvas.SavedImageURL with filename "image.png"
Have you tried Paster plugin? It's similar to Canvas, and as far as I remember, it works well when pasting on every tick.
Also, try moving the pasting events to the bottom of the event sheet.
By the way, I'm using Construct 2.
You should've mentioned this in the subject. Canvas in C3 works completely differently.
Check out this example
howtoconstructdemos.com/create-a-reflection-with-water-effect