Collision mask not working

For questions about using Classic.

Post » Sun Nov 18, 2012 10:38 pm

I'm new to construct and I'm going through the book that Jayjay released.

I've got a scene here I'm setting up and I have a little tiled background object that looks like this:




Now obviously, you can see my little test guy is hovering above the ground because of the grass being at the edge of the picture border, but what he really needs to do is sit behind it on the ground.

How can I use the Collision Mask button in the Picture Editor to achieve this?

I've tried clicking the collision mask button and erasing the grass part off the top and then saving, but it keeps doing the same thing.

I'm not sure how this button works, any help would be greatly appreciated.

Thanks!casesensative2012-11-18 22:39:59
B
2
Posts: 8
Reputation: 291

Post » Mon Nov 19, 2012 3:13 am

Hey thanks for reading my book! How're you finding it?

Looks like it's not running in administrator mode (so it doesn't have permission to access the files), are you using Windows Vista or Windows 7 or 8? If so, try right-clicking Construct Classic and select "Run as administrator" instead.

Also, if you run into any issues along the way feel free to send me a PM too!Jayjay2012-11-19 03:16:48
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Mon Nov 19, 2012 6:38 pm

Well yeah, I noticed it said that in the book too, so I did that, but it still doesn't seem to be doing anything.


So as you can see here, this is the original image.




Then I tried two things; The first being just erasing the top grass pieces for the collision mask (as you can see here):



That didn't work, so then I even tried cropping the top portion off, and it still didn't work:



So I'm still unsure...

As for the book, it's really good so far. I'm only on page 77 so hopefully it starts to get into a good bit more detail as I still have unanswered questions in my head.

For example, I've only made a small sample game on a 1000 x 800 frame so far obviously, but for games like Metal Slug or Contra that have lonnnggg levels that go on and on, are they using a gigantic layout like 12,000 x 800 to stretch for a very long time and setting up their level that way? or are they linking layouts together somehow...

So hopefully questions like that will get answered, but I'm highly enjoying the book so far.

One other thing I don't understand that I don't think the book will cover is using sprite sheets with Construct. To my understanding so far, sprite sheets don't work with Construct, so if I found a sprite sheet online that I wanted to use of a character for example. I would have to manually chop up all of the sprites needed for the various animations in Photoshop, and then load all the frames in, inside the animation window?

Thanks Jayjay
B
2
Posts: 8
Reputation: 291

Post » Tue Nov 20, 2012 12:45 am

Hi,I found that using copy collision mask to all,in the animator window,does not work for me,either,but double clicking on my sprite in the layout,does...could it be that you have collision detection set at "bounding box",rather than "per pixel",in your properties?,hope you get it sorted.
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Tue Nov 20, 2012 2:03 am

Thanks for the input pixel perfect, but I checked it, and it is a tiled background object rather than a sprite, so it doesn't give me the collision options under the properties tab like a sprite does.
B
2
Posts: 8
Reputation: 291

Post » Tue Nov 20, 2012 10:38 am

No worries,new to this too...I think a tiled background does not support custom collision detection,it is basically bounding box collision or none.use a sprite to test.

If you need to use tiled backgrounds for optimisation reasons,you could put the grass on a tile with no collision and place it in front of your "platform",with collision switched on to give the same effect.
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Tue Nov 20, 2012 2:20 pm

Ah that explains it then, unfortunately tiled backgrounds only have box shaped collision masks. You can use a sprite and set it to invisible for the collision masks instead though and it won't cause noticeable latency.

To start, create them in the level editor for each tiled background, but once you're comfortable with events you can create and position them at each tiled background object during the start of a level.

Also, chapter 9 in the book has examples not covered in the main games such as editing collision masks if that helps

On spritesheets, you can right click in the frames pane of the Animator settings tab and click "Import frames" and select an image to import or use the additional options to split the image into separate tiles.

It has some advanced editing features before final import as well, such as choosing a custom background color to erase (colour mask), or rotating individual image/tile pieces.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Wed Nov 21, 2012 12:05 am

How do i turn the collisions off altogether on the tiled background object, so that I can use a sprite for collisions instead?
B
2
Posts: 8
Reputation: 291

Post » Wed Nov 21, 2012 12:25 am

Hmm, if you remove the attribute "Solid" from the tiled background that should work.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Wed Nov 21, 2012 8:06 pm

That works! Thanks a bunch!

I have a separate question that I can't figure out at the moment that you might can help with.

I'm trying to make particles follow a sprite, and i want them to react like physics so when the character moves, they flow from out behind him, but when hes just standing there, they just spawn around him.

Any ideas on how to achieve this?
B
2
Posts: 8
Reputation: 291

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests