monitz87's Recent Forum Activity

  • Have another variable isWithinObjectiveTime which is set to 1 as soon as the objective starts, and set it to 0 after the objective time has ellapsed. You can do something like this

    And then add a condition to check if isWithinObjectiveTime is 1 in the event that checks for a kill.

    I'm guessing you want to have multiple objectives at the same time. In that case, you should create an 'Objective' object, have objectiveTime and isWithinObjectiveTime as instance variables, and try using the timer behavior (which does the same thing as Every X seconds, but on an individual level for each object

  • zatyka 's solution is exactly what I would propose. Any other solutions would be just doing what the ordered for each does in a more roundabout way

  • Have you tried using a global variable and adding 1 to it every time the player gets a kill within the alloted time period?

  • Yeah, families are definitely the way to go. Barring that, I think you're gonna waste a lot of time finding a suitable solution to your problem, only to scrap it all once you get the full version.

    What are you using to store your path? I can't see your capx because I'm not at my computer :c

  • You can try adding a "Stop" boolean variable to your enemy object, and have this check in a base level event

    Enemy moveTo is moving

    Enemy is Stop

    and use the moveTo Stop action to make it stop moving and then do whatever you wish

  • Exactly. Is there any way to get this check for the Y-Axis?

    you can implement your own YIndexOf function and then call it in expressions with Function.Call("YIndexOf", Array.UID, element)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The System -> For Each condition runs once for every instance of the Object Type you pick. In that particular case case you are making the event loop through all your Array instances (of which you only have one). If you wish to loop through the array elements, you have two options:

    Use the Array -> For Each XY element condition (you can use the Array.CurValue, Array.CurX and Array.CurY expressions within the event to access the current element, current x index and current y index respectively)

    Use two nested System -> For events from 0 to 99 and access the elements using the Array.At expression with loopindex like so:

    System -> For "X" from 0 to 99

    System -> For "Y" from 0 to 99

    ........ Do something with Array.At(loopindex("X"), loopindex("Y"))

  • lastIndexOf gives you the X index of the last match of the value you are searching for.

    So, if your bidimensional array is

    1 2 1 2

    3 4 5 6

    7 2 1 5

    lastIndexOf(7) should return 0, because that is the X index of the last appearance of the value 7

  • The keyboard object has a "Keyboard.LastKeyCode" expression which returns a number representing the last key pressed (which you can store in a variable), and a "On key code pressed" trigger which receives the key code as a parameter. You can create variables to store the KeyCodes currently assigned to each action in your custom controls, and then use the "On key code pressed" trigger to execute them.

    I attached an example capx

  • Here you go... far better - lol

    That was pretty clever

  • I'm guessing that what you're trying to do is create a solved Sudoku array by simply generating random numbers onto every position until they no longer conflict with the Sudoku rules.

    There's a whole bunch of problems with what you're doing.

    First, your While loop gets stuck whenever arrayXinc = Array.CurX and arrayYinc = Array.CurY, because the while condition tests if the array element is equal to itself (which of course is always true), so you get an infinite loop.

    Aside from that, generating a random number in a slot until it 'doesn't break the sudoku rules' and then moving to the next is not a valid Sudoku generating algorithm. You will undoubtedly reach a point where there is no possible number for the current slot. There are several Sudoku generating patterns out there that you can use, but in the mean time, I suggest you simply pick a set of pre-generated puzzles and store them statically in arrays. Work out the gameplay side of things first and then focus on how to generate your own puzzles. It's not a trivial matter.

  • you can use global variables in expressions

    you could just do

    LifeBar set animation frame to Lives

monitz87's avatar

monitz87

Member since 27 May, 2014

None one is following monitz87 yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies