How do I create sprite object size of collision polygon?

0 favourites
  • 3 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Hello everybody,

    I have an question to ask.

    Let’s say I have a sprite object called Sprite1. It’s collision polygon is smaller than image itself. Now I want to create another sprite object called Sprite2 on top of Sprite1.

    Next, I want to set size of Sprite2 depending of the collision polygon size of Sprite1. First I thought that setting Sprite2 size by using expression Sprite1.BBoxTop etc. values but it turn out that they refer to the image’s bounding box, not collision polygon bounding box. Which makes totally sense now I think about it :)

    So my question is: is it possible to set size of sprite object to match the collision polygon size of another object?

    -M-

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Option 1 - Manually set both sprites to the proper size.

    Option 2 - Create imagepoints where your collision polygon vertices are. You can refer to these imagepoints' positions, and get the difference between two of them to calculate a width and a height value.

    Option 3 - Like option 1, but in case of dynamic sizes you can set the smaller Sprite2 to a percentage of Sprite1's width and height.

  • Option 2 - Create imagepoints where your collision polygon vertices are. You can refer to these imagepoints' positions, and get the difference between two of them to calculate a width and a height value.

    Yes, That could indeed do the trick. Thank you

    -M-

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