联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> OS作业OS作业

日期:2018-05-30 04:51


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 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

Inspiration

The original Tribbles for inspiration (from Star Trek: The Original Series).

Submission

Submit your zipped pde file directly to Canvas.

0.5 Did they submit a Processing sketch?

0.5 Does the sketch run?

0.5 Is the code organized and clean?

0.5 Does the code have proper comments?

1.5 200 tribbles are drawn using array.

1.0 Tribbles generate at random positions.

1.5 The tribbles are not synchronized (they start in different states).

1.5 Every five seconds tribbles wake up and get excited.

1.5 In excited state, tribbles vibrate for two seconds (horizontally by 1 pixel each frame, randomly) before

settling down and continuing to sleep.

1.0 Tribbles are drawn with an interpretation of "fuzzy". They are not just drawn as circles.


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp