AS3 - Detect WHERE a collision occurred and ROTATE everything AFTER the collision point of the object by 90 degrees

我的未来我决定 提交于 2019-12-12 04:54:40

问题


AS3 - Detect WHERE a collision occurred and ROTATE everything AFTER the collision point of the object by 90 degrees


DISCLAIMER
The following explanation probably makes no sense, so have a look at http://raphaelhennessy.com/misc/Explanation.png for more information
Essentially, I'm making a game where a lazer shines onto the screen and you have a mirror somewhere on the screen you can drag around. There is also a globe somewhere on the screen. The aim of the game is to direct the light, using the mirror, into the globe. Then, an animation plays of the globe filling with light and you progress to the next level.
After time, the levels get somewhat harder and new obstacles and challenges are introduced.
My problem is this; I got the lazer, mirror & globe all on the stage working fine except that I can't figure out how to programmatically make the lazer 'bounce' off the mirror.
Thanks in advance,
-Raph

回答1:


I figured out how to do this. If you are interested you can find the code at raphaelhennessy.com/misc/LightStage.zip



来源:https://stackoverflow.com/questions/29163114/as3-detect-where-a-collision-occurred-and-rotate-everything-after-the-collisio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!