Answered step by step
Verified Expert Solution
Link Copied!

Question

00
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 FXAnimation

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 FXAnimation I emplate if you decide to use animations). Instructions Use the FxGraphicstemplate for this assignment. Change the class 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 lavaFX 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. Moke 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: Use the FXAnmationTemplate instead and add some animation effects. Extra challenge 2: Add images of planets, moons, etc. Image img = new Image ("1magename. Ipg"); gc,drawImage(1mg,x,y); Now ask the user for the title of their constellation. Draw this title somewhere on the screen using a nice font and color, and display your own programming credits on the screen as well (i.e. "app created by Josephine Smith" or something like that). Finally, show the stage, which will display the final image to the user

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions