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

  What are the important aspects writing pseudocode

What are the characteristics of flowcharts and how they express logic and what are the important aspects writing pseudocode?

  Create a menu type form that gives user to select subforms

Create a menu type form that provides the user the capability to select one of the following two subforms. Means of selection is programmers choice.

  Prepare a presentation on backgrounds and fonts

Can you still read the text? Is it too narrow or thick? Is an icon hidden by the background? You should also include tips for choosing backgrounds and fonts.

  Write down a macro which writes the single character

Write down a macro named putChar which writes the single character, passed a macro argument, to standard output in assemble language.

  Create an enumerated type that has class levels as its value

Create an enumerated type that has the class levels as its values, in the order given, so that the ordinal value of FRESHMAN will be 0, and the ordinal value of SENIOR will be 3.

  Create a dtd for a small xml data set

Create a DTD for a small XML data set drawn from the Stanford course catalog. There are multiple departments, each with a department chair.

  Calculate the power of any number a raised to the exponent n

Power.java which contain the details of creating the Power class and the method power which should calculate the power of any number a raised to the exponent n.

  Program of rainfall report

Write a PROGRAM that reads in from a ?le a starting month name, an ending month name,and then the monthly rainfall for each month during that period.

  Expression whose value is distance between two point

a structured type with two fields, x and y, both of type double-- write an expression whose value is the distance between the two point represented by p1 and p2.

  How many scores they will enter

Because all users may not have 10 scores and we want to keep the scores they entered for use at a later date, the above program will have to be modified to add a menu that lets the user decide how many scores they will enter

  Identify at least two advantages to using oop

Use the Internet to research the advantages, features, and common examples of OOP and EDP. Note: You may use the Association for Computing Machinery (ACM) Digital Library to support research on the above topics.

  Direction and magnitude be integers or doubles

Design the program consider Will the direction and magnitude be integers or doubles - will the input vectors be passed by value, by reference, or by const reference?

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