I tried looking through past posts and was unable to find previous questions and answers about this.
I have a student wanting to use a triangular shaped object in a game similar to FlappyBird. In game play, player is quite “far” from the tip of the triangle and is called for touching since the bottom of the triangle is that wide. (stalagmites and stalactites in a cave instead of pipes like the original)
Could we use the offset (x Offset, yOffset, width/radius, etc) to make it more like a triangle?
If so, how?
I don’t believe you can but I have tried using 2 separate sprites for the left/right side of the obstacles (The bottom side is unnecessary as they are attached to the edges of the screen).
According to the documentation for setCollider, the collider can be a circle or a square that may be offset from the object’s center.
Please provide a link to the student’s project if you’d like one of us to take a look at it, but the documentation should be enough to get your student started in figuring out their game. (If they want to be ambitious, they can learn an early calculus lesson & realize that triangles can be approximated by several rectangles stacked together. )
Yes, you can set all of those things, but only for circles and squares. You could try separate sprites with different offsets & dimensions as another poster suggested. I invite you to submit a feature request for the ability to customize the sizes and shapes of colliders, perhaps in the animation tab.