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 readme

Hey Hey ...

So I tried to make an entity with no collision detecting that has entities inside that have collision dection so when I want to move them I only need to move the parent.

Is that at all possible? It looks like any movement on the parent just moves the parent not the children.

1 decade ago by Joncom

To do what you're suggesting you would need to have each sub-entity constantly check if the parent has moved, and if it has use the new coordinates.

You've made me curious now. Would you my telling a little bit about what you're doing that will use this entity w/ sub-entities approach? Not a Tetris clone is it?

1 decade ago by readme

"Not a Tetris clone is it?"

Heh, so it has come up before I guess? Yes, the long term goal is to make a clone of battle-tetris from the NES, and in terms of performance it seemed more logical to me to move one big entity instead of several smaller ones.

But I'm all new to impact so maybe I'm just trying to dig a hole with a hammer because I want to use impact-features.

1 decade ago by readme

btw.: thanks for your answer, it's good to know that it's not just me being stupid but what I was trying is something impact just can't do (yet).

1 decade ago by Joncom

Quote from readme
I was trying is something impact just can't do (yet).

Yes, you're correct, because Impact out of the box only supports a square hitbox for detecting collisions, which means some work is involved if you want to create oddly shaped blocks.

I'd recommend you not taking the sub-entities with one parent entity approach, and this is why.

/><br />
<br />
What's going to stop the 16x16 square at the bottom of the yellow block from continuing to fall while the rest stops? My point is that you're not going to be using vanilla collision detection; you're going to have to add some of your own logic to help the game know how blocks collide in the world.<br />
<br />
I'd suggest making one entity per block (contains several squares) and representing the shape of the block using a 2D array or object. Every block in Tetris can be represented within a 2x4 grid.<br />
<br />
Examples... <br />
<br />
<pre class= Tall block: X O X O X O X O L-block: X O X O X X O O

1 decade ago by readme

Ok, that makes sense (and your point about the yellow block was pretty good, I havent thought of that), so I guess it was a dig-a-hole-with-a-hammer situation after all :) ... well, at least when it comes to the collision detection.
Page 1 of 1
« first « previous next › last »