Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Sidmama

I new to Impact and I seem to have gotten stuck!

The concept for the game is that there are falling objects of varying sizes and the player needs to catch these objects using a basket. I have used spawnEntity to create these falling objects. At random time intervals, these objects fall and need to be caught. For Level 1 there are a total of 40 objects to be caught.

The problem is some of the objects pass through the basket.
Initially I had used collideWith but the detection of object hitting the basket rate was lower. Next I used touches and it worked better but still a few objects pass through the basket. The behavior seems random - I cannot pinpoint when the object gets caught when they don't.

I have set the falling object as COLLIDES.ACTIVE and the basket as COLLIDES.FIXED.

Any ideas on this?

Also, I wanted to know do the entity assets have to be sized as multiples of the Tilesize (8, 16, etc..) or they can be of any size?

1 decade ago by Arantor

The only restriction on sizing is that the tiles themselves for background maps etc. must be square, other than that no restrictions. Entities themselves can be any size and don't even have to use the full size indicated; it's entirely possible to declare an entity as say 8x8 but use a 10x10 image by using its offset (since it's the size that will be used for collision, you can use this to limit the size of the hitbox for an entity)

Hmm, I'm thinking the falling object would be COLLIDES.PASSIVE (since you're going to kill() it at the end, presumably) with the basket as COLLIDES.ACTIVE (since it's not going to move being the 'stronger' entity)... but really, it should just be in the basket's check() routine and check that the other entity is one of those you're interested in, and deal with it based on the properties of the other entity.

1 decade ago by dominic

Maybe your baskets collision box is somewhere else than you think it is? Maybe you specified the offset the wrong way around?

Include the debug module and turn on drawing for the entity collision boxes to check.

1 decade ago by Sidmama

Thanks Arantor and Dominic.

The collision box was the problem. It works fine now.
Page 1 of 1
« first « previous next › last »