Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Hi guys,
I need help with an opposite angle. It is necessary that at collision the bullet and the wall, the bullet went to the opposite angle.How to do this? Thanks! <img src="smileys/smiley17.gif" border="0" align="middle" />
<img src="http://screenshot.su/img/b9/3b/d4/b93bd4fa8259d859783b11ff191a31a8.jpg" border="0" />
Try this:
+ Sprite: On collision between Sprite and Box
-> Sprite: Set angle to 180-Sprite.Angle+2*Box.Angle
Just make sure to set the angle of the walls (Box) accordingly. The Left wall should have a angle of 0, Top wall 90,... etc.
Hi R0J0hound , thank you for this valuable information.
I Just wonder what if walls didn't place like a square box. What if collision object was an ellipse ? Than how can I give angle to it ?
Try this: + Sprite: On collision between Sprite and Box -> Sprite: Set angle to 180-Sprite.Angle+2*Box.Angle Just make sure to set the angle of the walls (Box) accordingly. The Left wall should have a angle of 0, Top wall 90,... etc.
R0J0hound thanks, it works perfectly. <img src="smileys/smiley32.gif" border="0" align="middle" />
Develop games in your browser. Powerful, performant & highly capable.
You could also try using the Ball movement instead, which has actions to bounce off any angle surface.
maybe this can help-
http://dl.dropbox.com/u/5811650/bulletBounce.cap
It uses the custom behavior and can work for any surface.