- fixed graphics issues

This commit is contained in:
Dorian Zedler 2020-02-25 21:19:29 +01:00
parent 7235dc86d5
commit 0bc6d3e6f7
13 changed files with 37 additions and 9 deletions

7
.classpath Normal file
View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="build/ConnectFour.jar"/>
<classpathentry kind="output" path="build/compiled"/>
</classpath>

17
.project Normal file
View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>connect-four</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1 +1,3 @@
Manifest-Version: 1.0
Main-Class: de.itsblue.ConnectFour.ConnectFour
Class-Path: .

View file

@ -7,7 +7,7 @@ else
cd ./compiled
find ../../src -name "*.java" > sources.txt
javac -d ./ @sources.txt
find ../../res -name "*" > compiledSources.txt
find -name "*.class" > compiledSources.txt
jar cvmf ../MANIFEST.MF ../ConnectFour.jar ../../res/* @compiledSources.txt
find ./ -name "*.class" > compiledSources.txt
cp find ../../src -name "res" ./ >> compiledSources.txt
jar cvmf ../../MANIFEST.MF ../ConnectFour.jar @compiledSources.txt
fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

View file

@ -57,10 +57,10 @@ public class PlateContainer extends Canvas {
*/
PlateContainer() {
// initialize all images
containerImg = Toolkit.getDefaultToolkit().getImage(getClass().getResource("/res/container.png"));
plateRedImg = Toolkit.getDefaultToolkit().getImage(getClass().getResource("/res/plateRed.png"));
plateYellowImg = Toolkit.getDefaultToolkit().getImage(getClass().getResource("/res/plateYellow.png"));
highlightImg = Toolkit.getDefaultToolkit().getImage(getClass().getResource("/res/highlight.png"));
containerImg = Toolkit.getDefaultToolkit().getImage(ConnectFour.class.getResource("res/container.png"));
plateRedImg = Toolkit.getDefaultToolkit().getImage(getClass().getResource("res/plateRed.png"));
plateYellowImg = Toolkit.getDefaultToolkit().getImage(getClass().getResource("res/plateYellow.png"));
highlightImg = Toolkit.getDefaultToolkit().getImage(getClass().getResource("res/highlight.png"));
}
/**

View file

@ -53,7 +53,8 @@ public class RemotePlayerClient extends RemotePlayer {
this.startListening();
}
public void handleResponse(String response) {
@Override
public void handleResponse(String response) {
System.out.println("[SOCKET] Got: " + response);
if (response.startsWith("setUsingPlateType")) {

View file

@ -64,7 +64,8 @@ public class RemotePlayerServer extends RemotePlayer {
this.startListening();
}
public void handleResponse(String response) {
@Override
public void handleResponse(String response) {
if (response.startsWith("doMove")) {
if (this.isMyTurn)
this.doMove(Integer.parseInt(response.split(" ")[1]));

View file

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View file

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View file

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB