thunderrabbit / conswi

A swipe game for Godot 3
GNU General Public License v3.0
4 stars 4 forks source link

Correct the flow of gravity signalling #34

Closed thunderrabbit closed 5 years ago

thunderrabbit commented 5 years ago

As of f2f4335acd65125340d44521578f53f61c13fb5c, Players are based on Segments (Sprites).

Sprites do not care about the physics engine, so Game.gd has a timer that invokes "GravityTimer" and uses the cutely named boolean "gravity_called" in Game _process function. When gravity calls, the player is sent down one level. This way Game, along with Helpers.board (a 2D array of where players are nailed in place), knows when Tiles hit the bottom.

BUT, that makes it difficult to ensure pieces are not dragged through pieces that are already placed on the board. So I created #25.

To solve #25 I replaced Segments (Sprites) with Tiles (KinematicBody2D). Tiles know where they are in the world so they do not go through each other. Yay #25 nearly solved.

BUT, using KinematicBody2D and Godot physics engine means the Tiles tell Game when they hit the floor. This issue is to fix that "flow of location information" from Tile --> Game as opposed to the way it is now.

TLDR: as of 05bfde1cd5d7a5c16118608d98a04ff418fffa73, solving #25 with physics created a slew of other issues including #30, #31, but they are worth the trouble cause it helps solve #8 and makes the game simpler and more compelling.

thunderrabbit commented 5 years ago

Fixed by e968c56a3a785c469874a1a2c66b545067a0e2ac but not sure why Github did not notice