Sprite : A 2D or 3D character/object in game.
A sprite can have various properties like its position, name, features, memory etc. The class below represents a sprite which has following properties -
int x; // x - position
int y; // y - position
double theta; // direction
String name; // name of sprite
boolean explored[][]; //memory of explored map
BufferedImage img[]; //face for our sprite
----------------------------
Code for Part two
--------------------------------
import java.awt.image.*;
class sprite{
int x;
int y;
double theta;
String name;
boolean explored[][];
BufferedImage img[];
public sprite(String n, int x1,int y1){
name = n;
x=x1;
y=y1;
theta = 0;
explored = new boolean[20][20];
img = new BufferedImage[4];
explored[x][y] = true;
}
}