Protobuf changes

This commit is contained in:
2025-01-13 00:31:15 +01:00
parent 4f36c2ee1f
commit 4012a2ed92
9 changed files with 150 additions and 59 deletions
+7 -1
View File
@@ -3,6 +3,7 @@ package main
import (
"fmt"
pb "gitea.boner.be/bdnugget/goonserver/actions"
rl "github.com/gen2brain/raylib-go/raylib"
)
@@ -40,7 +41,12 @@ func HandleInput(player *Player, camera *rl.Camera) {
// Exclude the first tile (current position)
if len(path) > 1 {
player.TargetPath = path[1:]
player.ActionQueue = append(player.ActionQueue, Action{Type: MoveAction, X: clickedTile.X, Y: clickedTile.Y})
player.ActionQueue = append(player.ActionQueue, &pb.Action{
Type: pb.Action_MOVE,
X: int32(clickedTile.X),
Y: int32(clickedTile.Y),
PlayerId: player.ID,
})
}
}
}