Drag and Drop and solid behavior + tile based movment.

0 favourites
  • 9 posts
From the Asset Store
Advanced inventory mechanics for your RPG game (Array-based). Take Items, split them, pick up them, read the description
  • I've been trying forever to make a slide block game like one of my favorites.

    "Blockwick" the original one not #2.

    I got everything but I can never get drag and drop to stop going through solid objects. I'm sure it's really simple. Please no links to your store products.

    Here is a picture of the game.

  • it is not really simple. The built in behavior is not designed to do what you want - you will always be able to move a piece faster than you can check for obstacles. So, you will have to make your own drag and drop.

    I remember taking a stab at it months ago when you asked, and decided it would take more effort than I had time for. I would probably use an array to hold the occupied positions on the board and calculate if the piece can get to where you want to move it...

    like all awesome games, an elegant and flawless interface takes a lot of work!

  • AllanR

    Easy as in there is all kinds of sliders that for a clever person maybe able to make a path like that.

    But I think you onto something with the array thing,

    1,0,0,0,1,1, 1's would be the space movement is allowed, and 0's would be the stop, or blocked of area.

    And maybe I need to get rid of the drag and drop and use a mouse task of some kind.

  • I would probably try physics, with collision polygons on pieces a few pixels smaller than the actual size. Gravity=0, Prevent rotation=Yes, friction=0. Move piece to touch position with force. On touch end - snap piece to grid and set immovable.

  • Check this out:

    dropbox.com/s/x06g9959ukyz2jy/PhysicsMoveBlocks.c3p

    Edit: file updated, pieces now move without wobbling.

  • Check this out:

    https://www.dropbox.com/s/x06g9959ukyz2jy/PhysicsMoveBlocks.c3p?dl=0

    Edit: file updated, pieces now move without wobbling.

    Wow Thankyou very much. Appreciate it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've done something similar before but when I add another piece like 32x32.

    everything's good until i let go, then the piece wants to overlap another piece by half the smaller blocks size.??

  • Very nice Dop! :)

    DeathSpecter9 - there are a probably a few ways to fix that, I moved the origin to make sure other shapes line up on the same grid...

    I recreated the level from the picture you posted above, and it works quite well.

    not as fluid as the movement of the real game, but pretty close - and only 4 events!

    https://www.rieperts.com/games/forum/MoveBlocks2.c3p

  • Very nice Dop! :)

    DeathSpecter9 - there are a probably a few ways to fix that, I moved the origin to make sure other shapes line up on the same grid...

    I recreated the level from the picture you posted above, and it works quite well.

    not as fluid as the movement of the real game, but pretty close - and only 4 events!

    https://www.rieperts.com/games/forum/MoveBlocks2.c3p

    Works Great Thanks Guys!

    Let you know if I finish it. Graphics and polishing.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)