This commit is contained in:
Robert Vokac 2024-08-09 15:05:58 +02:00
parent e8f3523a38
commit 042f6dc15c
No known key found for this signature in database
GPG Key ID: C459E1E4B4A986BB
11 changed files with 436 additions and 30 deletions

1
clean.sh Executable file
View File

@ -0,0 +1 @@
./gradlew clean $1

View File

@ -17,20 +17,29 @@
// <https://www.gnu.org/licenses/> or write to the Free Software // <https://www.gnu.org/licenses/> or write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
package com.openeggbert.compatibility;
package com.openeggbert.entity.common; import lombok.Getter;
import com.openeggbert.compatibility.FeatureLevel;
/** /**
* *
* @author robertvokac * @author robertvokac
*/ */
public class GameFile { public enum ImageFormats {
BMP("blp", "bmp"),
private FeatureLevel compatibilityMode; PNG("png"),
private GameFileType gameFileType; JPEG("jpeg")
private String path; ;
private String name; @Getter
private String originalSha512Sum; private String[] fileExtensions;
@Getter
private boolean openEggbertOnly;
ImageFormats(String... fileExtensionsIn) {
this(true, fileExtensionsIn);
}
ImageFormats(boolean openEggbertOnlyIn, String... fileExtensionsIn) {
this.fileExtensions = fileExtensionsIn;
this.openEggbertOnly = openEggbertOnlyIn;
}
} }

View File

@ -17,13 +17,13 @@
// <https://www.gnu.org/licenses/> or write to the Free Software // <https://www.gnu.org/licenses/> or write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
package com.openeggbert.compatibility;
package com.openeggbert.entity.common;
/** /**
* *
* @author robertvokac * @author robertvokac
*/ */
public class GameFiles { public enum ImageResolution {
NORMAL, DOUBLE;
} }

View File

@ -0,0 +1,46 @@
///////////////////////////////////////////////////////////////////////////////////////////////
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
// Copyright (C) 2024 the original author or authors.
//
// This program is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see
// <https://www.gnu.org/licenses/> or write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
///////////////////////////////////////////////////////////////////////////////////////////////
package com.openeggbert.compatibility;
import lombok.Getter;
/**
*
* @author robertvokac
*/
public enum MusicFormats {
MIDI("blp", "mid"),
MP3("mp3"),
OGG("ogg"),
WAV("wav")
;
@Getter
private String[] fileExtensions;
@Getter
private boolean openEggbertOnly;
MusicFormats(String... fileExtensionsIn) {
this(true, fileExtensionsIn);
}
MusicFormats(boolean openEggbertOnlyIn, String... fileExtensionsIn) {
this.fileExtensions = fileExtensionsIn;
this.openEggbertOnly = openEggbertOnlyIn;
}
}

View File

@ -17,22 +17,29 @@
// <https://www.gnu.org/licenses/> or write to the Free Software // <https://www.gnu.org/licenses/> or write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
package com.openeggbert.compatibility;
import lombok.Getter;
package com.openeggbert.entity.common;
import com.openeggbert.compatibility.FeatureLevel;
import com.openeggbert.compatibility.ResolutionMode;
import lombok.Data;
/** /**
* *
* @author robertvokac * @author robertvokac
*/ */
@Data public enum SoundFormats {
public class GameExecution { WAV("blp", "wav"),
private FeatureLevel compatibilityMode; MP3("mp3"),
private ResolutionMode resolutionMode = ResolutionMode.RESOLUTION_640_480; OGG("ogg")
private Boolean cheatsEnabled = true; ;
@Getter
private String[] fileExtensions;
@Getter
private boolean openEggbertOnly;
SoundFormats(String... fileExtensionsIn) {
this(true, fileExtensionsIn);
}
SoundFormats(boolean openEggbertOnlyIn, String... fileExtensionsIn) {
this.fileExtensions = fileExtensionsIn;
this.openEggbertOnly = openEggbertOnlyIn;
}
} }

View File

@ -28,13 +28,22 @@ import lombok.Getter;
* @author robertvokac * @author robertvokac
*/ */
public enum OpenEggbertScreenType { public enum OpenEggbertScreenType {
INIT("INIT.BMP"), INIT("INIT"),
GAMER("GAMER.BLP"), GAMER("GAMER"),
DEMO("DECOR016.BMP"); MAIN_HUB(""),
SUB_HUB(""),
GAME(""),
DEMO("DECOR016"),//todo fix me
;
@Getter @Getter
private String fileName; private String fileNameWithoutExtension;
OpenEggbertScreenType() {
this.fileNameWithoutExtension = "";
}
OpenEggbertScreenType(String fileName) { OpenEggbertScreenType(String fileName) {
this.fileName = fileName; this.fileNameWithoutExtension = fileName;
} }
} }

View File

@ -0,0 +1,79 @@
///////////////////////////////////////////////////////////////////////////////////////////////
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
// Copyright (C) 2024 the original author or authors.
//
// This program is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see
// <https://www.gnu.org/licenses/> or write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
///////////////////////////////////////////////////////////////////////////////////////////////
package com.openeggbert.screens;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.utils.ScreenUtils;
import com.openeggbert.main.OpenEggbertGame;
/**
*
* @author robertvokac
*/
public class AbstractGameScreen extends AbstractOpenEggbertScreen {
public AbstractGameScreen(OpenEggbertGame openEggbertGame) {
super(openEggbertGame);
}
@Override
public void show() {
Gdx.input.setInputProcessor(new InputAdapter() {
@Override
public boolean keyDown(int keyCode) {
game.setScreen(new InitScreen(game));
return true;
}
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
game.setScreen(new InitScreen(game));
return true;
}
});
}
@Override
public void renderOpenEggbertScreen(float delta) {
ScreenUtils.clear(0f, 0f, 0f, 1f);
batch.begin();
drawBackgroundIfAvailable();
BitmapFont font;
font = new BitmapFont();
font.getData().setScale(2.0f);
font.setColor(Color.RED);
font.draw(batch, "Sorry, game is not yet implemented", 40, 400);
font.draw(batch, "Please, press any key", 40, 300);
font.draw(batch, "to return to the main screen", 40, 250);
batch.end();
}
@Override
public void hide() {
Gdx.input.setInputProcessor(null);
}
}

View File

@ -48,7 +48,7 @@ public abstract class AbstractOpenEggbertScreen extends ScreenAdapter {
private final String getBackgroundFileName() { private final String getBackgroundFileName() {
//return "INIT.BLP.BMP"; //return "INIT.BLP.BMP";
return getScreenType().isPresent() ? getScreenType().get().getFileName() : ""; return getScreenType().isPresent() ? getScreenType().get().getFileNameWithoutExtension(): "";
} }
protected Optional<OpenEggbertScreenType> getScreenType() { protected Optional<OpenEggbertScreenType> getScreenType() {

View File

@ -0,0 +1,85 @@
///////////////////////////////////////////////////////////////////////////////////////////////
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
// Copyright (C) 2024 the original author or authors.
//
// This program is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see
// <https://www.gnu.org/licenses/> or write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
///////////////////////////////////////////////////////////////////////////////////////////////
package com.openeggbert.screens;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.utils.ScreenUtils;
import com.openeggbert.entity.common.OpenEggbertScreenType;
import com.openeggbert.main.OpenEggbertGame;
import java.util.Optional;
/**
*
* @author robertvokac
*/
public class GameScreen extends AbstractGameScreen {
public GameScreen(OpenEggbertGame openEggbertGame) {
super(openEggbertGame);
}
protected final Optional<OpenEggbertScreenType> getScreenType() {
return Optional.of(OpenEggbertScreenType.GAME);
}
@Override
public void show() {
Gdx.input.setInputProcessor(new InputAdapter() {
@Override
public boolean keyDown(int keyCode) {
game.setScreen(new InitScreen(game));
return true;
}
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
game.setScreen(new InitScreen(game));
return true;
}
});
}
@Override
public void renderOpenEggbertScreen(float delta) {
ScreenUtils.clear(0f, 0f, 0f, 1f);
batch.begin();
drawBackgroundIfAvailable();
BitmapFont font;
font = new BitmapFont();
font.getData().setScale(2.0f);
font.setColor(Color.RED);
font.draw(batch, "Sorry, demo is not yet implemented", 40, 400);
font.draw(batch, "Please, press any key", 40, 300);
font.draw(batch, "to return to the main screen", 40, 250);
batch.end();
}
@Override
public void hide() {
Gdx.input.setInputProcessor(null);
}
}

View File

@ -0,0 +1,85 @@
///////////////////////////////////////////////////////////////////////////////////////////////
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
// Copyright (C) 2024 the original author or authors.
//
// This program is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see
// <https://www.gnu.org/licenses/> or write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
///////////////////////////////////////////////////////////////////////////////////////////////
package com.openeggbert.screens;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.utils.ScreenUtils;
import com.openeggbert.entity.common.OpenEggbertScreenType;
import com.openeggbert.main.OpenEggbertGame;
import java.util.Optional;
/**
*
* @author robertvokac
*/
public class MainHubScreen extends AbstractGameScreen {
public MainHubScreen(OpenEggbertGame openEggbertGame) {
super(openEggbertGame);
}
protected final Optional<OpenEggbertScreenType> getScreenType() {
return Optional.of(OpenEggbertScreenType.MAIN_HUB);
}
@Override
public void show() {
Gdx.input.setInputProcessor(new InputAdapter() {
@Override
public boolean keyDown(int keyCode) {
game.setScreen(new InitScreen(game));
return true;
}
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
game.setScreen(new InitScreen(game));
return true;
}
});
}
@Override
public void renderOpenEggbertScreen(float delta) {
ScreenUtils.clear(0f, 0f, 0f, 1f);
batch.begin();
drawBackgroundIfAvailable();
BitmapFont font;
font = new BitmapFont();
font.getData().setScale(2.0f);
font.setColor(Color.RED);
font.draw(batch, "Sorry, demo is not yet implemented", 40, 400);
font.draw(batch, "Please, press any key", 40, 300);
font.draw(batch, "to return to the main screen", 40, 250);
batch.end();
}
@Override
public void hide() {
Gdx.input.setInputProcessor(null);
}
}

View File

@ -0,0 +1,85 @@
///////////////////////////////////////////////////////////////////////////////////////////////
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
// Copyright (C) 2024 the original author or authors.
//
// This program is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see
// <https://www.gnu.org/licenses/> or write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
///////////////////////////////////////////////////////////////////////////////////////////////
package com.openeggbert.screens;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.utils.ScreenUtils;
import com.openeggbert.entity.common.OpenEggbertScreenType;
import com.openeggbert.main.OpenEggbertGame;
import java.util.Optional;
/**
*
* @author robertvokac
*/
public class SubHubScreen extends AbstractGameScreen {
public SubHubScreen(OpenEggbertGame openEggbertGame) {
super(openEggbertGame);
}
protected final Optional<OpenEggbertScreenType> getScreenType() {
return Optional.of(OpenEggbertScreenType.SUB_HUB);
}
@Override
public void show() {
Gdx.input.setInputProcessor(new InputAdapter() {
@Override
public boolean keyDown(int keyCode) {
game.setScreen(new InitScreen(game));
return true;
}
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
game.setScreen(new InitScreen(game));
return true;
}
});
}
@Override
public void renderOpenEggbertScreen(float delta) {
ScreenUtils.clear(0f, 0f, 0f, 1f);
batch.begin();
drawBackgroundIfAvailable();
BitmapFont font;
font = new BitmapFont();
font.getData().setScale(2.0f);
font.setColor(Color.RED);
font.draw(batch, "Sorry, demo is not yet implemented", 40, 400);
font.draw(batch, "Please, press any key", 40, 300);
font.draw(batch, "to return to the main screen", 40, 250);
batch.end();
}
@Override
public void hide() {
Gdx.input.setInputProcessor(null);
}
}