fiverivers Posted July 1, 2014 Share Posted July 1, 2014 Hi there, How do I go about generating a random curvy line between two sprites? Link to comment Share on other sites More sharing options...
lewster32 Posted July 1, 2014 Share Posted July 1, 2014 I think you'd need to be a bit more specific, maybe show an example or a mock-up? Whatever the case you would probably do this with a BitmapData object using canvas curve-drawing operations, such as arcTo: http://www.w3schools.com/tags/canvas_arcto.asp Note that arcTo and arc are in the dev version of pixi too, so these will be coming to Graphics objects in Phaser soon Link to comment Share on other sites More sharing options...
fiverivers Posted July 9, 2014 Author Share Posted July 9, 2014 The green line is what I have achieved so far however, I want it to be a randomly generated curvy line. I then want a user to follow their finger across the line and I want to be able to dynamically change the width of the line so that I can make it more difficult/easier for the user. Does this make sense? I was thinking of just getting a few sprites which are just curvy lines and using them instead, the only problem with this though is how would I dynamically increase and decrease the width of the line? Furthermore, does anyone have any ideas as to how I can detect whether or not the line is being followed by the finger properly. Link to comment Share on other sites More sharing options...
Recommended Posts