How do i import collision mask for my sprite

Get help using Construct 2

Post » Tue Nov 15, 2011 8:56 am

Hello everybody,

I have a question regarding the collision masks, I don't know exactly from where i can import a collision mask for my sprite? In construct classic i double click my sprite then on the picture editor i choose collision mask then open to select my created collision mask, but here in construct 2 when i double click my sprite there is no set collision mask there is only set collision polygon which will use the default shapes and if i import my created collision the sprite it self will be replaced by that mask.

So does any one know how to import collision mask in construct 2?!

Thanks in advance.

Mina.
B
303
S
6
G
5
Posts: 163
Reputation: 12,152

Post » Tue Nov 15, 2011 7:27 pm

No one knows???

I'm trying to create platform school lesson 1 using construct 2 instead of construct classic, that's why am asking about collision masks.
Also i have a question regarding the auto rotate option on platform behavior, It's already included in construct classic but there is no check box for it on construct 2!

Any idea?

Please help
B
303
S
6
G
5
Posts: 163
Reputation: 12,152

Post » Tue Nov 15, 2011 7:31 pm

Collision polygon is your collision mask, you can add points and shape it as you like, but with more points it becomes slower. You can't have pixel perfect collisions in C2, yet.
Read about it here.

I took out the part where Ashley explains it:
- I think it's worth pointing out there won't be per-pixel collisions in the HTML5 runtime - Javascript isn't fast enough. The Classic runtime uses C++'s raw speed as well as special CPU features to make it practical. There'll have to be collision polygons instead.
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Tue Nov 15, 2011 7:49 pm

[QUOTE=Noga] Collision polygon is your collision mask, you can add points and shape it as you like, but with more points it becomes slower. You can't have pixel perfect collisions in C2, yet.
Read about it here.

I took out the part where Ashley explains it:
- I think it's worth pointing out there won't be per-pixel collisions in the HTML5 runtime - Javascript isn't fast enough. The Classic runtime uses C++'s raw speed as well as special CPU features to make it practical. There'll have to be collision polygons instead.[/QUOTE]

Thanks Noga for ur reply, but i tried the collision polygon and it doesn't work perfectly.

As i mentioned before I'm trying to create platform school game that is already created using construct classic but this time i want to create it using construct classic, so the first two problems i faced are:
1. The collision mask cause if i use the default created one the sprite will start flashing all the time.
2. The auto rotate to make the sprite looks nice and symmetric if he is moving to right or left, jumping right or left and falling right and left.
B
303
S
6
G
5
Posts: 163
Reputation: 12,152

Post » Tue Nov 15, 2011 8:33 pm

1. I'd change it manually, if you let the C2 guess the shape, it won't be that precise. About that flashing, I'd probably need to see it.
2. There is "Auto mirror/flip" in the properties.

ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Wed Nov 16, 2011 9:17 am

Please take a look

Platform School

Thanks in advance.
B
303
S
6
G
5
Posts: 163
Reputation: 12,152

Post » Wed Nov 16, 2011 11:20 am

Here's the file

Every frame of the object player had different size, falling animation frame had height bigger than standing frame. It was constantly switching between those frames because collision mask of the falling frame reacted to the solid, behavior switched to "is on floor" which changed frame to standing, standing frame was few pixels shorter than falling frame, so it lost it's collision with solid, behavior switched to falling again, and so on.
Edit> There are two (maybe more?) ways to get rid of it
- set each animation frame to the same size
- use dummy box with platform behavior and position animations to it.(I used this one)

I erased redundant animations, animation property "auto mirror" takes care of it, you just need to set the sprite's angle.Noga2011-11-16 11:25:02
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Wed Nov 16, 2011 11:56 am

[QUOTE=Noga] Here's the file

Every frame of the object player had different size, falling animation frame had height bigger than standing frame. It was constantly switching between those frames because collision mask of the falling frame reacted to the solid, behavior switched to "is on floor" which changed frame to standing, standing frame was few pixels shorter than falling frame, so it lost it's collision with solid, behavior switched to falling again, and so on.
Edit> There are two (maybe more?) ways to get rid of it
- set each animation frame to the same size
- use dummy box with platform behavior and position animations to it.(I used this one)

I erased redundant animations, animation property "auto mirror" takes care of it, you just need to set the sprite's angle.[/QUOTE]

Thankxxxx Noga, I really appreciate ur help and patient.

Thanks again and wish u a wonderful day
B
303
S
6
G
5
Posts: 163
Reputation: 12,152


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests