Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Goal The purpose of this assignment is to create oodles and oodles of Tribbles. Assignment Your assignment is to create a sketch that defines a

image text in transcribed
Goal The purpose of this assignment is to create oodles and oodles of Tribbles. 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 wll 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 * Inspiration The original Tribbles for inspiration (from Star Trek: The Original Series) Goal The purpose of this assignment is to create oodles and oodles of Tribbles. 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 wll 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 * Inspiration The original Tribbles for inspiration (from Star Trek: The Original Series)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions