Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribedimage text in transcribed

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); Crash10

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

From Zero To Data Hero With Chatgpt

Authors: Andrew Wu

1st Edition

B0CQRJPXD9, 979-8989523009

More Books

Students also viewed these Databases questions

Question

What are the major global trends your industry faces?

Answered: 1 week ago

Question

2. Develop a persuasive topic and thesis

Answered: 1 week ago

Question

1. Define the goals of persuasive speaking

Answered: 1 week ago