📄 pinball.java
字号:
//// PinBall class. Extends Ball class//// From Chapter 7 of// Understanging Object-Oriented Programming with Java// Written by Tim Budd// Published by Addison-Wesley Longman//// See ftp://ftp.cs.orst.edu/pub/budd/java/ReadMe.html // for further information//import java.awt.*;public class PinBall extends Ball { public PinBall (int sx, int sy) { super(sx, sy, 10); // start out moving (roughly) vertical setMotion (-2 + Math.random()/4, -15); } private double gravityEffect = 0.3; public void move () { dy = dy + gravityEffect; // effect of gravity super.move(); // update the ball position }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -