Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program to draw multiple ghosts on the screen after asking the user to input a maximum size factor for the ghosts and how

Write a program to draw multiple ghosts on the screen after asking the user to input a maximum size factor for the ghosts and how many to draw.
You must do this by writing a function called drawGhost(), which takes four parameters:
the size factor of the ghost
the center x location of the ghosts circular head
the center y location of the ghosts circular head
the color of the ghost
Each time a ghost is created, its size (head, body, feet, and eyes) should be determined by the given size constants (like HEAD_RADIUS) and a randomized size factor. The value of the random size factor should be in between the constant MIN_SIZE and the max value that the user enters.
For example, if the user enters a max of 3, and the size factor is randomized to 2, the ghost should be twice as big.
Feel free to choose any coloring for the ghost body and eyes!

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 And Expert Systems Applications Dexa 2023 Workshops 34th International Conference Dexa 2023 Penang Malaysia August 28 30 2023 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Maqbool Khan

1st Edition

303139688X, 978-3031396885

More Books

Students also viewed these Databases questions