Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+3 votes
asked in CSC201 Spring 2021 by (1 point)

3 Answers

+3 votes

If you look at the file names for each background, you'll notice they have numbers in them. If you make the image with an f-string for the file name and take in the inputted number as a variable, then you can put the number variable into the file name, which will help you get the right image.

answered by (1 point)
+2 votes

The basic code to create an Image object is:

Image(anchorPoint, filename)

Therefore, each bgNum will store a different filename. You can create an if statement, which depends on the user's input to change the filename of the image object.

answered by (1 point)
+1 vote

There is a file of choosing background color game, you could refer it to make users choose your backgrounds.

answered by (1 point)