DarkSlash's Forum Posts

  • Ok, got it! I got also to update the tStart every time I move because I want a constant move, like a custom drag and drop, and not moving when I release the button!

    Here's the working result! Thanks!

  • I saw your code and now I got this. The thing is that works for moving right but not for moving left!

  • I have a graphic background grid (10x14, each square is 32x32 pixels) and a falling pieace (like tetris).

    Right now, I'm controlling the piece with the keyboard. So when the user hits right key, the piece moves 32px to the right, when it hits left key, 32px to the left. I want to have the same thing, but with mouse/touch. When someone touchs the piece,can move 32px to the left, to the right or down. But if I put draggable behavior to the sprite, the user can take wherever he wants.

  • Thanks!

  • How about if I want to see if there's an object with a certain position. I user System -> Pick by evaluating -> MyObject.X = 1 & MyObject.Y = 1. If the object exists, Construct2 pick it. What if there's no object with that position? How can I make a condition like that?

  • Mmmh exactly WHERE? I see no FOR there.

  • In the manual says that if the variable to iterate is bigger than the limit (ex: for(var i = 10; i > 0; i--)) The FOR wouldn't run. I need to do a descending FOR just like the written on the example. What is the way to do it on Construct 2?

  • Thanks!

  • How do you make those "steps" in the conditions?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • And can I do something like this?

    for(var col = 0; col < 10; col++)
    {
        counter = 0;
    
        for(var row = 0; row< 15; row++)
        {
            if(myArray(col,row) == 0) { counter++; }
        }
    
        if(counter == 0) { DO SOMETHING }
    }
    [/code:1pha7xjk]
  • Thanks! It worked perfect!

  • Lets say I want to do this:

    for(var i = 0; i < 10; i++)
    {
      print(i);
    }
    [/code:1ctvlk41]
    
    How do I do it on Construct2?  I need the I in the ACTION side to set object positions!
  • I don't know where the problem was. I started over (with a different logic) and works. Thanks!

  • Why you say Im not changing the created array? The IF left says that the actions will trigger if created[x,y] = 0 and on the actions in the right, the first thing I do is created[x,y] = 1. That should stop the next iteration to enter in the action field! Don't it?

  • I want to do this:

    for(var i = 0; i < landed.width; i++)
    {
        for(var j = 0; j < landed.height; j++)
        {
            if(landed[i,j] == 1 && created[i,j] == 0) { // DO THE ACTIONS }
        }
    }
    [/code:1pq71eqq]
    
    The thing is that the LAND object is created but the created[i,j] never is set to 1, so it keeps creating LAND objects every tick! What I'm doing wrong?