Draw a dartboard shape at runtime

0 favourites
  • 3 posts
From the Asset Store
5 glow creatures with size, shape and color variations.
  • Hi All

    I am wondering if it is possible to draw something akin to a dartboard using the Draw commands in the canvas. Essentially all i need to do is be able to draw a wedge shape - a triangle with one edge as a curve - and then be able to fill that shape with a colour. I can then set up a loop to draw all the pieces based on values in an array to produce something like this

    routledge.com/collections/11164

    Many thanks

    Brian

  • I can imagine something like

    Get a circle on the layout, with its origin point in the center. (add more circles for the 1* value, double, triple, etc)

    Put a thin black sprite on the layout with its origin at the bottom and height half of that of the circle width.

    On layout start, set thin sprite to image point 0 of the circle.

    x=0

    while x < 20

    add 1 to x

    circle spawn thin sprite with angle (360 / 20) * x

    this wil get you the circle with the parts.

    should get you on your way I supose :)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok - thats approaching it from a very different angle than I was, but I see what you are trying to do. Very clever!

    Will have a play and let you know how I get on

    Many thanks

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)