mindfaQ's Forum Posts

  • s000.tinyupload.com/index.php

    maybe you can learn from this.

    What it does:

    on start -> save sentences to array (I'd suggest using the CSVtoArray-Plugin, so you can write your sentences in excel, save the table as .csv and then import the csv-string into the game)

    after that the sentences are split up word by word and each word is saved at y=1, y=2 and so on of the array.

    So for one sentence the array would look like:

    x=0, y=0: I like to watch TV

    x=0, y=1: I

    x=0, y=2: like

    x=0, y=3: to

    x=0, y=4: watch

    x=0, y=5: TV

    The keyboard controls will be easily understandable for you. (A or Space shoots, later on in the sheet left and right puts the player to the lane to his left/right, if not at the edge already)

    The group spawnsentence sets the sentence that is next to spawn by randoming a number. The number represents the x in the array, which you later on will access. It also activates the group that is supposed to spawn the words on screen. It also disables itself to prevent a new sentence from spawning till all words are spawned by the spawnwords-group.

    Spawnwords-group. Uses the word-variable to detect which word it is at (word will chose where the word is taken from in the array). It selects a random lane by randoming between 0 and 2 to spawn the right word and the text that contains the right word gets the instance variable rightword set to 1. This later on helps to detect whether you hit a correct or a false word.

    For the lanes that are not filled with a word yet, a function to spawn false words is run, the function parameter tells the function where to spawn the word.

    False words get the variable rightword set to 0. False words are selected with a while-loop, where the system looks at a random word in the array and compares it to the right word. If the two words are not equal, it uses this word for the false text. If they are the same it looks up a random word again. In case you don't want "can" and "Can" to be detected as different words, use lowercase() for the while-condition.

    The rest of the events is kind of straight forward again. Hit detection, text movement, increasing difficulty over time, scoring based on difficulty (so later on you get more points), substraction of lives, game over display, removing the most front sentence from the sentence display after 5 words have been shot or passed the destroy-mark.

  • Yes.

    For each object (ordered)

    ordered by object.y (ascending):

    destroy object

    (system) stop loop

  • LAYERS

  • use other conditions/selectors, like:

    Global variable (paused = 0, set it to 1 when paused, set back to 0 when leaving the pause, add a condition to popping the bubble: paused = 0 so that it is only possible when the game is not paused)

    Deactivate an event group when pausing, so that the events in that group are disabled. When you continue the game, the group should be activated again.

    If you have problems with the z-order, just put the stuff that is supposed to overlap the bubbles to a layer above.

  • you can't set uids

  • Hey mate, had an idea for an event that works that should give better performance and doesn't require you to meddle with collision boxes in order to prevent it from going off too early:

    for each family1

    • family2: pick nearest to puzzle.x, puzzle.y AND family1.variable = family2.variable AND distance(family1.x,family1.y,family2.x,family2.y) less than 5: do stuff
  • No no, it works like I described. I updated my post and added a for each family1 to make it check for every puzzle piece, if you missed that.

  • Give them both an instance variable and set that variable for the corresponding pieces to the same values (0 for first piece, 1 for second and so on).

    Then

    for each family1:

    • family1 is overlapping family2 AND family1.variable equal to family2.variable: do stuff

    use system: compare two values for the second condition. Beware that overlapping would mean this triggers every tick.

    Reduce the collision polygon of the grid and puzzle pieces if you don't want it to activate when just the edges of the pieces touch.

  • fps and with that dt will be different (even if differences are very minimal), so the physics calculations will be carried out at different positions in time and space (I believe)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • edit: if you want a less scientific solution, you could for example write your action like this:

    localvar = 0

    while

    localvar=0: spawn enemy at x = floor(random(gridsize+1))*tilesize y = floor(random(gridsize+1))*tilesize

    -- (invert) enemy overlaps wallsprite AND distance enemy-player > x: set localvar=1

    -- else: destroy enemy

    Depends how you handle your maze generation pretty much.

    Example:

    this might be your maze:

    <img src="http://666kb.com/i/civ25q6qg342xq1zr.png" border="0" />

    and you've put your maze information in an array.

    1, 2, 3... are X.

    A, B, C... are Y.

    Grey = walls, the value of the array at this (X,Y)-position will be 1.

    White = ways, the value of the array at this (X,Y)-position will be 0.

    Red = vision, the value of the array at this (X,Y)-position will be 2.

    Then upon enemy creation you would only allow enemies to spawn on tiles where the corresponding array value is 0.

    How to get there?

    • The first two (way and walls) are straight forward - when you generate your maze you can input this data into the array.
    • now the red squares:

    * a for loop exploring into each direction starting from the player position P would do the trick. Set the values to two and stop the loop once it hits a wall (don't set that value to two).

    * if you don't wanna spawn enemies near your player, set all array values that are 0 and within +-x of your player's X and Y to 2.

    After that use a while loop with local variables, where you roll a random number for x and y, the number going from 0 to your gridsize in x or y. Then you check if the array is 0 for that x and y. If yes: spawn the enemy at x*tilesize,y*tilesize and stop the loop (by setting your while-condition to false). If no (= else), it will loop again.

    Once you've successfully spawned your enemy, use array: for each element AND array.curvalue = 2: set array at (array.curx, array.cury) to 0.

  • Or try Visionaire. Most Daedalic-Stuff is made with this.

  • Guess pick by comparison doesn't affect which element of the family is spawned?

    And creating sprites by name sadly is not possible.

    The easiest solution would probably be to put each letter into an animation of one sprite like in my example and then just set the correct animation.

    Let's see what you guys are playing now :)

    I play Dota 2, and here and there some point and click adventures.

  • Is "force own texture" set to yes for the layer where you use the blend mode?

  • s000.tinyupload.com/index.php

    If each letter has their own sprite-object, you ofc need to pick in respect to your family (add an instance variable to the family, that corresponds to the letter; then pick by comparison in the while-loop).

    If you have specific positions planned for your letters that follow no simple order, specify them in an array.