mindfaQ's Forum Posts

  • some event that starts your game:

    gametime_start = time

    some event that ends your game and assigns the score:

    set score = 1000 - int(time - gametime_start)

  • Actually you only need to wait 1 tick for Construct 2 to know the correct size.

    What you could do is display the text off screen, get the measurements and only when you have them display the text on screen with your fitting background. 1 tick delay normally should not be very noticable.

  • sprite is on screen: number_of_sprites = sprite.pickedcount

  • Wouldn't it be better to shoot in an interval, with the help of the timer behavior.

    on right click:

    create bullet

    start timer "gunfire" regular for cooldown seconds

    on right mouse button released:

    stop timer "gunfire"

    on timer "gunfire"

    create bullet

    With the cooldown variable you could change, how much time it takes between shoots. Distance traveled seems like a weird choice to me in most situations. If the bullet flies at constant speed, you can calculate the time it takes to travel 600 anyway.

    Problem with your event is: on right click only triggers once, when you press the button, not when you hold it down.

  • 1) Save your equation to a string (equation = "45*31-187")

    2) add the Browser object to your project

    3) set the value of your result variable to: browser.execjs("eval("&equation&")")

    result now holds the the result of your equation.

    Generating random integers from x to y is done with int(random(x,y+1))

    The rest should be straight forward and only limited to your creativity, no?

  • If you can detect in an event when a video ends, you could just do:

    on video finished playing:

    add 1 to position

    call "run" ()

    If you have no indicator when a video finishes, but the user also has no control over the video, you could start a timer with the length of the video + some small leeway, and on this timer, you do the same actions above.

    If you want the user to be able to skip the video, ofc you need to add that functionality, too (on left click and video running -> stop video, position +1, run, something likw that)

  • "mont or monta i cant get correctly the value "mountain" " -> because you need at least 75% of the letters of the target word.

  • 1) Monospaced font (http://www.slant.co/topics/67/~what-are ... ming-fonts), can also use a spritefont, but all letters should inherit the same space (if retro is what you are going for, you probably want it to be pixelish, not smooth)

    2) Black Screen background

    3) Interpreter for commands if needed

    4) Limit input to an arbitrary subset of characters if necessary

  • Levenshtein distance is the number of operations/edits you need to do, to change one word into the other. The regularly used weighting is:

    1 for substitution (example: 1 wrong letter typed)

    1 for deletion (example: 1 letter too much)

    1 for addition (example: 1 letter missing)

    So you could say you allow 1 typo in the word, then for red stuff like this would be allowed:

    reed, ret, rad, rwd, rd, ...

    Of course you could make it reliant on word lenght, so for example forbid typos in short words, but accept one or two in longer words.

    Word suggestion is something different and would use a dictionary, preferably one which knows the frequency of words in common usage, to suggest the most frequently used word(s) that begin with the typed letters.

    Would it not be a problem in your game, if autocompletion is too strong? (it could get weird for the players if all they do is write out words half-way and then the next task already comes up)

  • https://copy.com/uYqaoQi11F4wquXg

    I still dont really get what you want to achieve with this. If you want to compensate for typos, then it would be better to employ levenshtein distance.

  • Nvm, understood it... I think.

    https://copy.com/EjoQsnxgYyJL1DYK

    like this maybe.

    it ignores upper case letters, and for each lower case letter it tests whether it matches or not, ignoring order. Then you get a number of matches and non-matches.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When you load the array from json, it assumes all information to be in string format. Convert to integer or float with the expression delivered by the previous posters.

    And don't forget to use curindex in the loop instead of 0 for the x index, when you set the values.

  • You can't scale to 0, because at 0 it would get infinitely small. Below 0 it would probably turn around the screen axis, but let's just assume, that the values cut off at 0, so that won't happen either.

  • think of the require | on and off like:

    if (condition) { ... }

    the part before the dots is the on, the part after the dots is the off. One could probably make the syntax easier, and granted - the evaluation of conditions is very poorly done in the engine - this would definitely be something, that would need some more work. Like also including else, and letting the user write more evaluations than only statx >= valuey.

    The capability to go to another layout can be easily added:

    1) add the function name of your choice for it to the first event

    2) write the function like in the picture

    3) in the script you then can use "layout | layoutname" and it will work - just make sure that your minigame layout goes back to the game layout some time ^^.

  • It's not hard to do swapping yourself.

    Save the first of two values to a local variable (or dictionary, if you can't be sure about the type). Write the second value to the first position. Write the contents of the local variable to the second position.

    Not sure how exactly you wanna shift. Are we talking about about a one dimensional array or do you want to shift a 2- oder 3dimensional array? One dimensional should be easy with pop etc (though it might not be memory efficient with large arrays).

    If it's something you need regularly or often, you could make yourself a template maybe.