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 paulh

Hi All

So i have an entity which is generated from a sprite sheet. When a bullet hits the entity i want to split the entity sprite into a maximum of four pieces and for those pieces to move taking into account the point of impact (c what i did there!)

/><br />
<a href=http://postimage.org/image/4s0hlvh7l/


In this image ABCD = the entity sprite at say 100x100 (displayed as one sprite)
The sprite is one of 100 in a 1000X1000 sprite sheet.

A bullet impacts at the bottom left of the sprite so i want to split the sprite into 4 pieces (ABCD) and for their trajectory to be North Easterly but them to move independently.

The example above is just for this posts purpose.

Any hints on the approach to do this?

1 decade ago by StuartTresadern

On collision with your BIG box get the angle and velocity (if required) from the bullet.
Kill the bullet
Spawn 4 new entities SMALL BOXES using the BIG BOX as position reference.
Passing the angle and velocity to the SMALL BOXES.
Maybe add some Impact velocity and angle change to get them to split apart.
Kill the big box
Page 1 of 1
« first « previous next › last »