Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Stap0;
- import java.awt.Color;
- import java.awt.Graphics;
- //Author: André van Ginkel
- public class Vis
- {
- private int x, y, breedte, hoogte;
- private final int ZWEMT_LINKS = 0;
- private final int ZWEMT_RECHTS = 1;
- private final int DRIJFT = 2;
- private final int SLAAPT = 3;
- public Vis(int x, int y, int breedte, int hoogte)
- {
- this.x = x;
- this.y = y;
- this.breedte = breedte;
- this.hoogte = hoogte;
- }
- public void setX(int x)
- {
- //bepaal de x-waarde
- this.x = x;
- }
- public void setY(int y)
- {
- //bepaal de y-waarde
- this.y = y;
- }
- public void teken( Graphics g)
- {
- g.setColor(Color.ORANGE);
- g.fillOval(x, y, breedte *8/10, hoogte *6/10);
- g.fillRect(x +breedte *8/10, y, breedte *2/10, hoogte *6/10);
- }
- }
Add Comment
Please, Sign In to add comment