package com.study.tank; import java.awt.*; /** * @author xsj * @date 2022/10/28 15:37 */ public class Wall extends GameObject { int width; int height; public GameModel gm; public Rectangle rectangle; public Wall(int x, int y, int width, int height, GameModel gameModel) { this.x = x; this.y = y; this.width = width; this.height = height; this.gm = gameModel; rectangle = new Rectangle(x, y, width, height); } @Override public void paint(Graphics g) { Color c = g.getColor(); g.setColor(Color.GRAY); g.fillRect(this.x, this.y, this.width, this.height); g.setColor(c); } }