Hallo, in Eclipse gibt es ja die Möglichkeit, Programme in einer jar File zu exportieren, und diese sozusagen ohne Eclipse starten zu können.
Hab ich auch schon oft gemacht und ist ja auch eine feine Sache.
Ich habe vor zwei Jahren mit einem Spiel angefangen, mit dem ich vor einigen Monaten schon fertig geworden bin. Allerdings gab es beim exportieren immer einen Fehler. Daher habe ich das immer durch Eclipse gespielt.
Undzwar nutzte ich die LWJGL Klassen, welche ich in den Properties -> Java Build Path -> Libraries auch hinzugefügt habe.
Das Programm funktioniert auch ohne Probleme. Jetzt habe ich in den letzten Jahren einiges dazugelernt, und würde es jetzt wohl mit mehreren Klassen und anders strukturiert machen.
Früher als ich damit angefangen habe, habe ich mich von der Objektorientierung an sich erstmal mehr oder weniger ferngehalten und alles in eine Klasse gepackt. Aber hey. Es funktioniert. Nur der Export funktioniert nicht obwohl ich auch die Option "Extract required libraries into generated JAR" aktiviert habe.
Könnt ihr mal nachschauen, woran das liegt?
Wenn euch das Spiel gefällt, könnt ihr das auch gerne für euch nutzten, nur gebt es bitte nicht so Preis, als ob es von euch wäre, oder ladet es wo anders hoch. Weil das ist mein ersten "größeres" Projekt und das bedeutet mir doch schon einiges.
Ich weiß, dass das für die geübten unter euch schon sehr unschön und unsauber Programmiert aussieht, aber ich wollte das jetzt nicht alles wieder ändern und solange es funktioniert lasse ich es so.
Die beiden unteren Variablen "activeController" und "gegenComputer" sind halt dafür da, ob ihr nen Joystick nutzen wollt, oder die Tastatur (WASD oder Pfeiltasten(aber Seitenvertausch zu WASD)) und ob ihr gegen den Computer spielen wollt, oder ob eine zweite Person den rechten Pong mit den Pfeiltasten hoch/runter steuert und die erste Person mit W/S.
Ein Spiel hat 5 Runden und P = Pause und Restart(wenn Spiel vorbei), ESC zum Beenden.
Wenn ihr das so testet, dann seht ihr das alles klappt, BIS AUF DAS EXPORTIEREN in ein jar-File. Ich hoffe ihr findet den Fehler. Wie gesagt, die LWJGL Klassen werden benötigt.
Es kommt ja auch kein Fehler. Er erstellt die Datei, aber beim draufklicken passiert NICHTS.
Danke,
Gruß BK
Hab ich auch schon oft gemacht und ist ja auch eine feine Sache.
Ich habe vor zwei Jahren mit einem Spiel angefangen, mit dem ich vor einigen Monaten schon fertig geworden bin. Allerdings gab es beim exportieren immer einen Fehler. Daher habe ich das immer durch Eclipse gespielt.
Undzwar nutzte ich die LWJGL Klassen, welche ich in den Properties -> Java Build Path -> Libraries auch hinzugefügt habe.
Das Programm funktioniert auch ohne Probleme. Jetzt habe ich in den letzten Jahren einiges dazugelernt, und würde es jetzt wohl mit mehreren Klassen und anders strukturiert machen.
Früher als ich damit angefangen habe, habe ich mich von der Objektorientierung an sich erstmal mehr oder weniger ferngehalten und alles in eine Klasse gepackt. Aber hey. Es funktioniert. Nur der Export funktioniert nicht obwohl ich auch die Option "Extract required libraries into generated JAR" aktiviert habe.
Könnt ihr mal nachschauen, woran das liegt?
Wenn euch das Spiel gefällt, könnt ihr das auch gerne für euch nutzten, nur gebt es bitte nicht so Preis, als ob es von euch wäre, oder ladet es wo anders hoch. Weil das ist mein ersten "größeres" Projekt und das bedeutet mir doch schon einiges.
Ich weiß, dass das für die geübten unter euch schon sehr unschön und unsauber Programmiert aussieht, aber ich wollte das jetzt nicht alles wieder ändern und solange es funktioniert lasse ich es so.
Java:
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
import org.lwjgl.input.Controllers;
import org.lwjgl.input.Controller;
import org.lwjgl.input.Keyboard;
public class Pong{
Controller controller;
boolean pause = false;
boolean tempPause = true;
int richtungv = (Math.random()<0.5)?0:1; // 0 = runter // 1 = hoch // 2+ = stop //
int richtungh = (Math.random()<0.5)?0:1; // 0 = rechts // 1 = links // 2+ = stop //
byte scoreL = 0;
byte scoreR = 0;
byte scoreMax = 5; //Punkteanzahl, die zum siegen benötigt wird
int fensterX = 1340; //Fensterbreite (xWert)
int fensterY = 680; //Fensterhöhe (yWert)
int pongLaengeL = 100;
int pongLaengeR = 100;
int pongVerkleinerung = (int) pongLaengeL / 20;
boolean einseitig = false;
int ballDicke = 15;
int pongDicke = 15;
int pongSeitenabstand = 35;
int posx = (int) (fensterX / 2)-(ballDicke/2);
int posy = (int) (fensterY / 2)-(ballDicke/2);
double lpos = (fensterY / 2)-(pongLaengeL/2);
int lposAus = (int) (fensterY / 2)-(pongLaengeL/2);
double rpos = (fensterY / 2)-(pongLaengeR/2);
int rposAus = (int) (fensterY / 2)-(pongLaengeR/2);
long startTime = System.currentTimeMillis();
long tempTime = System.currentTimeMillis() + 3000;
double speedVerhältnisL = 0.6; /*! <1.0 !*/ //Verhältnis Ball-Pong also [Ball*speedVerhältnis = pongSpeed]
double speedVerhältnisR = 0.6; /*! <1.0 !*/ //Verhältnis Ball-Pong also [Ball*speedVerhältnis = pongSpeed]
byte speed = 10;
boolean gegenComputer = true;
boolean activeController = false;
//////KONSTRUKTOR
public Pong(){
try {
Display.setDisplayMode(new DisplayMode(fensterX, fensterY));
Display.setTitle("Pong v3.2_2");
Display.setVSyncEnabled(true);
Display.setLocation(10, 10);
Display.create();
Keyboard.create();
}catch(LWJGLException e) {
e.printStackTrace();
Display.destroy();
Controllers.destroy();
Keyboard.destroy();
System.exit(-1);
}
if(activeController){
try {
Controllers.create();
controller = Controllers.getController(0);
}catch(Exception e) {
activeController = false;
System.out.println("Controller wurde nicht gefunden!");
}
if(activeController){
speedVerhältnisL = 0.7;
speedVerhältnisR = 0.7;
}
}
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0, fensterX, 0, fensterY, 1, -1);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
durchführung();
}
//////INIT
public void init(){
startTime = System.currentTimeMillis();
tempTime = System.currentTimeMillis() + 3000;
tempPause = true;
pause = false;
richtungv = (Math.random()<0.5)?0:1; // 0 = runter // 1 = hoch // 2+ = stop //
richtungh = (Math.random()<0.5)?0:1; // 0 = rechts // 1 = links // 2+ = stop //
scoreR = 0;
scoreL = 0;
posx = (int) (fensterX / 2)-(ballDicke/2);
posy = (int) (fensterY / 2)-(ballDicke/2);
durchführung();
}
//////DURCHFÜHRUNG
public void durchführung(){
startTime = System.currentTimeMillis();
tempTime = System.currentTimeMillis() + 3000;
while(!pause){
startsequenz();
input();
wandBerechnung();
ballBewegung();
einseitig();
richtungAendern();
paint();
}
}
//////STARTSEQUENZ
public void startsequenz(){
if(((startTime + 1000) <= System.currentTimeMillis()) && ((startTime + 2000) >= System.currentTimeMillis())) {
scoreR = 3;
scoreL = 3;
tempPause = true;
einseitig = false;
}if(((startTime + 2000) <= System.currentTimeMillis()) && ((startTime + 3000) >= System.currentTimeMillis())) {
scoreR = 2;
scoreL = 2;
tempPause = true;
}if(((startTime + 3000) <= System.currentTimeMillis()) && ((startTime + 4000) >= System.currentTimeMillis())) {
scoreR = 1;
scoreL = 1;
tempPause = true;
}if(((startTime + 4000) <= System.currentTimeMillis()) && ((startTime + 5000) >= System.currentTimeMillis())) {
scoreR = 0;
scoreL = 0;
tempPause = false;
if(gegenComputer == true){
speedVerhältnisR = 0.9;
einseitig = true;
}else{
einseitig = false;
}
}
if((tempTime + 1000) >= System.currentTimeMillis()){
tempPause = true;
}else{
tempPause = false;
}
}
//////INPUT
public void input(){
if(Display.isCloseRequested()){
Display.destroy();
Controllers.destroy();
Keyboard.destroy();
System.exit(0);
}
if(activeController){
if(controller.isButtonPressed(0)){
Display.destroy();
Controllers.destroy();
Keyboard.destroy();
System.exit(0);
}
while(Controllers.next()){
if(Controllers.getEventButtonState()){
if(Controllers.getEventButtonState() == controller.isButtonPressed(1)){
pause = true;
pause();
}
}
}
controller.poll();
lpos -= controller.getAxisValue(0) * speed * speedVerhältnisL;
lposAus = (int) lpos;
if(!einseitig){
rpos -= controller.getAxisValue(1) * speed * speedVerhältnisR;
rposAus = (int) rpos;
}
}else{
if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)){
Display.destroy();
Keyboard.destroy();
Controllers.destroy();
System.exit(0);
}
while (Keyboard.next()) {
if (Keyboard.getEventKeyState()) {
if (Keyboard.getEventKey() == Keyboard.KEY_P) {
pause = true;
pause();
}
}
}
if(Keyboard.isKeyDown(Keyboard.KEY_W) || Keyboard.isKeyDown(Keyboard.KEY_LEFT)){
lpos += 1 * speed*speedVerhältnisL;
}
if(Keyboard.isKeyDown(Keyboard.KEY_S) || Keyboard.isKeyDown(Keyboard.KEY_RIGHT)){
lpos -= 1 * speed*speedVerhältnisL;
}
if(!einseitig){
if(Keyboard.isKeyDown(Keyboard.KEY_A) || Keyboard.isKeyDown(Keyboard.KEY_UP)){
rpos += 1 * speed*speedVerhältnisR;
}
if(Keyboard.isKeyDown(Keyboard.KEY_D) || Keyboard.isKeyDown(Keyboard.KEY_DOWN)){
rpos -= 1 * speed*speedVerhältnisR;
}
}
}
lposAus = (int) lpos;
rposAus = (int) rpos;
}
//////WAND BERECHNUNG
public void wandBerechnung(){
if(lposAus <= -1){
lpos = 0;
lposAus = 0;
}else if(lposAus >= ((fensterY+1) - pongLaengeL + (scoreL*pongVerkleinerung))){
lpos = (fensterY - pongLaengeL + (scoreL*pongVerkleinerung));
lposAus = (int) lpos;
}
if(rposAus <= -1){
rpos = 0;
rposAus = 0;
}else if(rposAus >= ((fensterY+1) - pongLaengeR + (scoreR*pongVerkleinerung))){
rpos = (fensterY - pongLaengeR + (scoreR*pongVerkleinerung));
rposAus = (int) rpos;
}
}
//////BALL BEWEGUNG
public void ballBewegung(){
if(!tempPause){
if (richtungv == 0) {
posy = posy + 1 * speed;
} else if (richtungv == 1) {
posy = posy - 1 * speed;
}
if (richtungh == 0) {
posx = posx + 1 * speed;
} else if (richtungh == 1) {
posx = posx - 1 * speed;
}
}
}
//////EINSEITIG
public void einseitig(){
if(einseitig){
//rpos = posy - (0.5 * pongLaenge);
if((rpos + (0.5 * (pongLaengeR - (scoreR*pongVerkleinerung)))) - (posy + (0.5 * ballDicke)) > speed){
rpos -= 1 * speed*speedVerhältnisR;
}else if((rpos + (0.5 * pongLaengeR - (scoreR*pongVerkleinerung))) - (posy + (0.5 * ballDicke)) < -speed){
rpos += 1 * speed*speedVerhältnisR;
}
rposAus = (int) rpos;
}
}
//////RICHTUNG
public void richtungAendern(){
if(posy >= (fensterY -ballDicke)){
richtungv = 1;
}else if(posy <= 0){
richtungv = 0;
}
else if(posx <= (pongSeitenabstand+pongDicke) && ((posy-lposAus) < (pongLaengeL-(scoreL*pongVerkleinerung)) && (posy-lposAus) > -ballDicke)){
richtungh = 0;
}else if(posx <= (pongSeitenabstand+pongDicke) && !((posy-lposAus) < (pongLaengeL-(scoreL*pongVerkleinerung)) && (posy-lposAus) > -ballDicke)){
richtungh = 0;
scoreR++;
tempPause = true;
tempTime = System.currentTimeMillis();
posx = (int) (fensterX / 2)-(ballDicke/2);
if((scoreL >= scoreMax) || (scoreR >= scoreMax)){
paint();
beenden();
}
}
else if(posx >= (fensterX - (pongSeitenabstand+pongDicke+ballDicke)) && ((posy-rposAus) < (pongLaengeR-(scoreR*pongVerkleinerung)) && (posy-rposAus) > -ballDicke)){
richtungh = 1;
}else if(posx >= (fensterX - (pongSeitenabstand+pongDicke+ballDicke)) && !((posy-rposAus) < (pongLaengeR-(scoreR*pongVerkleinerung)) && (posy-rposAus) > -ballDicke)){
richtungh = 1;
scoreL++;
tempPause = true;
tempTime = System.currentTimeMillis();
posx = (int) (fensterX / 2)-(ballDicke/2);
if((scoreL >= scoreMax) || (scoreR >= scoreMax)){
paint();
beenden();
}
}
}
//////PAINT
public void paint(){
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
GL11.glLoadIdentity();
//LINKER PONG
GL11.glBegin(GL11.GL_QUADS);
if(scoreL==5){
GL11.glColor3f(0.0f, 1.0f, 0.0f);
}else if(scoreR==5){
GL11.glColor3f(1.0f, 0.0f, 0.0f);
}else{
GL11.glColor3f(1.0f, 1.0f, 1.0f);
}
GL11.glVertex2i(pongSeitenabstand, lposAus);
GL11.glVertex2i(pongSeitenabstand+pongDicke, lposAus);
GL11.glVertex2i(pongSeitenabstand+pongDicke, lposAus+pongLaengeL-(scoreL*pongVerkleinerung));
GL11.glVertex2i(pongSeitenabstand, lposAus+pongLaengeL-(scoreL*pongVerkleinerung));
GL11.glEnd();
//RECHTER PONG
GL11.glBegin(GL11.GL_QUADS);
if(scoreR==5){
GL11.glColor3f(0.0f, 1.0f, 0.0f);
}else if(scoreL==5){
GL11.glColor3f(1.0f, 0.0f, 0.0f);
}else{
GL11.glColor3f(1.0f, 1.0f, 1.0f);
}
GL11.glVertex2i((fensterX - (pongSeitenabstand+pongDicke)), rposAus);
GL11.glVertex2i((fensterX - pongSeitenabstand), rposAus);
GL11.glVertex2i((fensterX - pongSeitenabstand), rposAus+pongLaengeR-(scoreR*pongVerkleinerung));
GL11.glVertex2i((fensterX - (pongSeitenabstand+pongDicke)), rposAus+pongLaengeR-(scoreR*pongVerkleinerung));
GL11.glEnd();
//BALL
GL11.glBegin(GL11.GL_QUADS);
GL11.glColor3f(1.0f, 1.0f, 1.0f);
GL11.glVertex2i(posx, posy);
GL11.glVertex2i(posx+ballDicke, posy);
GL11.glVertex2i(posx+ballDicke, posy+ballDicke);
GL11.glVertex2i(posx, posy+ballDicke);
GL11.glEnd();
//MITTELLINIE
GL11.glBegin(GL11.GL_QUADS);
GL11.glColor3f(1.0f,1.0f,1.0f);
GL11.glVertex2i((fensterX/2)-1, fensterY);
GL11.glVertex2i((fensterX/2)+1, fensterY);
GL11.glVertex2i((fensterX/2)+1, 0);
GL11.glVertex2i((fensterX/2)-1, 0);
GL11.glEnd();
//HINTERGRUNDFARBE
GL11.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
//TEXT ANZEIGE
GL11.glColor3d(255, 255, 255);
drawString(scoreL+"", 50, fensterY - 50);
drawString(scoreR+"", fensterX - 50, fensterY - 50);
Display.update();
Display.sync(60);
return;
}
//////TEXT
public static void drawString(String s, int x, int y){
int startX = x;
GL11.glBegin(GL11.GL_POINTS);
for(char c : s.toLowerCase().toCharArray()){
if(c == '0'){
for(int i=1;i<=7;i++){
GL11.glVertex2f(x+1, y+i);
GL11.glVertex2f(x+7, y+i);
}
for(int i=2;i<=6;i++){
GL11.glVertex2f(x+i, y+8);
GL11.glVertex2f(x+i, y+0);
}
x+=8;
}else if(c == '1'){
for(int i=2;i<=6;i++){
GL11.glVertex2f(x+i, y);
}
for(int i=1;i<=8;i++){
GL11.glVertex2f(x+4, y+i);
}
GL11.glVertex2f(x+3, y+7);
x += 8;
}else if(c == '2'){
for(int i=1;i<=6;i++){
GL11.glVertex2f(x+i, y);
}
for(int i=2;i<=5;i++){
GL11.glVertex2f(x+i, y+8);
}
GL11.glVertex2f(x+1, y+7);
GL11.glVertex2f(x+1, y+6);
GL11.glVertex2f(x+6, y+7);
GL11.glVertex2f(x+6, y+6);
GL11.glVertex2f(x+6, y+5);
GL11.glVertex2f(x+5, y+4);
GL11.glVertex2f(x+4, y+3);
GL11.glVertex2f(x+3, y+2);
GL11.glVertex2f(x+2, y+1);
x += 8;
}else if(c == '3'){
for(int i=1;i<=5;i++){
GL11.glVertex2f(x+i, y+8);
GL11.glVertex2f(x+i, y);
}
for(int i=1;i<=7;i++){
GL11.glVertex2f(x+6, y+i);
}
for(int i=2;i<=5;i++){
GL11.glVertex2f(x+i, y+4);
}
x += 8;
}else if(c == '4'){
for(int i=2;i<=8;i++){
GL11.glVertex2f(x+1, y+i);
}
for(int i=2;i<=7;i++){
GL11.glVertex2f(x+i, y+1);
}
for(int i=0;i<=4;i++){
GL11.glVertex2f(x+4, y+i);
}
x+=8;
}else if(c == '5'){
for(int i=1;i<=7;i++){
GL11.glVertex2f(x+i, y+8);
}
for(int i=4;i<=7;i++){
GL11.glVertex2f(x+1, y+i);
}
GL11.glVertex2f(x+1, y+1);
GL11.glVertex2f(x+2, y);
GL11.glVertex2f(x+3, y);
GL11.glVertex2f(x+4, y);
GL11.glVertex2f(x+5, y);
GL11.glVertex2f(x+6, y);
GL11.glVertex2f(x+7, y+1);
GL11.glVertex2f(x+7, y+2);
GL11.glVertex2f(x+7, y+3);
GL11.glVertex2f(x+6, y+4);
GL11.glVertex2f(x+5, y+4);
GL11.glVertex2f(x+4, y+4);
GL11.glVertex2f(x+3, y+4);
GL11.glVertex2f(x+2, y+4);
x += 8;
}else if(c == '6'){
for(int i=1;i<=7;i++){
GL11.glVertex2f(x+1, y+i);
}
for(int i=2;i<=6;i++){
GL11.glVertex2f(x+i, y);
}
for(int i=2;i<=5;i++){
GL11.glVertex2f(x+i, y+4);
GL11.glVertex2f(x+i, y+8);
}
GL11.glVertex2f(x+7, y+1);
GL11.glVertex2f(x+7, y+2);
GL11.glVertex2f(x+7, y+3);
GL11.glVertex2f(x+6, y+4);
x+=8;
}else if(c == '7'){
for(int i=0;i<=7;i++)
GL11.glVertex2f(x+i, y+8);
GL11.glVertex2f(x+7, y+7);
GL11.glVertex2f(x+7, y+6);
GL11.glVertex2f(x+6, y+5);
GL11.glVertex2f(x+5, y+4);
GL11.glVertex2f(x+4, y+3);
GL11.glVertex2f(x+3, y+2);
GL11.glVertex2f(x+2, y+1);
GL11.glVertex2f(x+1, y);
x+=8;
}else if(c == '8'){
for(int i=1;i<=7;i++){
GL11.glVertex2f(x+1, y+i);
GL11.glVertex2f(x+7, y+i);
}
for(int i=2;i<=6;i++){
GL11.glVertex2f(x+i, y+8);
GL11.glVertex2f(x+i, y+0);
}
for(int i=2;i<=6;i++){
GL11.glVertex2f(x+i, y+4);
}
x += 8;
}else if(c == '9'){
for(int i=1;i<=7;i++){
GL11.glVertex2f(x+7, y+i);
}
for(int i=5;i<=7;i++){
GL11.glVertex2f(x+1, y+i);
}
for(int i=2;i<=6;i++){
GL11.glVertex2f(x+i, y+8);
GL11.glVertex2f(x+i, y+0);
}
for(int i=2;i<=6;i++){
GL11.glVertex2f(x+i, y+4);
}
GL11.glVertex2f(x+1, y+0);
x += 8;
}else if(c == '.'){
GL11.glVertex2f(x+1, y);
x+=2;
}else if(c == ','){
GL11.glVertex2f(x+1, y);
GL11.glVertex2f(x+1, y+1);
x+=2;
}else if(c == '\n'){
y-=10;
x = startX;
}else if(c == ' '){
x += 8;
}
}
GL11.glEnd();
}
//////PAUSE
public void pause(){
richtungv += 2;
richtungh += 2;
while(pause){
Display.update();
if(activeController){
while(Controllers.next()){
if(Controllers.getEventButtonState()){
if(Controllers.getEventButtonState() == controller.isButtonPressed(1)){
pause = false;
}
}
}
if(controller.isButtonPressed(0)){
Display.destroy();
Controllers.destroy();
Keyboard.destroy();
System.exit(0);
}
if(Display.isCloseRequested()){
Display.destroy();
Controllers.destroy();
Keyboard.destroy();
System.exit(0);
}
}else{
while (Keyboard.next()) {
if (Keyboard.getEventKeyState()) {
if (Keyboard.getEventKey() == Keyboard.KEY_P) {
pause = false;
}
}
}
if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)){
Display.destroy();
Controllers.destroy();
Keyboard.destroy();
System.exit(0);
}
if(Display.isCloseRequested()){
Display.destroy();
Controllers.destroy();
Keyboard.destroy();
System.exit(0);
}
}
paint();
}
richtungv -= 2;
richtungh -= 2;
pause = false;
return;
}
//////BEENDEN
public void beenden(){
if(scoreL > scoreR)System.err.println("Spieler 1 hat gewonnen!");
if(scoreL < scoreR)System.err.println("Spieler 2 hat gewonnen!");
if(scoreL == scoreR)System.err.println("Unentschieden!");
pause = true;
while(pause){
Display.update();
if(activeController){
if(controller.isButtonPressed(0) || Display.isCloseRequested()){
Display.destroy();
Controllers.destroy();
Keyboard.destroy();
System.exit(0);
}
while(Controllers.next()){
if(Controllers.getEventButtonState()){
if(Controllers.getEventButtonState() == controller.isButtonPressed(1)){
pause = false;
init();
}
}
}
}else{
if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) || Display.isCloseRequested()){
Display.destroy();
Controllers.destroy();
Keyboard.destroy();
System.exit(0);
}
while (Keyboard.next()) {
if (Keyboard.getEventKeyState()) {
if (Keyboard.getEventKey() == Keyboard.KEY_P) {
pause = false;
init();
}
}
}
}
}
}
//////MAIN
public static void main(String[] args){
new Pong();
}
}
Ein Spiel hat 5 Runden und P = Pause und Restart(wenn Spiel vorbei), ESC zum Beenden.
Wenn ihr das so testet, dann seht ihr das alles klappt, BIS AUF DAS EXPORTIEREN in ein jar-File. Ich hoffe ihr findet den Fehler. Wie gesagt, die LWJGL Klassen werden benötigt.
Es kommt ja auch kein Fehler. Er erstellt die Datei, aber beim draufklicken passiert NICHTS.
Danke,
Gruß BK