Create a new method named spin for the seeingstars object

Assignment Help Programming Languages
Reference no: EM131374038

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.

Reference no: EM131374038

Questions Cloud

What is an advantage of an electric baseboard heater : What precaution should be taken when locating an electric baseboard heater near an electrical outlet?
Some biologists consider evolution to be a fact : Some biologists consider evolution to be a fact. In your opinion, is it really a fact? Why? Is there a valid debate about evolution? Support your response with evidence.
What is a fusible link on an electric heater : How does an overload protection device on an electric heater differ from a fusible link?
Leading cause of disability : Peripheral vascular disease (PVD) is a very common condition in the United States and is a leading cause of disability among people older than 50. It is more common in smokers, people with diabetes, hypertension and high cholesterol.
Create a new method named spin for the seeingstars object : 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.
What is a cuticle on a plant : What is a cuticle on a plant? What type of coating does it have?
What is your favorite movie and why : What is your favorite movie and why? What is the most important quality you look for in a film? (For example, do you look for a message or are you looking to just be entertained
Discuss contribution of plastic to municipal solid waste : Here is the question: Discuss the contribution of plastic to the municipal solid waste stream and describe the four main categories of plastic and solid waste recycling techniques.
How are electric heating elements rated : How do air temperatures compare between electric furnaces and those that are gas or oil fired?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd