Refactoring Ball'java - PowerPoint PPT Presentation

1 / 4
About This Presentation
Title:

Refactoring Ball'java

Description:

Knows color, position, size, etc (very similar to the Circle.java class you are writing in HW#6) ... What do lv, lh, sv, and sh mean? What about sx and sy? ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 5
Provided by: markf91
Category:
Tags: ball | class | java | refactoring

less

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