Currently in my game guns fire a long, beam to give the effect of a bullet flying along the screen.
When the bullet overlaps a 'enemy' this is the event that takes place.
|Bullet: is overlapping enemy
|System: trigger once
-------- |bullet: is overlapping enemy----------------------|enemy: subtract bullet.damage from health
-------- |enemy: pick nearest to (bullet.imagepointX, |bullet visual: set width to distance(weapons.imagepointX,
-------- | bullet.ImagepointY)-------------------------- | weapons.imagepointY,enemy.imagepointX,
-------- |system: trigger once------------------------------- | enemy.imagepointY
-------- |------------------------------------------------------------|bullet: destroy
This is what the event looks like in construct 2. The part to the right at the start is a sub event of the event above.
The setwidth makes the bullets visual sprite look as if it has hit the enemy and been stopped in its path.
I know this is difficult to understand without it right in front of you but it shouldn't matter, this system is flawed, a shotgun type weapon which shoots more than one bullet at a time doesn't detect hits right, shots that are too close together(time wise) don't detect right, and shots can miss altogether.
I chose this way because if I use a Sprite with a bullet behavior The speed that I want the bullet is around 6000, this too causes problems. The bullet can completely skip through the enemy because of the frame rate not allowing it to collide, I think.
Now that you have seen my two options I would like to know if anyone can come up with a solution to my problem.