note: since i don't know where will you implement it my example will be generic python (which should be possible to translate easily)
ok, to start the movement, set the bullet's speed to something along sonic's orientation vector (in this example i'll take it from his angle, but if your engine uses rotation matrices, you can get it from there)
bullet_speed[0] = cos(sonic_angle) * BULLET_STRENGTH
bullet_speed[1] = sin(sonic_angle) * BULLET_STRENGTH
Then, if your engine doesn't have a physics engine we are gonna do this calculation every frame (basic newtonian physics):
#TIMESTEP being the amount of time from frame to frame, at 50 fps its 1/50th of second = 0.02
bullet_position[0] += bullet_speed[0] * TIMESTEP
bullet_position[1] += bullet_speed[1] * TIMESTEP
# acceleration of gravity
bullet_speed[1] -= 9.8 * TIMESTEP