How do I make an object blast way from a projectile?

Get help using Construct 2

Post » Sat May 21, 2016 10:13 am

I am making a game in which you blast crates with a shotgun, but I have two problems:

How do I make the crates shatter into pieces upon contact with the bullet,

And how do I make those pieces fly away ( opposite from the direction of the bullet) at a reasonable speed to improve game feel and in general make the game better?.

Thanks in advance for your help!,
B
3
Posts: 2
Reputation: 175

Post » Sat May 21, 2016 11:39 am

The shattering into pieces part can be done by destroying the crate on collision with the bullet and creating crate bits at its former position.

Overall you need to store the bullets angle on impact and just apply it +/- any random angle offset (to get a cone effect) to newly spawned crate pieces, which should have bullet behaviour. You can also randomly set their speed and accceleration (negative to slow down!) to give the impression some are heavier and some are lighter.

Here's an example. The simple square cratebits sprites could be changed for actual fragments of your crate sprite, you could do multiple frames for the crate bits, disable the animation by setting the animation speed to 0, and upon creation assigning a random frame.

https://www.dropbox.com/s/3vluoo10v8ncp ... .capx?dl=1
B
15
S
6
Posts: 85
Reputation: 1,195

Post » Mon May 23, 2016 7:12 pm

Pulstar wrote:The shattering into pieces part can be done by destroying the crate on collision with the bullet and creating crate bits at its former position.

Overall you need to store the bullets angle on impact and just apply it +/- any random angle offset (to get a cone effect) to newly spawned crate pieces, which should have bullet behaviour. You can also randomly set their speed and accceleration (negative to slow down!) to give the impression some are heavier and some are lighter.

Here's an example. The simple square cratebits sprites could be changed for actual fragments of your crate sprite, you could do multiple frames for the crate bits, disable the animation by setting the animation speed to 0, and upon creation assigning a random frame.

https://www.dropbox.com/s/3vluoo10v8ncp ... .capx?dl=1


Thank you so damn much Pulstar! [Sorry for the minor swear :?]
You've really helped me and I feel so damn awful for not replying after such a long time, here is the end result:

Image

Also I will be sure to add you onto the wall of credits :), You deserve a something.
B
3
Posts: 2
Reputation: 175

Post » Mon May 23, 2016 8:40 pm

No problem, always happy to help obliterate more pixelated crates :D
B
15
S
6
Posts: 85
Reputation: 1,195


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound, tarek2 and 11 guests