#Block Slide Puzzle Game Issues

1 messages · Page 1 of 1 (latest)

pure atlas
#

Hey! I'm trying to replicate a game called Block Slide: Color Escape. Here's a game play video of it: https://www.youtube.com/watch?v=Xiw_6_uCkYA

My first idea was to use Kinematic Rigidbodies with polygon colliders for the blocks. This seems to work partially, there are a few problems:

-With my current code, blocks don't collide and slide at a pixel perfect level (there are some gaps between the blocks when dragging blocks around)
-When you release the mouse the block snaps to the grid, but when blocks are snapped adjacent to each other, you can't drag them anymore because it detects the block is colliding
-Blocks don't fit into 1x1 open areas

Here's my block dragging script:
https://pastebin.com/yCtvyTpC

Here's a video of what I have so far:
https://www.youtube.com/watch?v=Xbpu5IGKjus

If you can help or shed light into how I could solve these problems, I'd appreciate it!

If you need more details, let me know!

Slide colored blocks, match doors, and solve puzzles.

Block Slide: Color Escape
Gameplay e.01 (Level 1-15)

Enjoy this video, thanks for watching!!

#BlockSlide
#BlockSlideColorEscape

▶ Play video
rancid heart
#

I would not use physics at all for this - instead, keep track of whether each grid square is occupied or not

#

Physics makes sense for when you can't cleanly decide if a position is occupied or not (e.g. when enemies are moving around freely and you're throwing projectiles at them)

pure atlas
#

I could just check for open positions in cardinal directions and do it manually instead of using physics but how would i make it allow for free movement of blocks? thats the reason i weent with physics.

#

if im doing it manually the blocks would have to snap to actual grid positions wouldn't they? unless there's a way im not seeing

#

how would i move them in any vector direction?

rancid heart
#

You'd be separating the visuals (wherein blocks can appear to be "in-between" two positions) from the actual game logic

#

I've done something really similar for an isometric puzzle game

#

As far as the game is concerned, units are always at a specific whole-number grid position

#

even though they smoothly slide around

pure atlas
#

ah right!