Rotation and Translation problem

So I’m trying to make a Gyruss remake here and I’m working on the movement to get the ship to move in a circular pattern. I’ve run into a problem, here is an early version of my code.

using UnityEngine;
using System.Collections;

public class PlayerControl : ShipClass
{	
	public Transform shotStart;
	public PlayerShot shot;

	void FixedUpdate () 
	{
		int xAxisValue = (int) Input.GetAxis ("Horizontal");
		int yAxisValue = (int) Input.GetAxis ("Vertical");
		switch(xAxisValue)
		{
		case 1:
            transform.Rotate (0, 0, p_rotateSpeed);
			transform.Translate (1 * p_Speed * Time.deltaTime, 0, 0);
            break;
		case -1:
            transform.Rotate (0, 0, -p_rotateSpeed);
            transform.Translate (-1 * p_Speed * Time.deltaTime, 0, 0);
			break;

		default:
			break;
		}

		switch(yAxisValue)
		{
		case 1:
			transform.Translate (0, -1 * p_Speed * Time.deltaTime, 0);
			break;

		case -1:
			transform.Translate (0, 1 * p_Speed * Time.deltaTime, 0);
			break;

		default:
			break;
		}

		if (Input.GetButtonDown ("Fire2")) 
		{
			Debug.Log ("Fire2 pressed!");
			Instantiate(shot, shotStart.position, shotStart.rotation);
		}


		
		/*
		 * 
		 * Debug Purposes
		 * 
		 * 
		if(Input.GetKey("a"))
			transform.Translate (-1 * player.p_Speed * Time.deltaTime, 0, 0);
		if (Input.GetKey ("d"))
			transform.Translate (1 * player.p_Speed * Time.deltaTime, 0, 0);
		if (Input.GetKey ("s"))
			transform.Translate (0, -1 * player.p_Speed * Time.deltaTime, 0);
		if (Input.GetKey ("w"))
			transform.Translate (0, 1 * player.p_Speed * Time.deltaTime, 0);

		Debug.Log (Input.GetAxis ("Vertical"));
		*/
	}
}

Here’s my problem. I start the game. And I’ll move the ship to the left or right it doesn’t really matter and everything works fine and dandy. When I decide to go back the other direction however and stop it at its starting position I notice that the ship has moved further up on the screen. I think that it is because that the rotate and translate statements don’t happen at the same time but I have no clue of a workaround for this. Does anyone know of a way to fix this problem? Thanks in advance.

I don’t fully understand the motion you’re trying to create here, but I think your problem is that when you move left or right you rotate before translating, whichever way you’re moving. This means they are not inverses of each other.

The inverse of “rotate then translate” is “translate backwards then rotate backwards”. So for example if you swapped lines 20 and 21, you might find the up/down drift goes away.