#Need help loading Sprite and having it move across the screen.
1 messages · Page 1 of 1 (latest)
There are a lot of assigment remarks in there, what's the exact issue?
well i now narrowed it down but im getting an error regarding the public static void main(String [] args) part
public class Main{
// Fields (Static) below...
public static Color c = new Color (255,0,255);
public static boolean isImageDrawn = false;
public static stopWatchX timer = new stopWatchX(250);
public static Queue<Vector2D> vecs1 = new LinkedList<>();
public static Queue<Vector2D> vecs2 = new LinkedList<>();
public static Vector2D currentVec = new Vector2D(-100, -100);
// End Static fields...
public static void main(String[] args) {
for(int i = -128; i <1500; i++)
{
currentVec.setX(i);
currentVec.setY(760);
vecs1.add(new Vector2D (currentVec.getX(), currentVec.getY()));
}
}
/* This is your access to the "game loop" (It is a "callback" method from the Control class (do NOT modify that class!))*/
public static void update(Control ctrl) {
// TODO: This is where you can code! (Starting code below is just to show you how it works)
ctrl.addSpriteToFrontBuffer(currentVec.getX(),760, "heart");
if(timer.isTimeUp())
{
currentVec = (Vector2D) vecs1.peek();
vecs2.add(new Vector2D (currentVec.getX(), currentVec.getY()));
vecs1.remove();
timer.resetWatch();
}
// Additional Static methods below...(if needed)
}
the whole point is to make the sprite appear and move left to right on the screen. it is just i am not getting anywhere with the code