Sunday, October 28, 2012

JAVA Week 9



This week, we learned about inheritance and how different parts of classes can be passed into other classes.  Our assignment was really fun!!  We were supposed to write a class that extends the main Finch class  - that includes methods that could be used to turn our Finch into a controller.  The methods are supposed to be generic enough to be able to use the Finch to control various possible games.
The methods that we had to include and write the code for are:


  • calibrate buttons
  • is left button down
  • is right button down
  • change in accelerometer x, y, and z individually
  • change in accelerometer x,y,z in one reading

I got stuck for a little while on the accelerometer methods.  Well, not writing the methods, but figuring out how the accelerometer worked and how that information would be used for the controller. I think I did a pretty good job.  I used a dialog box in my calibrate buttons method - which I thought was pretty clever.  :)  I wish we could look at everyone else's code to see how other people wrote their programs.  These are really small programs, so I'm sure there are not that many correct ways to write them, but still, it would be fun to see other people's thought process.  I hope mine is right!!


My Finch got a makeover.  Yay Glitter!


  


No comments:

Post a Comment