Answered step by step
Verified Expert Solution
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
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 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).
Step 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