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

  Explaining box properties available in css

Browse the Web and choose a site that could benefit from box properties available in CSS. Make a screen capture of the page and indicate how you would change border and spacing properties.

  Display all names and phone numbers

Allow the user to input a last name; then search the file and display all names and phone numbers corresponding to that last name

  Write a marie program using a loop

Write a MARIE program using a loop that multiplies two non-negative numbers by using repeated addition. For example, to multiply 3 x 6, the program would add 3 six times (e.g. 3 + 3 + 3 + 3 + 3 + 3) or add 6 three times (e.g. 6+6+6). You should wr..

  Effective design features for site navigation

Screen shot of this example and explanation of effective design features will be included. Callouts are recommended. Ideally, students will locate examples of how they would like their site navigation to work and function.

  A precise definition of the input

In programming, a precise definition of the input; how the system should behave and how the output should be produced

  Explain immediate addressing mode

Expand your program in Part 1 to allow the operand use the "immediate" addressing mode. That is, the value of an operand is stored in the instruction. It should be assumed that the value operand is given as a decimal number.

  Cooks selected by methods are different which one is taller

He orders the shortest man in each column to step aside and chooses the tallest of these twenty-five. The two cooks chosen by the two methods are different. Which one is taller?

  Create uml collaboration diagrams by using microsoft visio

Create UML collaboration diagrams by using Microsoft Visio or another drawing tool capable of preparing properly formatted UML collaboration diagrams.

  Write program to asks user to enter temperatures

Write down the C++ program which asks the user to enter 12 temperatures for each month in year and store them in one-dimensional array called "temps".

  Write a program that opens a file and reads in two vectors

Write a program that opens a file, reads in two vectors, and then computes their dot product

  Progarm to calculate unit price for products sold

Manager of Super Supermarket would like to be able to calculate unit price for products sold there. To do this, program must input name and price of the item and its weight in pounds and ounces.

  Write a web application which will give report of balance

Write a web application which will provide a report of the balance held in the visitor's account during the past several months.

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