Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Rectangle;
- import java.util.LinkedList;
- import java.util.Random;
- public class Block extends GameObject{
- Random r = new Random();
- public Block(float x, float y, ID id) {
- super(x,y, id);
- }
- public void tick(LinkedList<GameObject> object) {
- }
- public void render(Graphics g) {
- Graphics2D g2d = (Graphics2D) g;
- g.setColor(Color.CYAN);
- g.fillRect((int)x, (int)y, 32, 32);
- //g2d.setStroke(new BasicStroke(3));
- //g.setColor(Color.WHITE);
- g.drawRect((int)x, (int)y, 32, 32);
- g.setColor(Color.red);
- g2d.draw(getBounds());
- }
- public Rectangle getBounds() {
- return new Rectangle((int)x,(int)y,32,32);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement