LittleBoss1Bullet.java 751 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package com.sf.game.obj;
  2. import com.sf.game.utils.GameUtils;
  3. import java.awt.*;
  4. import com.sf.game.GameWin;
  5. public class LittleBoss1Bullet extends GameObj{
  6. public LittleBoss1Bullet() {
  7. super();
  8. }
  9. public LittleBoss1Bullet(Image img, int width, int height, int x, int y, double speed, GameWin frame) {
  10. super(img, width, height, x, y, speed, frame);
  11. }
  12. public LittleBoss1Bullet(Image img, int x, int y, double speed) {
  13. super(img, x, y, speed);
  14. }
  15. public LittleBoss1Bullet(int x, int y) {
  16. super(x, y);
  17. }
  18. @Override
  19. public void paintSelf(Graphics g) {
  20. super.paintSelf(g);
  21. y+=speed;
  22. //越界判断
  23. if(this.y>800){
  24. GameUtils.removeList.add(this);
  25. }
  26. }
  27. @Override
  28. public Rectangle getRec() {
  29. return super.getRec();
  30. }
  31. }