Jump to content

Create a randomly generated line between sprites!


fiverivers
 Share

Recommended Posts

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

a6209dc76df0dc6fee0290cc4cafffd7.png

 

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...