Create a new method named spin for the seeingstars object a


Spinning Stars - ALICE program

This exercise provides a world in which to explore using world-level functions to control the execution of a loop. A knight has been thrown from his horse and stars are spinning above him. We want to allow the user to control how the stars start and stopspinning by moving the mouse cursor near the left or top edge of the window. While themouse is near the top or left edge of the window, the stars will start and continue spinning. However, when the mouse is moved back towards the center of the world, the stars should stop spinning. To create this world, add a horse, a knight (both from Medieval), and a seeingStars object (from Special Effects).

Create a new method named spin for the seeingStars object. A "spin" is 2 revolutions, turning either left or right. In the spinmethod,the stars should spin left about half the time and spin right the other half. Create aworld-level function named nearTheEdge that returns true if the mouse is within 1 meter of the top or the left edge of the screen.

Then, write a world-level method named outOfBoundsthat uses a while loop to spin the stars as long as the mouse is near the top or left edge of the screen. Use a While the world is running event to call the outOfBounds method. Hint: The world has functions that return the distance of the mouse from top edge and from the left edge of the screen. Also, the world has a random probability function that can be used to choose whether the stars turn right or left.

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Create a new method named spin for the seeingstars object a
Reference No:- TGS02170702

Expected delivery within 24 Hours