Beam firing different angles not working properly
Ok if anyone bothered to read my last thread, I'm working on a beam weapon for my cannon game, but when I try to fire it at multiple angles the beam sweeps across the entire screen, sideways (based on the angle) I've based my code off of TshirtBooth's health bar tutorial.
My modified rules are as follows:

The first change attribute changes to game.Player1X + (self.Size.width/2)
after messing around for a day I've figured out that the rule I've turned off (The first "change attribute" rule) is the main source of the problem, but I don't know at all how to fix it. Any ideas please?
My modified rules are as follows:

The first change attribute changes to game.Player1X + (self.Size.width/2)
after messing around for a day I've figured out that the rule I've turned off (The first "change attribute" rule) is the main source of the problem, but I don't know at all how to fix it. Any ideas please?
Comments
http://speedy.sh/m5sut/laserAndMirrors.zip
Instead of directly manipulating position.x, it spawns an actor with the same rotation as the barrel of the 'emitter' (er.... cannon). Then the beam is sent traveling off at a speed of 500, in the direction of its current rotation.
There is a bit of extra stuff when the beam hits a mirrored wall. It's direction of travel is reflected (it bounces). Then the beam's rotation needs to change to to the new direction it is traveling. That is done by changing its rotation to: vectorToAngle(self.Motion.Linear Velocity.X,self.Motion.Linear Velocity.Y)
Anyway, its there for you to use if it helps.
RThurman
RThurman