Jump to content

Draw a curve with texture


K.N.
 Share

Recommended Posts

I started working on a game similar to Curve Fever (https://www.youtube.com/watch?v=ojqBnYcxl0c). I’m new to Phaser and Pixijs, so I need advice on how to render a curve on the field.
Right now i have two Graphics objects: 

  • head (circle using drawCircle()) with arcade physics enabled (to be able to move it around the map
  • tail - static graphics copying head x and y on update drawing a line (lineTo(head.x, head.y)

The problem is as you see in the video the grey curve has a texture background. Assuming i have a repeatable PNG with background, how could i map it within the curve that is being drawn? 
Other question is should I use BitmapData instead of Graphics? I would prefer a lightweight option that would run on older computers. 
I would also need to be able to detect collisions, I think it's possible to enable it for Graphics but not sure about bitmap. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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