Here a Picture of my problem and my informations and questions:
informations: Fly is my player, TiledBackground 2 is the right side of the window, where you have to touch to shoot.
I want to create a laser ray.
Do i have to apply physics to the laser as well? every other object has physics behaviour. Don't know how to do it with the Length of the Laser and the reflection with TiledBackground 3 ( The Wall )
Not sure exactly what you are trying to achieve, so this may not be the correct answer for you! But have you tried using the bullet behaviour for your laser.
Using this behaviour would allow you to control the deflection angle which is shown in your event sheet. It would also give you control over the lasers movement and speed.
Hope this information helps
Develop games in your browser. Powerful, performant & highly capable.
At first i would like to thank you for the quick answer.
Is bullet compatible with physics?
Just make a tiled object and setup this width and height to increase every 0.1 second, for example.
On Arcade have a sample of use, also, coming with C2 have another sample.
Nice thanks most of it works, but now:
Problem 1: The width of the Laser increases proportionate.
Idea 1: Setting the position every 0.1 seconds to Fly.ImagepointX(0) and the same with Y doesn't really solve it.
Problem2: The Laser does not reflect on collision with the Wall (TiledBackground 3)
Idea 2: Tried playing around with Imagepoints of the Laser, but does not really work because i cannot say "IF Imagepoint 2 [Right side of the laser] collides with wall" its only possible with "IF laser collides with wall" which would take the origin.
Do i have to play around with Variables?
Edit: I know ANGLE is not really what i should use with a Laser, but dont know what I could use instead.
The laser itself does not need a physics system.
Here is a capx with the basic idea. Just need to fine tune the points for laser spawn. If you want the laser to be the same color after the bounce, you can use the same image for the sprites laser and laser2.
only this once i will allow you to look into my construct :D its horrible and not properly done , thats why i didnt upload it until now :D
but i hope you can help me.. it does not work like yours do...
Thanks for posting the capx. I went over it, and made a few changes to the laser systems.
Here are the changes I made
Hopefully this helps. By the way, where did you get the sprites? they look pretty cool
you can freely use any sprite just be aware of the conditions, some creators want their name called in the credits
thanks very much i will look into it when i get home and post an answer then :)