Question: I am currenty making a 2 D platformer in Visual Studio code and I want to use Pygame in Python, ( in Visual Studio Code

I am currenty making a 2D platformer in Visual Studio code and I want to use Pygame in Python, (in Visual Studio Code), to make a class of a laser beam that can behave and act like an actual straight laser beam, color doesn't matter.What I want for it is to:
- be created in a .py file (Laser.py)
- have variables for a starting point (i.e. x,y) for the laser and a direction it's pointing
- set an end point where the laser can collide with a wall in the direction it's pointing at (like basically a raycast)
- and also draw a line between the start and end point (like a beam)
If possible, please provide all of the code for the class, and have it be fully functional. Thanks!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!