How can shoot my projectile in the opposite direction in a 2d game?

I figure this out but I am not sure if it was the right way. I had it change the velocity of the projectile into the negatives. It works but I am not sure if that was the right way