~kota/sl8

51c773a8392ff6e1fabb4e967815756b69933a19 — Dakota Walsh 3 months ago 963ebc5
Hold click to grab
1 files changed, 4 insertions(+), 0 deletions(-)

M game.go
M game.go => game.go +4 -0
@@ 48,10 48,14 @@ func (g *game) update() {
	if rl.IsKeyDown(rl.KeyQ) {
		rl.CloseWindow()
	}

	mouse := rl.GetMousePosition()
	if rl.IsMouseButtonPressed(rl.MouseLeftButton) {
		g.click(mouse)
	}
	if rl.IsMouseButtonReleased(rl.MouseLeftButton) {
		g.grabbed = nil
	}

	if g.grabbed != nil {
		pos := rl.Vector2Subtract(mouse, g.offset)