przemoo83 Posted June 1, 2015 Share Posted June 1, 2015 HiI have these two pretty basic problems (since I'm a beginner at programming). I'm building this simple game (basic framework is hosted here: http://klimat-test.ct8.pl/).The idea is:1. When holding "S" key and moving a mouse around I draw the path.2. After drawing a path I press "A" key and send player along the coordinates of the path. The problems I encounter are:1. When I draw a line fast it doesn't cover the path properly but instead it draws separated dots. I want the line to be solid2. I don't know how to send the player along the drawn line. I want him to move slowly along from the beginning to the end. As for now the only thing what he does it to jump straight to the end of path. I don't provide the code here but you can easily find it in Game.js file if you follow the link. Any feedback greatly appreciated Link to comment Share on other sites More sharing options...
Ocelot Posted March 18, 2016 Share Posted March 18, 2016 Im interested in 1. aswell Link to comment Share on other sites More sharing options...
drhayes Posted March 18, 2016 Share Posted March 18, 2016 You're going to have to interpolate the mouse positions into a line yourself. Even when it looks solid it isn't; it's a bunch of separate points drawn very close together. What you should do is accumulate the points of the input device into an array until the player presses A. You can then make them all into a line or a series of tweens or whatever it is. Link to comment Share on other sites More sharing options...
Recommended Posts