Skip to content

Instantly share code, notes, and snippets.

@MysteryPoo
MysteryPoo / MyNakama.gd
Last active April 12, 2025 07:48
Initial prototype for attaching dockerized dedicated Game Servers to Nakama matches
# This is a very messy prototype Autoload to test Nakama with a Dedicated Server
# This file won't do much of anything on its own, but I'm using it to drive
# a dedicated server for a game already made
extends Node
enum OP {
HOST,
STARTGAME,
LOBBYMESSAGE,
REGISTER_AS_SERVER,
@MysteryPoo
MysteryPoo / obj_Guard_Create_ChoosePath
Created February 11, 2015 05:33
Start a guard at a specific node on a path.
var node = 2; // Node number 2... for a random node you can do: var node = irandom( path_get_number( path );
// Set position to the position of the node
x = path_get_point_x( path, node );
y = path_get_point_y( path, node );
// path_position is a normalized value based on the length of the path.
// path_position = 1 is the end of any path and path_position = 0.5 would be halfway of any path.
// After setting the physical position of an object to match that of the path's nodal position,
// you then have to set the normalized position of the path if you intend for the object to
// continue following along that path. If I'm unclear I'll try to explain later.
path_position = ( 1 / path_get_number( path ) ) * node;