Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am trying to create a java game with two tracks, where the track is chosen in the first step. My problem is, that I
I am trying to create a java game with two tracks, where the track is chosen in the first step. My problem is, that I would like to call the class crash1 for track 1, and crash2 for track 2. Is should run in a whileloop along with Keys, so it checks if position is out of bound by each move. Is it possible to separate them automatically, when clicking the button?
I tried applying a while-loop within the ActionEvent, but then the track doesn't appear.
public static void main(String[] args) throws InterruptedException int n = 40; posLX) = (int)(n/2.0); // Implements initial criteria oldPos = pos.clone(); distance[0] = 0; distance[1] = 0; menu) Thread.sleep(5000); while (true) Keys); Crash10 public static void main(String[] args) throws InterruptedException int n = 40; posLX) = (int)(n/2.0); // Implements initial criteria oldPos = pos.clone(); distance[0] = 0; distance[1] = 0; menu) Thread.sleep(5000); while (true) Keys); Crash10Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started