Define methods and instance variables for the class

Assignment Help Computer Engineering
Reference no: EM131996033

Assignment: Your assignment is to create a sketch that defines a class called "Tribble". A Tribble is a small fuzzy creature kept as a cute pet that breeds quickly. Your sketch should create hundreds of instances of Tribbles around the screen and show them doing their thing. Define methods and instance variables for the class Tribble as appropriate.

Tribbles look like small fuzzy blobs. You can start by drawing them as circles, but your final sketch should show your interpretation of what "fuzzy" means. Tribbles spend most of their time sleeping (not moving). Every five seconds they wake up and get excited and vibrate for two seconds (horizontally by 1 pixel each frame, randomly), then settle down and continue sleeping.

Each instance of Tribble should be on its own schedule of vibration and should start at a random location on the screen. Optional: give each Tribble a random color.

Timed Behavior: Each Tribble should have a boolean instance variable to indicate whether it is asleep or excited. It will also probably need some integer counts for timing so you know how long it has been asleep or excited.

Sequence: • Start with one Tribble. Define a simple class.

• Get simple drawing, random location, and setup done.

• Add the "excited" behavior (assume it is excited all the time).

• Add the sleep-wakeup timed behavior using your integer instance variables.

• Make the drawing better (fuzzier)

• Declare and initialize an array of 5 Tribbles

• Create all the instances to fill up your array (passing random locations and other values to the constructor)

• Update your draw() function to loop through and draw all the Tribbles and do any other calls needed

• Check that the sleeping-wakeup behavior is correct

• Check that all the tribbles are not synchronized (pass random integer counts to constructor to start them in different states)

• Increase the array size to 200

Reference no: EM131996033

Questions Cloud

Define health information governance : Discuss the major components of health information governance and its importance on health care organization information systems.
What is the balanced equation for ethane c2h5 : What is the balanced equation for Ethane C2H5 and oxygen which combust to form carbon dioxide and water?
Why the steering committee is very important for the success : Discuss how you would go about implementing a health information technology (HIT) strategic plan for data security, privacy, and quality management.
What is the balanced equation for nitrogen : What is the balanced equation for Nitrogen, Water and oxygen which are all produced by the decomposition of ammonium nitrate?
Define methods and instance variables for the class : Your assignment is to create a sketch that defines a class called "Tribble". A Tribble is a small fuzzy creature kept as a cute pet that breeds quickly.
Kept of the quantity of plutonium received : In the nuclear industry, detailed records are kept of the quantity of plutonium received, transported, or used.
Research physical security incidents : Write a paper on a physical security incident and recommend fixes to prevent the incident from happening again
Pick one molecule and describe how scientists theorize : Pick one molecule and describe how scientists theorize it formed.
Discuss the challenges it divisions face : Your plan should include the following: Discuss the challenges IT divisions face in achieving regulatory compliance.

Reviews

Write a Review

Computer Engineering Questions & Answers

  How are the two directory services alike

Windows Server uses Active Directory for its directory service, and NetWare/OES uses NDS. How are the two directory services alike? How are they different?

  Design a web page named taxes.html

design a Web page named taxes.html and enter the IncomeTax function into the HEAD (enclosed in SCRIPT tags). In the BODY of the page, prompt the user to enter values representing his or her income and itemized deduction. The page should call the I..

  Find a maximum-size independent set in g

An independent set of a graph G=(V;E) is a subset V`C= V of vertices such that each edge in E is incident on at most one vertex in V`. The independent-set problem is to find a maximum-size independent set in G.

  Questionsome of your friends work on wireless networks and

questionsome of your friends work on wireless networks and theyre at present studying the properties of a network of n

  Write the function insertion_sort

Write the function insertion_sort(a) that takes an array of numbers and returns an array of the same values in nondecreasing order, without modifying a.

  Predict the future role of the communication technology

Predict the future role of the communication technology you've selected for both personal and commercial use.

  Evaluate a polynomial at a given real value

Write a function to evaluate a polynomial at a given real value a.

  What is the spectrum of a signal

What is the spectrum of a signal? What is the bandwidth of a signal? Why would analog data have to be modulated onto an analog signal?

  Examine the differences between distributed data processing

take a position on the following statement mainframe computers are still needed even though personal computers and

  Discuss the pros and cons of the synthesis approach

This approachis the antithesis of the layered approach, in which the path through the kernel is extended so that building the operating system is made easier. Discuss the pros and cons of the Synthesis approach to kernel design and to system-perfo..

  Information systems typically support different work

information systems typically support different work models. you have been asked to create a report on what work

  State advantages and disadvantages of waterfall approach

Based on your reading and research, select at least three of the SDLC Phases. In Microsoft Word, write a 3-5 page paper about them.

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