首页 > > 详细

辅导留学生JSP语言程序、JSP讲解留学生、辅导留学生asp程序、JSP设计讲解留学生

CMPS 5J – Program 5
Spring 2018
Goal The purpose of this asignment is to create odles and odles of Tribles.
Assignment
Your asignment is to create a sketch that defines a clas caled "Trible". A Trible is a small fuzy creature
kept as a cute pet that breds quickly. Your sketch should create hundreds of instances of Tribles around the
scren and show them doing their thing. Define methods and instance variables for the class Trible as
appropriate.

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

Each instance of Trible should be on its own schedule of vibration and should start at a random location on
the scren. Optional: give each Tribble a random color.
Timed Behavior.
Each Trible should have a bolean instance variable to indicate whether it is aslep or excited. It wil also
probably need some integer counts for timing so you know how long it has been asleep or excited.

Sequence
• Start with one Trible. Define a simple clas.
• Get simple drawing, random location, and setup done.
• Add the "excited" behavior. (asume it is excited al the time).
• Add the slep-wakeup timed behavior. using your integer instance variables.
• Make the drawing better (fuzzier)
• Declare and initialize an aray of 5 Tribles
• Create al the instances to fil up your aray (pasing random locations and other values to the constructor)
• Update your draw() function to lop through and draw al the Tribles and do any other calls needed
• Check that the sleping-wakeup behavior. is corect
• Check that al the tribles are not synchronized (pas random integer counts to constructor to start them in
diferent states)
• Increase the aray size to 20

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

Submision
Submit your ziped 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 coments?
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 diferent 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
setling down and continuing to slep.
1.0 Tribbles are drawn with an interpretation of "fuzzy". They are not just drawn as circles.

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!