Refactoring Ball'java PowerPoint PPT Presentation

presentation player overlay
1 / 4
About This Presentation
Transcript and Presenter's Notes

Title: Refactoring Ball'java


1
Session 27
  • Refactoring Ball.java
  • CannonGame

2
Refactoring Ball into three classes
  • Ball.java
  • Knows color, position, size, etc (very similar to
    the Circle.java class you are writing in HW6)
  • MoveableBall.java
  • Extends Ball
  • Is responsible for all actions pertaining to
    motion
  • BoundedBall.java
  • Worries about staying in bounds
  • (Version 4)

3
Activity
  • What color is the cannon ball?
  • What is the role of dy()?
  • How does the CannonGame draw the cannon?
  • What do lv, lh, sv, and sh mean? What about sx
    and sy?
  • How does the cannon ball follow the prescribed
    angle, when we dont pass the angle to the cannon
    ball?
  • How does the cannon ball reverse direction?
  • How does the game know that the ball has hit
    something (either the target or the floor)?
  • How does the program terminate?

4
The CannonGame Application
  • Lets go to the tape, Jim
Write a Comment
User Comments (0)
About PowerShow.com