I am working on a game that has a few classes. I want the laser to recognize when it hits a meteor. I cannot figure out how to get the width of the meteors(array) and the laser(just a line) to see something like if( laser > meteor.width && laser < meteor.width). Something like that. I have the meteor in one class, and the laser in another, while moving it to a game class. One issue is that i am using mouseX for the laser position, and that I cant get any of the variables in so that i can have the impact. On an added note, i want the meteor to reset at the top if hit. Anyone know how to get this to work?
1