Hey everyone. I’ve been recently working on an asteroids-like game, currently with the player controls and bullet physics. However, the bullets don’t change rotation to be the same as the player’s ship when shot. You can check out the project here. Any help to fix this would be appreciated.
Something like this? point in direction ([direction V] of [Player 1 ship V] ::sensing)::movement
repeat until <> {
move () steps :: motion
} :: control
delete this clone ::
You should first make the little bullet face in the direction . Since you set it to point in the direction (Player Ship Direction) and it always set to 0, the little bullet always shoots up.
The reason (Player Ship Direction) is always set to 0 is because of this script:
The block will forever run, meaning there won’t be a chance for the variable (Player Ship Direction) to be set in the script that comes after the custom block.
What you can do is either remove the forever loop inside the Player 1 Movement:: #603501 definition and stick the Player 1 Movement:: #603501 inside the forever loop with set [Player Ship Direction V] to (direction), or put the Player 1 Movement:: #603501 under another when green flag clicked block.