Add second year
This commit is contained in:
13
second/semester2/CT255/Assignments/Assigment-05/Player.java
Normal file
13
second/semester2/CT255/Assignments/Assigment-05/Player.java
Normal file
@ -0,0 +1,13 @@
|
||||
import java.awt.*;
|
||||
import javax.swing.*;
|
||||
|
||||
public class Player extends Sprite2D {
|
||||
public Player(Image image) {
|
||||
super(image);
|
||||
}
|
||||
|
||||
// method to move the player by the supplied distance
|
||||
public void move(int distance) {
|
||||
x += distance; // x is inherited from the Sprite2D superclass
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user