mindfaQ's Recent Forum Activity

  • Hmm, one's I played quite a bit:

    • Protector III (TD)
    • Gem TD (TD)
    • Kongai (CCG)
    • Fantastic Contraption (physics game)
    • Super Stacker (physics game)

    Yeah... those are the ones I remember.

  • The only thing you need to understand about LocalStorage contrary to WebStorage is, that data is fetched asynchronously, meaning on one tick you may get or set data, but it will not be immediately available in that tick, like it would with the webstorage.

    When getting or setting the data is finished, localstorage will trigger the "on item 'x' get" / "on item 'x' set" etc. events, so you use those events to do the followup actions (like setting the highscore variable to the highscore data from the storage)

  • this is the LocalStorage equivalent of your code:

  • Next update, this time 100 events are reached.

    version 0.8; current number of events: 100

    download .capx

    Preview

    changes:

    • switched from WebStorage to Localstorage - this used up some extra events
    • save and load buttons are disabled now, when no appropriate save slot is selected
    • music, voice and sfx volume global values added (to be later set up in an options menu, or by the user in the event sheet)
    • sfx and voice volume can additionally be modified by the script; forgot to set it up for music as well, will do so later
    • each hud button now has its own animation, it'll be possible to use animated buttons and it's more easily understandable where which button should be placed, when one wants to modify it
    • hopefully fixed a bug with loading
    • fixed a bug that appeared when changing images (thanks

      lipstick)

    I'll tidy up things a little and then that's probably the end of the 100 event VN engine.

    Here's an updated list of functions the script accepts (explainations in brackets if not obvious):

    • music | filename | volume (volume in added dB; so -10 makes it about half as loud; volume not mandatory)
    • sfx | filename | volume
    • voice | filename | volume (voice will be played together with the text function that came before it; it must be used after a text function or you'll run into a frozen game if I'm not mistaken)
    • character | displayname | charactertag | color red | color green | color blue | fontname (tag is used by the text function to assign a text to a character; RGB values from 0 to 255)
    • text | charactertag | text to display
    • choice | decision | value added to decision | text to display on the choice button | button coordinate x | button coordinate y (you can define tags for coordinates in the event sheet, too; I've set up xleft, xmid, xright, ytop, ymid, ybot for example)
    • wait | seconds to wait
    • background | filename (backgrounds are expected to be .jpg, but you can change that in the event sheet if needed)
    • image | filename | imageid | coordiante x | coordinate y (file extension is expected to be .png; if filename is "clear", it will destroy the image; using the same image id in your script will enable you to change an image instead of creating a new one ); coordinates are only mandatory when creating a new image
    • fadein | imageid | duration
    • fadeout | imageid | duration
    • move | imageid | coordinate x | coordinate y | duration | mode (leave a coordinate empty if no change should be applied; modes available are "skip" or "wait" - skip will continue in the script immediately, wait will continue with the script after the duration is over or the screen was touched)
    • require | on/off | decision | value (on checks if the decision's value is at least at value; if it is, script will continue normally, if it doesn't the script will skip until the corresponding "require | off" appears, imagine it working like brackets)
    • anchor | anchortag (marks a line in the script so that you can jump to it)
    • goto | anchortag (jumps to the corresponding tagged line)
    • set | decision | value (set the value of a decision; if decision is "all", all decisions will be set to value)
    • macro | macrotag (set start and end of a macro, in the lines of the macro use "/x" for a string that will get substituted by runmacro)
    • runmacro | macrotag | string that will be filled in for "/x" (runs the macro)
  • Let's say a relatively large textfile is requested via ajax. Does it make sense to clear the data by loading some small dummy data into the ajax data by requesting it to free up memory (not sure about how browsers go about reclaiming the memory thats unused ("garbage collection"))? How does the memory used up by the ajax.lastdata influence performance, especially on mobile devices?

  • Hello guys,

    how do I use the OR operator | in pick by comparison.

    I don't understand why this doesn't work:

    please note that this works:

  • :

    Would make sense to post some credentials like previous works/games you did, so people can see your abilities. Right now I would be very hesitant to buy something for money that should be free (imo) from someone that I have never heard of.

    Ha.

    Steam buyers don't get a badge either.

  • on drag&drop drop: set drag and drop disabled

  • You can only invert "is overlapping" in that case - maybe you can make use of that.

    If you wanna work around it (* = one event):

    *every tick: set colliding = 0

    *on collision: set colliding = 1

    *colliding = 0: do stuff

    since events are read from top to bottom, this should work.

  • Dota 2 ofc.

    Any one here who plays DOTA 2? I'm 5.7k, see me at SEA Leaderboards. I stopped playing about a week ago so I can focus my work here with C2.

    Me, but on EU 5k.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I added some further explainations.

  • When you drop a piece, you check for overlapping empty sprites. Since those have a collision size of 10 x 10 boxes and your game piece a collision box for 42 x 42 pixels, there are places, where your gamepiece overlaps multiple empty sprites. In that case, two or even three of the empty sprites are destroyed and only one is created -> you end up with empty spaces in your grid.

    After your overlapping condition, you could add "pick nearest empty" or (even better) compare two values: distance(gamepiece.x, gamepiece.y, empty.x, empty.y) < gamepiece.width - empty.width * 2

    This way you will end up with only one empty picked, and in the case of the distance expression, you also get some snapping back, when the game piece is in the middle of two empty pieces and when it is not sure if the user wanted the piece to drop on empty 1 or empty 2.

    And here the checking function I would have done (although I would probably input the piece information into an array and iterate over that):

    It's a bit simpler imo, you have a queue of pieces to check (starting with the exchanged piece), this looks at the pieces around it and finds pieces that have not been looked at (queued) before (status = 0); those pieces are added to the queue. When the queue is empty, you've found all adjacent pieces of the same color.

    Of course you can pack these 4 events of looking around into each direction into a for loop, but while it saves space in the event sheet, I don't think it will be faster at execution, since calculations won't get less.

mindfaQ's avatar

mindfaQ

Member since 12 Oct, 2013

None one is following mindfaQ yet!

Trophy Case

  • 11-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

13/44
How to earn trophies