How do I effectively work with Collision Masks?

New releases and general discussions.

Post » Mon Aug 31, 2009 4:54 pm

I was going to add collision masks to some enemies in my project but it has turned pretty problematic. I found out how it is applied and it came to my mind that it seems mostly only useful for single-image tiles, unless I am missing something.

I created a seperate animation with a frame in it that was 24x16, with a hotspot at the bottom-center, because I wanted this to be the collision mask for all frames, but when I execute the command to make it so, it clearly doesn't apply this frame in a way where it uses the graphic AND the hotspot of that frame, but it rather seems it just takes that image and puts it in the top left space of the size of other frames.

I thought the point of collision masks was mainly for characters in a game, not tiles. Is there a way to do this I missed? If not, I'd really like to request such a feature, even maybe deciding which frame to make the mask in the way I explained during runtime.

I assume a lot has to do with making every frame in the same size image, but that's not very effective if some frames only require 32x32 instead of 64x64.

Thanks for the help.
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Mon Sep 07, 2009 10:38 pm

Can you really not use hotspots with collision masks? Seems to defeat the ideal purpose of them.
B
4
G
6
Posts: 32
Reputation: 1,514

Post » Mon Sep 07, 2009 11:30 pm

It doesn't work in a way where if you pick to make a frame's collision mask apply to all frames, it would act with that frames hotspot through all frames.

Instead it does this strange pasting of that frame's mask into the size of the other frames' canvas, I think related to the top-left. The only way to make this work proper would be to make all frames the same canvas size, which seems like a lot of rules and guidelines (and waste of VRAM for frames that can be smaller) for something that could be as simple as "this animation frame (or animation) is the collision mask, hotspot and all" and collisions are checked against that frame's dimensions and hotspot each time.
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Tue Sep 08, 2009 2:46 pm

its currently made for static one frame sprites.
B
2
S
2
G
4
Posts: 259
Reputation: 1,968

Post » Wed Sep 09, 2009 4:48 pm

Yeah, but it has the ability to copy the mask of one frame to all others, I was fooled!!
B
5
S
2
G
3
Posts: 234
Reputation: 1,818


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 4 guests