CS 106A Lecture Notes - Lecture 3: Bouncing Ball, Init

46 views6 pages

Document Summary

Five regions: north, south, east west, and center. Interactors allow users to interact with program (like built-in widgets) You can add an interactor to window by calling add(interactor, location); Locations are specified regions above: north, south, east, west, and center. Init is actually secretly called before the run method always. The init is usually hidden, but when a program contains an init method, the computer searches and runs the init method written by the programmer. Purpose of init is to set up the program. Setting up guis (interactors) and adding to the program. We want to adjust acceleration due to gravity and how much the ball bounced back up due to elasticity. The jslider control lets the user visually choose from a range of integer values. You can construct a new slider that ranges from min to max add(new jslider(0, 100, 50), south);

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents