Changed size to resolution of arcade screen
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
package control;
|
||||
|
||||
public class Button {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package control;
|
||||
|
||||
public class JoyStick {
|
||||
|
||||
}
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class Window extends JFrame {
|
||||
});
|
||||
|
||||
//Set window to fullscreen
|
||||
setExtendedState(getExtendedState() | JFrame.MAXIMIZED_BOTH);
|
||||
// setExtendedState(getExtendedState() | JFrame.MAXIMIZED_BOTH);
|
||||
setUndecorated(true);
|
||||
|
||||
//Create Events
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package model.drawObjects;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
public abstract class DrawObject {
|
||||
|
||||
protected Point2D middlePoint;
|
||||
protected AffineTransform transform;
|
||||
protected int index = 0,width,height;
|
||||
|
||||
public DrawObject(int x, int y) {
|
||||
middlePoint = new Point2D.Double(x, y);
|
||||
transform = new AffineTransform();
|
||||
}
|
||||
|
||||
public abstract void draw(Graphics2D g2);
|
||||
public abstract void update();
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package model.drawObjects;
|
||||
|
||||
import image.Images;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
public class Player extends DrawObject {
|
||||
|
||||
private BufferedImage img;
|
||||
|
||||
public Player(int x, int y){
|
||||
super(x,y);
|
||||
img = Images.getImage(Images.ImageType.player);
|
||||
|
||||
}
|
||||
|
||||
public void draw(Graphics2D g2){//
|
||||
g2.drawImage(img, transform, null);
|
||||
}
|
||||
|
||||
public void update(){
|
||||
transform = new AffineTransform();
|
||||
transform.rotate(Math.toRadians(index*45),middlePoint.getX(),middlePoint.getY());
|
||||
transform.translate(middlePoint.getX() - width/2, middlePoint.getY() - height*2);
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
package view;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.event.ActionEvent;
|
||||
@@ -27,6 +27,7 @@ public class GameView extends JPanel implements ActionListener{
|
||||
this.led=led;
|
||||
t = new Timer(1000/30, this);
|
||||
t.start();
|
||||
setPreferredSize(new Dimension(1280,1024));
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
|
||||
Reference in New Issue
Block a user