Hello! Now I was wondering as I am currently working on a pirate game how can I have an enemy pirate ship pull up about 10-30 pixels(will decide later) and have a horizontal rotation plus using some sort of shooting mechanism. The shooting mechanism I don't care much I can do that my self but how can I have it pull 10-30 pixels away from the right side of my ship no matter how I am rotated?
Thanks in advance!
LIC
How can I match my x and y coords and rotation too
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
How can I match my x and y coords and rotation too
http://xkcd.com/979/
Code: Select all
if signature = true then
print(signaturetext)
else
print("Error: Signature Not Found")
end
- ArchAngel075
- Party member
- Posts: 319
- Joined: Mon Jun 24, 2013 5:16 am
Re: How can I match my x and y coords and rotation too
If you know the rotation of the players ship - you can easily get a broadside rotation by matching the rotation of the enemy to the player.
Next get the distance between the two, and do movement that attains a position 10-30 Units away from the player(where Units is a arbitrary unit of measurement, ie Meters)
now to be allways on the players broadside (for some fun broadsiding exchanges) just take the players rotation and add a rotation of 90 or 270 which puts it allways aside the player.
so :
Match rotation
Use distance check and movement to attain 10-30 Units spacing
Use a point at a 90 or 270 degree angle 10-30 Units away from the player to ensure broadsiding one another.
I tried avoiding giving code incase you prefer a (more encouraged generally) code-it-yourself approach.
Next get the distance between the two, and do movement that attains a position 10-30 Units away from the player(where Units is a arbitrary unit of measurement, ie Meters)
now to be allways on the players broadside (for some fun broadsiding exchanges) just take the players rotation and add a rotation of 90 or 270 which puts it allways aside the player.
so :
Match rotation
Use distance check and movement to attain 10-30 Units spacing
Use a point at a 90 or 270 degree angle 10-30 Units away from the player to ensure broadsiding one another.
I tried avoiding giving code incase you prefer a (more encouraged generally) code-it-yourself approach.
Re: How can I match my x and y coords and rotation too
Could you possiby give code? I would like that.ArchAngel075 wrote:If you know the rotation of the players ship - you can easily get a broadside rotation by matching the rotation of the enemy to the player.
Next get the distance between the two, and do movement that attains a position 10-30 Units away from the player(where Units is a arbitrary unit of measurement, ie Meters)
now to be allways on the players broadside (for some fun broadsiding exchanges) just take the players rotation and add a rotation of 90 or 270 which puts it allways aside the player.
so :
Match rotation
Use distance check and movement to attain 10-30 Units spacing
Use a point at a 90 or 270 degree angle 10-30 Units away from the player to ensure broadsiding one another.
I tried avoiding giving code incase you prefer a (more encouraged generally) code-it-yourself approach.
http://xkcd.com/979/
Code: Select all
if signature = true then
print(signaturetext)
else
print("Error: Signature Not Found")
end
Who is online
Users browsing this forum: Google [Bot] and 11 guests