mindfaQ's Forum Posts

  • In this example the array is used just like a spread sheet. So imagine one.

    First column = word

    Second column = number of times it was present in the previous sentence

    Third column = number of times it is present in the current sentence

    (remember: first column has the Y-index 0)

    Each word has its own row

    Function add_words

    * event 2: checks if the word can be found in any cell in the spread sheet (was already present in the previous sentences, so to say)

    * event 3: if it does, it loops through all rows (X) and looks in the first column, if the word matches (this is to find out the row's index, which contains the word)

    then it adds 1 to the word count in the third column

    * event 4: if the word is not contained, the word gets a new row for its own (that's what the push does); since it is a new word, it was not contained in the previous sentence, so the word count in column 2 is 0 and in column 3 is 1

    * event 5-6: just loops through the textbox and runs the add_words function for each word; use lowercase(tokenat...) to prevent discerning between Word, word and WORD.

    * event 7 and following will do the check, if all words from the previous sentence are contained in the new sentence

    * event 8: loops through each row (= each word)

    * event 9: if the word was contained at least as many times in the new sentence as in the old one -> everything is fine, the values are set in a way, that the word count of the new sentence becomes the word count for the old sentence

    * event 10: if a word was missing one or more times, it adds the amount of times it was missing to the variable wrong

    * event 11: checks if no word was missing and throws a success message

    * event 12: if at least 1 word was missing, it throws an error message

    check the expressions for arrays, if you don't understand one of the actions: https://www.scirra.com/manual/108/array

    most important are imo array.at(x,y,z) to read values from the array and, when looping, array.curx, array.cury and array.curz. Width, heigth, depth can help too, but were not really needed in this case.

  • If Ashley did not change it, you can't set the cycle position of the behavior, so controlling the behavior is tedious and sometimes impossible.

    I'd suggest instead of using the behavior to just code the sine movement yourself.

    Nevermind, seems like there is now a set cycle position action. So just check for the cycle position and deactivate it, when it reached half or zero again. After your pause you can activate it again and set the cycle position to exactly 0.5 respectively 0. Still probably would be easier to just code it without the behavior.

  • https://copy.com/DKdeYAd8omHJzITq

    add adds the words to the array

    finish and compare will finish the "sentence" and compare if all words from the last finish and compare were present

    note: you might want to add a lowercase conversion to not differentiate between "word" and "Word"

  • Well, there is text.textwidth and .textheight. But it only works in the next frame, after the text is drawn, but you can probably work around that.

    For example you can create a dummy string on screen with the same dimensions as your textbox, set its opacity to 0, set the text to all the text that comes before your word of choice, then check for textwidth and textheight. Your words position then is originaltext.x+dummytext.textwidth etc..

  • two different options (event 1 or events 2 and 3)

  • That's the way I would do it, yes.

  • Sure, different animation frames and/or different animations. Read the documentation, it really is basic https://www.scirra.com/manual/115/sprite

    (make sure to set animation speed to 0, if you want to use different animation frames as different still images for a sprite)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nice. Is it possible to export to gif with transparency though?

  • Well, it works for me, so upload an example.

    Reasons for the text to not appear:

    Text box smaller than one line of the selected font style

    Also I think you want to use MaxSpeed instead of Speed, no?

  • maybe like this:

    global variable:

    next_powerup_at = 15

    and event:

    (score >= next_powerup_at) : spawn power-up AND add 15 to next_powerup_at

  • The simplest way would be setting the "set angle" property of the bullet behavior to "no". Just make sure to control the bullet angle over "set angle of motion" instead of object angle.

    quick example: https://copy.com/bOQAGDl1D9Jai8pb

  • Die deutsche Facebookgruppe dazu ist doch bestimmt auch nicht wirklich aktiv, oder? ^^

    The german Facebook group isn't really active either, is it?

  • https://copy.com/Tw3lYr2GlJ4AI0aj

    You need some kind of means to keep track of the maximum stack amount for the items (you can save those in a dictionary for example, the dictionary can be filled at the start of your game from a text file). Other than that the array should suffice. You can also add other qualities like description etc to it.

  • Instance variable. Keep track of which of your arrows are pinned and pick accordingly before activating the bullet behavior.

  • If it's all multiples of ten, you could check for:

    score%10 = 0

    if it's arbitrary values, you could add them as keys to a dictionary and check for them with the "has key"-expression, or you use an array and check for "contains value"