You did not use the site, Click here to remain logged. Timeout: 60 second

APCS Shorts (JAVA) GridWorld Part II - Pages 10-13

203 lượt xem
Xuất bản 29/06/2016
PLEASE CLICK AN AD TO SUPPORT THIS PROJECT! Today we covered all of Part II except for the Excercises. The focus here was to compare and contrast the Bug and BoxBug classes. We also talked about main classes or "Runner" classes. We found that a BoxBug is a Bug is an Actor is an Object. So, all that BoxBug has to do to make a square path is to override the act() method. All other methods are inherited from Bug or Actor! Exercise 1 is similar to BoxBug: CircleBug turns 45 degrees CW like Bug, not 90 degrees CW like BoxBug. HTH, A. Jorge Garcia Applied Math, Physics & CS
act move java turn inheritance shorts apcs gridworld bug boxbug canmove subclass superclass overide