iwontnamemyself's Forum Posts

  • rexrainbow - I guess I'm gonna have to mess around with gridmove for a little while cuz I haven't been able to get this to work with just Touch.

    Also, any tips or tricks on getting a variable from a single chess on a full board, without using an array?

  • Magistross - Thank you for clarifying! I was a little worried. lol

    Thanks for the help. I'll see what I can do with this example.

  • Magistross - So what you're saying is, I can't delete/insert an entire row/column? Deep down inside I knew that, but I've been in denial. Lol

    Correct me if I'm wrong, but the way I'm understanding what you're saying is I have to push/pop each item (which can only be done from the ends of the array and not at the ends of the rows and columns!!!) in order to adjust the rows and columns? I can't just insert a value at an index, which should move the remaining array down 1, then delete the old index which would move remaining back to their original place?

  • So I tried using a 2D array along with a 1D array. I've got an algorithm for the pop/push according to how many grid squares were moved. That works perfectly, but I'm still not able to put the contents back into the 2D array without the 2D array's contents going haywire.

    Am I missing something with the 2D array, or are they made so that we cannot alter a portion of them? From what I remember in college with my c++ and c# classes, arrays (1D and multi-dimensional) can be accessed and altered by index or value, so why aren't we able to do that in Contruct 2?

    I'm starting to think I need to make a 1D array for each row and column and figure out how to alter them all together. *so daunting!!!!* :S

  • rexrainbow - Upon opening the square board slg movement capx, nothing shows up on screen except a white board with a grey border.

  • rexrainbow - I'm a little confused. Are the capx and the demo suppose to be the same program? Cuz they're not. The capx link goes to the square board grid move capx, which is the one that was posted before with the player wandering through the edges. The demo however is called board move at wrap board, which looks similar to what I need, but I can't find a capx for in your dropbox anywhere.

    Also, is there a way of using the wrap without using grid_move or slg_movement? I've never used them before, so I'd prefer to use Touch and drag drop, only cuz that's what I'm familiar with.

    [edit] I just reread your last post and I answered my own question about grid_move and slg_movement. lol [/edit]

    [edit]So apparently the demo name is board move at wrap board, but the file name is square board slg movement capx. Found it! lol [/edit]

  • DennisR - Have you tried changing the properties in the Physics behavior for the ball yet?

    https://www.scirra.com/tutorials/65/physics-in-construct-2-forces-impulses-torque-and-joints

  • I'm working on a game that is an 8x8 grid of sprites. Each sprite is the same object, just a different animation frame. My goal is to get each row or column of the grid to "slide" on a single axis with a touch gesture according to which sprite is touched and which direction the swipe is. Once a sprite passes through the edge of the grid. It should wrap around to the opposite side, appearing as though each side is connected. When the touch event ends, the sprite should snap to the nearest grid square.

    Right now I have the grid set up, the sprites spawn in the correct position with a random animation frame. The sprites slide when swiped and they snap to nearest grid square when the touch event ends. Any sprites left outside the grid (i.e. the "masking" sprites) are destroyed, so there aren't a numerous amount of invisible sprites lingering around.

    I'm having a problem with the wrapping portion. I just haven't been able to figure out how to accomplish this. I'm using a 2D array to collect the animation frames of each sprite in the row/column at the time the grid is created and then access the array when a sprite is swiped to set the masking sprites to the proper animation frame. It works great for the first swipe. The masking sprites show up in the right places, everything moves according to the initial axis of the swipe. Everything snaps to the closest grid square. But when you swipe another sprite in the same row/column, the original order of the sprites show up again, instead of the new order. Something like this:

    Original order - (masking sprites are regular font and main board sprites are bold)

    123456781234567812345678

    If the sprites are shifted over by one so the row that was shifted now looks like this -

    23456781

    But, the masking sprites of the next touch event look like this -

    123456782345678112345678

    They don't match up. Like I said, I've been trying to use a 2D array to create the masking sprites, so I know I need to shift the index order of the array after every touch event, but I haven't been able to figure out how to do that. Push/pop doesn't do the job and I haven't been able to figure out how to use delete/insert to access the array properly to achieve this.

    The only thing I can think of is to use the 2D array to capture the frames at the time of creation, then use a 1D array to store the animation frames at the time of access, then use delete to remove the old values from the 2D array. Push/pop the values of the 1D array to match the amount of squares moved, then insert the contents of the 1D array into the corresponding row/column of the 2D array. All that just makes me feel like I'm making this way too difficult on myself though. lol

    If anyone knows how to help me use an array to do this, or if anyone has any suggestions to use another method I'm willing. lol

  • rexrainbow - I haven't been able to figure out how to get a sprite to wrap like in your capx by using touch instead of the keyboard. It seems pretty straight forward though, which is why I don't understand why I'm having an issue. Is grid move or slg movement required for the wrap to work? I don't see the layout to board plugin in you capx either. Do we not need that anymore? What's the purpose of InstGroup? It doesn't look life it's set to anything and what is the Chess.Player Boolean for?

  • Thank you so much rexrainbow ! I'm gonna test it once I get home from work.

  • rexrainbow - I can't seem to figure out how to get the logic position to wrap still. I enabled the wrap property of the Board, but when I move a sprite to the first position off the board, it's still showing up as -1, -1 and the position the block should be logically is showing up empty. Also, If I move a sprite to the next logic location on the board, it's showing up as position 0, 0, no matter where on the board it is.

    Maybe I'm just not understanding it, or maybe it's cuz I set up the debugging wrong, so I'll keep working on it...and I guess I'll go through all your .capx again.

  • rexrainbow - I downloaded to new rex_board the other day when you posted it, but I haven't noticed it registering the wrap. I'll see if I can create a new debugging system to check everything though.

    I tried system: create at x, y, and board: add chess, but it wouldn't display the chess on the screen and the debug layout said they weren't there logically either. Like I said though, I'm gonna mess around with it all for a while longer to see if I can get it to work.

    [edit] I figured out what I was doing wrong when trying to create the new chess. I was using the logic position instead of the physical. lol [/edit]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • rexrainbow - Is there a way to create chess outside of the Board boundaries? I'm back to thinking a mask would be the way to go. Currently, I have 2 projects working, one using your Board plugins and one without. On the one without, I'm able to create chess outside of the board area, but I'm unable to figure out how to achieve this with the Board plugin. Do you know of a way to do this? Or do I need to make the Board bigger and create the chess only in the middle so I can have tiles for the new ones to spawn over?

  • rexrainbow - Do you think there will be a way for me to get it to look like the sprite is wrapping pixel by pixel?

  • There is still one bug, but I don't know why it occurs and how to fix it. It happens when I touch Red (for example) and then drag it, it seems that it isn't dragging but when I touch Green (still holding first touch),the Red one jumps to that position where I'm holding touch.

    VerteX123 - How did you fix this bug? I'm having the same issue with my game. The drag doesn't start working until the second touch for some reason. I've tried using Is In Touch, Is Touching Object and On any Touch Start and they are all producing the same bug.