Skip to content
Snippets Groups Projects
Commit 40c84fdc authored by Chaowen Zeng's avatar Chaowen Zeng
Browse files

Deleted src/ShadowTreasure.java, src/Player.java, src/Sandwich.java,...

Deleted src/ShadowTreasure.java, src/Player.java, src/Sandwich.java, src/Zombie.java, src/.DS_Store files
parent 823ae066
No related branches found
No related tags found
No related merge requests found
File deleted
import bagel.Image;
import bagel.util.Point;
/**
* a movable entity: player
*/
public class Player{
/**
* the player's image displayed in the window
*/
private final Image image;
/**
* render position of the player in the window
*/
private Point pos;
/**
* Player's current energy value
*/
private int energy;
/**
* constructor
* @param x abscissa
* @param y ordinate
*/
public Player(double x, double y,int energy) {
this.image = new Image("res/images/player.png");
this.pos = new Point(x,y);
this.energy = energy;
}
/**
* draw player on the background
*/
public void draw() {
image.drawFromTopLeft(pos.x, pos.y);
}
}
import bagel.Image;
import bagel.util.Point;
/**
* a stationary entity: sandwich
*/
public class Sandwich{
/**
* the sandwich's image displayed in the window
*/
private Image image;
/**
* a Point object representing the position of the sandwich
*/
private Point pos;
/**
* constructor
* @param x abscissa
* @param y ordinate
*/
public Sandwich(double x, double y){
this.image = new Image("res/images/sandwich.png");
this.pos = new Point(x,y);
}
/**
* draw sandwich on the background
*/
public void draw() {
image.drawFromTopLeft(pos.x, pos.y);
}
}
import bagel.*;
import java.io.IOException;
/**
* an example Bagel game.
*/
public class ShadowTreasure extends AbstractGame {
/**
* background image
*/
private final Image BACKGROUND = new Image("res/images/background.png");
/**
* Performs a state update.
*/
@Override
public void update(Input input)
{
// Draw background
BACKGROUND.drawFromTopLeft(0, 0);
}
/**
* The entry point for the program.
*/
public static void main(String[] args) throws IOException {
ShadowTreasure game = new ShadowTreasure();
game.run();
}
}
import bagel.Image;
import bagel.util.Point;
/**
* a stationary entity: zombie
*/
public class Zombie{
/**
* the zombie's image displayed in the window
*/
private Image image;
/**
* a Point object representing the position of the zombie
*/
private Point pos;
/**
* constructor
* @param x abscissa
* @param y ordinate
*/
public Zombie(double x, double y){
this.image = new Image("res/images/zombie.png");
this.pos = new Point(x,y);
}
/**
* draw zombie on the background
*/
public void draw() {
image.drawFromTopLeft(pos.x, pos.y);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment