mirror of
https://github.com/Noratrieb/Java2DGame.git
synced 2026-01-14 22:15:01 +01:00
inital commit
This commit is contained in:
parent
5b9846011c
commit
0d5397dbe3
35 changed files with 955 additions and 0 deletions
27
src/main/java/objects/ships/Shell.java
Normal file
27
src/main/java/objects/ships/Shell.java
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package objects.ships;
|
||||
|
||||
import core.Master;
|
||||
import core.Vector2D;
|
||||
import objects.GameObject;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class Shell extends GameObject {
|
||||
|
||||
|
||||
public Shell(Vector2D position, Vector2D size, Vector2D velocity) {
|
||||
super(position, size);
|
||||
this.velocity = velocity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Graphics2D g2d, int w, Master master) {
|
||||
g2d.setPaint(Color.orange);
|
||||
g2d.fillOval((int) position.x, (int) position.y, (int) size.x, (int) size.y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Master master) {
|
||||
position.add(velocity);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue