#Grid point and click movement

1 messages · Page 1 of 1 (latest)

peak nova
#

the video explains that pretty well, but it does assume the viewer has some knowledge about movement systems already.

I don't know what exactly you struggle with. The system is pretty basic in my opinion.

If you have specific questions, just ask those. If you want to watch more tutorials, any Godot4 TileMap tutorial works. Whether its about moving with WASD or with mouseclicks. All will apply to what you see in the Game you linked.

reef ice
#

I spent around 2 hours putting together this rough prototype for grid movement, It's probably not super expandable into a diverse project but hopefully this gives you a feel for what you're trying to do. (code coming momentarily)

The scene displayed is only a root Battlefield node. When the battlefield is initiated, a grid of BattlefieldCells is drawn. Each of the cells are contained as children of grid_root, which is a Node2D and child of the battlefield.

After the cells are all drawn, a character is added and assigned a cell where it stands on the battlefield. With the actions "UP" "DOWN" "LEFT" "RIGHT" all set up in the input map, the battlefield _input func catches keystrokes which update the character's position, using the cell's GetNeighbor() function.

Go nuts, have fun

#

might be too long hold on

#

battlefield_cell.gd