Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Assignment: Constellations This assignment is about variables, data types and flow of control. You will use the FXGraphicsTemplate for this assignment (or the FXAnimationTemplate

The Assignment: Constellations
This assignment is about variables, data types and flow of control. You will use the FXGraphicsTemplate for this assignment (or the FXAnimationTemplate if you decide to use animations).
image text in transcribed
The Assignment: Constellations This assignment is about variables, data types and flow of control. You will use the FXGraphicsTemplate for this assignment (or the FXAnimationTemplate if you decide to use animations). Instructions Use the FXGraphicsTemplate for this assignment. Change the dass name to something meaningful and change the window title, and size of the stage to whatever you want. When your program runs, the first thing you should do is create a star field by displaying a whole bunch of randomly-placed stars (i.e. small circles or squares) on a black or very dark blue screen. You can use the formula Math. random () MAX to generate a random value between 0 and MAX. It's up to you how many stars you display in this way but it should be enough to look like the actual night sky. To make it look more realistic, you could also vary the size or brightness of the stars. Then have a dialog with the user (don't show the Javaf X stage until after this dialog is over). This dialog should ask the user to enter a series of X and Y values that will represent stars in a constellation. Let the user decide how many stars. Make sure the user cannot enter x or y values that would appear off screen. An example of the dialog for entering the number of stars is shown below. Your program does not have to match this exactly. As the user is entering (legal) values, you should be drawing stars on the screen and connecting each star to the last one by drawing a line. You can decide exactly what all this will look like, but your stars should be different enough that they will stand out from the other stars that are already on the screen. Your lines should connect the centers of your stars. Don't draw them from the upper left corner. When the user is finished, connect the last star back to the first one. Extra challenge 1: Now ask the user for the title of their Use the FXAnimationTemplate instead and add constellation. Draw this title somewhere on. some animation effects... display your own programming credits on the Extra challenge 2: screen as well (i.e. "app created by Josephine Add images of planets, moons, etc. Smith" or something like that). Image ing = new Finally, show the stage, which will display the gc. drawImage (img, x,y); image ("imagename. jpg); final image to the user

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

Step: 3

blur-text-image

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

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

8. Demonstrate aspects of assessing group performance

Answered: 1 week ago