rotating NOT from the center of an actor
digitalzero
Member, BASIC Posts: 639
basically i have a robot that shoots lasers from his eyes... i would like to have the laser rotate not from the center but from the right of the laser because it would show that the laser is going from a 250 degree angle to a 180 degree angle... i have no idea how to do this and im just looking for a little help...
Comments
laser.x = eye.x + cos(eye.angle) * laser.length / 2
laser.y = eye.y + sin(eye.angle) * laser.length / 2
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
http://www.mediafire.com/download/dhu529yp886s4c3/LaserEye.zip
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@codewizard should add offset rotations to his list of behavior improvements. [-O<
GOT IT THANKS TO @RThurman http://i1192.photobucket.com/albums/aa340/RAThurman/OffCenterRotation.png THANKS SO MUCH!!!
http://forums.gamesalad.com/discussion/comment/370605/#Comment_370605
But before you use a bunch of trig, I'd suggest trying the method I mentioned earlier in this discussion. GameSalad is perfectly capable of doing the laser shooting stuff without you needing to use any sines and cosines. Here is the link for a demo of a trig-less laser shooter again:
http://www.mediafire.com/download/dhu529yp886s4c3/LaserEye.zip