This commit is contained in:
Pan 2019-05-22 21:02:21 +12:00
parent 48ff37eed2
commit ce5a72c85b
3 changed files with 17 additions and 0 deletions

View File

@ -2,5 +2,6 @@
<classpath> <classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path=""/> <classpathentry kind="src" path=""/>
<classpathentry kind="lib" path="mysql-connector-java-5.1.47.jar"/>
<classpathentry kind="output" path=""/> <classpathentry kind="output" path=""/>
</classpath> </classpath>

View File

@ -12,6 +12,7 @@ import javax.swing.JPanel;
import enemyAI.*; import enemyAI.*;
import gui.*; import gui.*;
import java.sql.*;
public class mainThread extends JFrame implements KeyListener, ActionListener, MouseMotionListener, MouseListener, FocusListener{ public class mainThread extends JFrame implements KeyListener, ActionListener, MouseMotionListener, MouseListener, FocusListener{
@ -68,6 +69,18 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M
public static int mouseX, mouseY, centerScreenX, centerScreenY, currentMouseX, currentMouseY; public static int mouseX, mouseY, centerScreenX, centerScreenY, currentMouseX, currentMouseY;
public mainThread(){ public mainThread(){
try {
Class.forName("com.mysql.jdbc.Driver");
Connection connect = DriverManager.getConnection("jdbc:mysql://remotemysql.com/TDYAgrQ1Ny?useSSL=false", "TDYAgrQ1Ny", "SrexYcsOSv");
connect.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
setTitle("Battle Tank 3"); setTitle("Battle Tank 3");
panel= (JPanel) this.getContentPane(); panel= (JPanel) this.getContentPane();
panel.setPreferredSize(new Dimension(768, 512)); panel.setPreferredSize(new Dimension(768, 512));
@ -226,6 +239,9 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M
currentMouseX = MouseInfo.getPointerInfo().getLocation().x; currentMouseX = MouseInfo.getPointerInfo().getLocation().x;
currentMouseY = MouseInfo.getPointerInfo().getLocation().y; currentMouseY = MouseInfo.getPointerInfo().getLocation().y;
centerScreenX = getLocationOnScreen().x + 384;
centerScreenY = getLocationOnScreen().y + 256;
int deltaX = currentMouseX - centerScreenX; int deltaX = currentMouseX - centerScreenX;
int deltaY = currentMouseY - centerScreenY; int deltaY = currentMouseY - centerScreenY;

Binary file not shown.