6:34 l UE; } Task 3 - AimListener instructions Description In this task, you are given a class AimListener. In this clas

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

6:34 l UE; } Task 3 - AimListener instructions Description In this task, you are given a class AimListener. In this clas

Post by answerhappygod »

6 34 L Ue Task 3 Aimlistener Instructions Description In This Task You Are Given A Class Aimlistener In This Clas 1
6 34 L Ue Task 3 Aimlistener Instructions Description In This Task You Are Given A Class Aimlistener In This Clas 1 (35.82 KiB) Viewed 51 times
6 34 L Ue Task 3 Aimlistener Instructions Description In This Task You Are Given A Class Aimlistener In This Clas 2
6 34 L Ue Task 3 Aimlistener Instructions Description In This Task You Are Given A Class Aimlistener In This Clas 2 (32.19 KiB) Viewed 51 times
6 34 L Ue Task 3 Aimlistener Instructions Description In This Task You Are Given A Class Aimlistener In This Clas 3
6 34 L Ue Task 3 Aimlistener Instructions Description In This Task You Are Given A Class Aimlistener In This Clas 3 (26.13 KiB) Viewed 51 times
6:34 l UE; } Task 3 - AimListener instructions Description In this task, you are given a class AimListener. In this class you should add two private double member fields tilt and pan and implement two public methods with the following signatures for accessing the member fields. Method signature double getTilt() double getPand Description Return the value of the member field tile Return the value of the member field pan In addition, the AimListener class should implement a MouseMotionListener and override the mouseMoved(MouseEvent) method. The overridden mouseMoved(MouseEvent) method should update the values of pan and tilt according to the following formulas: Field Formula pan Current mouse X position x 180-90

LTE E 6:33 of pan and tilt according to the following formulas: Field Formula pan Current mouse X position X 180-90 Screen width tile Current mouse Y position Screen height x 90 When the user moves the mouse to change his/her aim, the mouseMoved(MouseEvent) method is called. Therefore, the tilt and pan should be updated in this method in order to change the aim. You may use GameScreen.WIDTH and GameScreen.HEIGHT for obtaining the screen width and the screen height. Location of the relevant class The AimListener class is in the package comp102x.project.task. You can locate the AimListener class by navigating through the folders: comp 102x -> project -> task in the downloaded project template Submission

6:33 l UE; } Submission The package and import statements are already given: package comp162X.project. task: import java.awt.event.MouseEvent: import java.awt.event.MouseMotionListener; import comp102x.project.view. GameScreen: public class Ainlistener You only need to submit your implementation of the AimListener class (declaration and body) in the PROJECT GRADED TASK 3 textbox below. Project Graded Task 3 0.0/20.0 points (graded) 1 public class AimListener {
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply