How do I add right collision polygon?

Get help using Construct 2

Post » Mon Aug 17, 2015 12:33 pm

Hi, i develop game for mobile and i have Sprite like this

Image

i want to destroy my player when it collision with all of part of this Sprite.

is it true work to add several point to my sprite like this:

Image

?????

Or

is it better to use several sprite to create that?

please give me your idea.
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Mon Aug 17, 2015 1:14 pm

mostafanastary wrote:is it true work to add several point to my sprite like this:

Image
Or

is it better to use several sprite to create that?

please give me your idea.


I think it should be fine doing as you have done. Guess you write here because of the warning you get when adding more points to the collision polygon?
If you experience performance issues you can always try to change it to use invisible sprites instead, or even reduce the number of points further in the one you have. Like so and then just move the others a little bit, to match those missing.

Image
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,828

Post » Mon Aug 17, 2015 1:34 pm

Although this setup might work, there is a lot of empty space which does add to the image-memory..
Dividing this sprite into three might allready take the amount of image memory needed down a lot..

Also this sprite seems to have several re-usable elements if the layouts are going to be bigger than this, which if seperated could again reduce the amount of image memory needed..

So I guess it all depends on your needs and your further "visual" plans..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Aug 17, 2015 1:52 pm

@nimos100

thank you for help,

@LittleStain

I have over 20 sprite lake that, so , you think it is better way to use several sprite for re-usable elements?
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Mon Aug 17, 2015 2:42 pm

I would agree with @LittleStain, that your method is highly inefficient. You will definitely run into memory issues especially on mobile.
The best way would be to use individual sprites. Tilemaps would be another good option, although the irregularity in your level design would make tilemaps a little more difficult to use.
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Mon Aug 17, 2015 2:46 pm

@ryanrybot
Ok, thank you, it seems the best way is the individual sprites.

best regards.
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Mon Aug 17, 2015 3:14 pm

But,in this way my individual sprites are 10 for example and the total point of collision is 60 , is this good?
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Mon Aug 17, 2015 5:20 pm

It's not just about collisions, it's also to do with fillrate and overdraw. Transparent pixels still need to be drawn and take up memory which will kill performance a mobile device, or even a desktop in severe cases.
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Mon Aug 17, 2015 6:22 pm

Bust your sprite into 3 or more images so they are convex. 1-floor 2-wall 3-ceiling.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Mon Aug 17, 2015 7:01 pm

Collisions and optimisation aren't always so clear cut, see

Image

Experiment with what works best, there are few best practices that apply to every situation.
B
57
S
19
G
9
Posts: 639
Reputation: 9,533

Next

Return to How do I....?

Who is online

Users browsing this forum: MoscowModder, Yahoo [Bot] and 6 guests