It´s possible to make splatt hit&out body?

Get help using Construct 2

Post » Wed Jun 15, 2016 10:44 am

Hi all,

It is very easy to detect the hit of a bullet and spawn a splatt using "on collision with...", but, it is also possible to detect the output of the bullet and generate another splatt?

I'm doing some tests using offset detection:

Image

But I can not get the result I'm looking.
The other problem is that if you need to calculate the trajectory of many bullets at the same time, this can cause too many cpu usage and a direct impact on fps.

Any idea is welcome!
Thanks :D
B
5
S
2
G
1
Posts: 17
Reputation: 573

Post » Wed Jun 15, 2016 11:04 am

You could "cheat" and simply make your projectile do the work for you...

1. Bullet hits enemy/player
--- set bullet invisible
--- set instance variable HasHit to "true"

2. Bullet variable "HasHit" is true AND is not overlapping enemy/player
--- create blood splatter (at angle of bullet)
--- destroy bullet

So basically the bullet doesn't destroy itself until it's gone in AND out again from an enemy, creating a blood splatter on entry AND exit if you want.

I'm sure there's some genius mathematical solution to this - but I'm a creative thinker not a mathematician - so that's probably how I'd do it. The bullet is already travelling at a given angle and velocity, so why not use that data and positioning? Faster bullets could create bigger splatters, or whatever... there's a load of ways to use existing data as random variables :D

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Wed Jun 15, 2016 11:45 am

That was exactly what I was looking for, thank you Sol!

I did a couple of tests without much detail to see how can it looks:

With bullet destroy:

Image

Without destroying the bullet:

Image

It does not look too bad to be a sketch, once again, thank you Sol!
B
5
S
2
G
1
Posts: 17
Reputation: 573

Post » Wed Jun 15, 2016 12:59 pm

No problem mate!

I'm REALLY bad at trying to do stuff the "proper" and "mathmetically genius" way - but I can redneck engineer almost anything to work :D

Hit me up if you get stuck with anything else like this ;)

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499


Return to How do I....?

Who is online

Users browsing this forum: dop2000, max2612 and 5 guests