Discuss Scratch

HarperNKK
Scratcher
17 posts

Bullet hits the player as soon as it is fired

My Game (That has issues): https://scratch.mit.edu/projects/636139068/

In my game, the player shoots bullets to kill the red circles that are trying to kill the player. The bullets bounce off of walls that can hit enemy's and the player. The problem is, as soon as the bullet spawns, it hits the player! Any ideas how to fix this?
Spentine
Scratcher
1000+ posts

Bullet hits the player as soon as it is fired

Disable checking if the bullet hits the player when the bullet is spawned? When the bullet it spawned, it comes from inside the player. After it is out, you could start checking.
Eloki_
Scratcher
39 posts

Bullet hits the player as soon as it is fired

Another issue is that the bullet sprite is not centered properly and this may cause inaccurate aim.
HarperNKK
Scratcher
17 posts

Bullet hits the player as soon as it is fired

Also, Another error is I have to hit the green flag twice to remove the game over screen…
inspectordonut
Scratcher
24 posts

Bullet hits the player as soon as it is fired

Maybe use raycasting. Look at griffpatchs tutorial.
Yusei-Fudo
Scratcher
1000+ posts

Bullet hits the player as soon as it is fired

inspectordonut wrote:

(#5)
Maybe use raycasting. Look at griffpatchs tutorial.
Why would you need this??

Eloki_ wrote:

(#3)
Another issue is that the bullet sprite is not centered properly and this may cause inaccurate aim.
The center of the costume was never at the center of the canvas in the first place.

HarperNKK wrote:

(#4)
Also, Another error is I have to hit the green flag twice to remove the game over screen…

It's because of this script in the game over screen:


I have found that your health is still at 0 when this script is run, then life is set to 3.

Last edited by Yusei-Fudo (Feb. 1, 2022 18:04:41)

HarperNKK
Scratcher
17 posts

Bullet hits the player as soon as it is fired

Thank You Everyone For Your Help! I fixed the bullet thing and I am looking into the game over screen script also! Again, Thanks Everyone For Your Help!
HarperNKK
Scratcher
17 posts

Bullet hits the player as soon as it is fired

Thanks Everyone For our Help! All Issues Are Fixed!

Powered by DjangoBB