click to move bugs

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Pixel_Professional
Prole
Posts: 1
Joined: Sun Jan 09, 2022 6:12 am

click to move bugs

Post by Pixel_Professional »

Im haveing trouble making moba style movement work with a camera but the player is unable to move past a certan part of the map and i cant find whats making it do that.
Attachments
camera.lua
(5.92 KiB) Downloaded 40 times
main.lua
(1.85 KiB) Downloaded 42 times
User avatar
milon
Party member
Posts: 472
Joined: Thu Jan 18, 2018 9:14 pm

Re: click to move bugs

Post by milon »

There's a difference between player's x and y and the screen x and y. You're treating those the same, though. Once the click is detected, you need to account for the current camera position (and possibly zoom) to get the actual desired co-ords.
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 44 guests