K.N.

Draw a curve with texture

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. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.