game question
I have an interesting question. I'm trying to make a game and I have the game class and then I have a class called Turret, where the turret fires missiles up towards the flying player spaceship. I call turret.updateTurret(); from the game class and that calls the updateTurret function in the Turret class. I put the player ship x and y coordinates in as the arguments for the parameters in the function so the turret will know where to aim the missiles. But I've found that those numbers are in reference to the stage in the game class and when they are in the Turret class they are in reference to the Turret class. There is scrolling going on in the game so the turret doesn't stay in one place it goes along with the background in a background container. Anyway I don't know how to get the right numbers to put in for the parameters for the updateTurret function in the Turret class so it will aim properly at the player ship flying around. Anyone know what I need to do?