CheekyTrooper Posted March 19, 2017 Share Posted March 19, 2017 Hey. I'm quite new to the forum and to html5 development. I have been able to link the NodeJS server to the html5 canvas and get designated numbers (atm, it will be player avatars later) But my problem is at the moment is that i can not seem to find any documentation on how to make it so that the player can click anywhere on the canvas to move to that spot. I was able to find WASD or up,down,left,right. But it is not what i want for this project. Just wondering if anyone has any experience in this, and if possible able to link over a documentation of some sort ? Thankyou in advance Quote Link to comment Share on other sites More sharing options...
mattstyles Posted March 20, 2017 Share Posted March 20, 2017 The click event has associated <x, y> coordinates in its payload, you can use those to work out where in the screen the user clicked, where in the DOM they clicked, where in the canvas they clicked and then where in your world where they clicked. After that you'll need some pathfinding to move from A->B and thats a more involved subject. ProSteveSmith 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.