mindfaQ's Recent Forum Activity

  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • array set at x/xy/xyz

    for mass assigning use

    array for each element x/xy/xyz

    together with conditions for array.curx; array.cury; array.curz if you only want it to affect specific rows/collumns/pages

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

    it should work... (ofc should never divide by 0)

    although you don't necessarily need to put stuff like this in a function (if the calculation is the only action you wanna execute)

  • Hmm that's weird. You could add trigger once while true to the conditions to only make it spawn one button, but I guess that doesn't answer the question where this delay comes from. Any possible way the variable gets set to 9 again?

    You could also just use a timer (behavior) and create the button "on timer".

  • Pin - Rope Style would probably work as well and you safe you the plugin installation ^^

  • this

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

    result

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

    as I said, canvas plugin

    edit: when creating the sprites, paste them onto the canvas and destroy them for better performance

  • I think groups, including event sheets, functions and folders are enough. Not sure if I understand it, but wouldn't include already enable stuff like this with a single event?

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