Commit 80f1c245 authored by Anton Danilov's avatar Anton Danilov Committed by Anton Danilov

#322 Initial commit - created basic classes for CrimeScene game

parent e96b2230
......@@ -82,6 +82,9 @@ game_in_the_darkness_description=Procvičování seriality
game_in_the_darkness_preloader1=Naplánuj krok za krokem průchod labyrintem.
game_in_the_darkness_preloader2=Přetahuj správné úkony do pásu vpravo a\u00A0dávej pozor na všechny překážky. Teprve až budeš mít naplánovanou celou trasu, stiskni tlačítko HOTOVO.
game_crime_scene_title="Místo činu"
game_crime_scene_description="*Popis hry Místo činu*"
# <!-- Robbery -->
robbery_1_finished=Pouta standard
robbery_1_finished_description=Za dohrání první hry
......
......@@ -82,6 +82,9 @@ game_in_the_darkness_description=Training der Serialität
game_in_the_darkness_preloader1=Plane Schritt für Schritt den\u00A0Weg duch das\u00A0Labyrinth.
game_in_the_darkness_preloader2=Ziehe die\u00A0richtigen Handlungen auf die\u00A0rechte Seite und\u00A0pass auf alle Hindernisse auf. Sobald du die\u00A0ganze Route geplant hast, drücke den\u00A0Knopf FERTIG.
game_crime_scene_title="*DE*Místo činu"
game_crime_scene_description="*DE* *Popis hry Místo činu*"
# <!-- Robbery -->
robbery_1_finished=Handschellen Standard
robbery_1_finished_description=Für das Beenden des ersten Spiels
......
......@@ -84,6 +84,9 @@ game_in_the_darkness_description=Precvičovanie seriality
game_in_the_darkness_preloader1=Naplánuj krok za krokom prechod labyrintom.
game_in_the_darkness_preloader2=Preťahuj správne úkony do pásu vpravo a\u00A0dávaj pozor na všetky prekážky. Až keď budeš mať naplánovanú celú trasu, stlač tlačítko HOTOVO.
game_crime_scene_title="*SK* Místo činu"
game_crime_scene_description="*SK* * Popis hry Místo činu*"
# <!-- Robbery -->
robbery_1_finished=Púta štandard
robbery_1_finished_description=Za dohranie prvej hry
......
......@@ -6,6 +6,7 @@ import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.TablexiaApplication;
import cz.nic.tablexia.bus.ApplicationBus;
import cz.nic.tablexia.bus.ApplicationBus.ApplicationEvent;
import cz.nic.tablexia.game.games.crime_scene.CrimeSceneGame;
import cz.nic.tablexia.game.games.in_the_darkness.InTheDarknessGame;
import cz.nic.tablexia.game.games.kidnapping.KidnappingGame;
import cz.nic.tablexia.game.games.kidnapping.util.KidnappingResultResolver;
......@@ -28,7 +29,8 @@ public enum GameDefinition implements ApplicationEvent, IMenuItem {
KIDNAPPING (3, ApplicationTextManager.ApplicationTextsAssets.GAME_KIDNAPPING_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_KIDNAPPING_DESCRIPTION, KidnappingGame.class, false, new KidnappingResultResolver(), ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_ERROR, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_ERROR),
NIGHT_WATCH (4, ApplicationTextManager.ApplicationTextsAssets.GAME_NIGHT_WATCH_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_NIGHT_WATCH_DESCRIPTION, NightWatchGame.class, false, new NightWatchGame.GameResultResolver(), ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
SHOOTING_RANGE (5, ApplicationTextManager.ApplicationTextsAssets.GAME_SHOOTING_RANGE_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_SHOOTING_RANGE_DESCRIPTION, ShootingRangeGame.class, false, new ShootingRangeResultResolver(), ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
IN_THE_DARKNESS (6, ApplicationTextManager.ApplicationTextsAssets.GAME_IN_THE_DARKNESS_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_IN_THE_DARKNESS_DESCRIPTION, InTheDarknessGame.class, true, new InTheDarknessGame.GameResultResolver(),ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_ERROR, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_ERROR);
IN_THE_DARKNESS (6, ApplicationTextManager.ApplicationTextsAssets.GAME_IN_THE_DARKNESS_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_IN_THE_DARKNESS_DESCRIPTION, InTheDarknessGame.class, true, new InTheDarknessGame.GameResultResolver(),ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_ERROR, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_ERROR),
CRIME_SCENE (8, ApplicationTextManager.ApplicationTextsAssets.GAME_CRIME_SCENE_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_CRIME_SCENE_DESCRIPTION, CrimeSceneGame.class, false, new CrimeSceneGame.GameResultResolver(), ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_ERROR, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_ERROR);
public interface GameResultResolver {
AbstractTablexiaGame.GameResult getGameCupsResult(Game game);
......
package cz.nic.tablexia.game.games.crime_scene;
import com.badlogic.gdx.scenes.scene2d.Group;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.GameDefinition;
import cz.nic.tablexia.game.games.in_the_darkness.map.widget.MapWidget;
import cz.nic.tablexia.shared.model.Game;
/**
* Created by danilov on 11.4.16.
*/
public class CrimeSceneGame extends AbstractTablexiaGame<List<MapWidget>> implements MapWidget.TileMapClickListener{
private static int DEFAULT_SCORE = 2;
public static class GameResultResolver implements GameDefinition.GameResultResolver {
//TODO define score with errors and difficulty
@Override
public AbstractTablexiaGame.GameResult getGameCupsResult(Game game) {
int errorsCount = DEFAULT_SCORE;
if (errorsCount < 1) {
return AbstractTablexiaGame.GameResult.THREE_STAR;
} else if (errorsCount < 2) {
return AbstractTablexiaGame.GameResult.TWO_STAR;
} else if (errorsCount < 3) {
return AbstractTablexiaGame.GameResult.ONE_STAR;
} else {
return AbstractTablexiaGame.GameResult.NO_STAR;
}
}
@Override
public float getGameScoreResult(Game game) {
return DEFAULT_SCORE;
}
}
public static final String SCORE_KEY_ERRORS_COUNT = "errors_count";
private Group contentGroup;
@Override
protected void gameLoaded(Map<String, String> gameState) {
//TODO create actors and add them to stage
contentGroup = new Group();
getStage().addActor(contentGroup);
}
@Override
protected void gameVisible() {
}
@Override
protected void gamePaused(Map<String, String> gameState) {
}
@Override
protected void gameEnd() {
}
@Override
protected void screenResized(int width, int height) {
}
@Override
protected List<SummaryMessage> getSummaryMessageForGameResult(Game game) {
return Arrays.asList(new SummaryMessage(SummaryImage.STATS, getFormattedText("result_errors_count", game.getGameScore(SCORE_KEY_ERRORS_COUNT, "0"))));
}
@Override
protected String getTextKeyForGameResult(GameResult gameResult) {
//TODO make *.properties file with dialog texts
switch (gameResult) {
case THREE_STAR:
return "Three stars text";
case TWO_STAR:
return "Two stars text";
case ONE_STAR:
return "One star text";
case NO_STAR:
return "No star text";
default:
return "No star text";
}
}
@Override
protected String getSoundNameForGameResult(GameResult gameResult) {
//TODO add sounds and create paths
switch (gameResult) {
case THREE_STAR:
case TWO_STAR:
case ONE_STAR:
case NO_STAR:
default:
return null;
}
}
@Override
protected List<MapWidget> prepareGameData(Map<String, String> gameState) {
//TODO prepare generating of crime scene objects for game
List<MapWidget> mapWidgets = new ArrayList<MapWidget>();
return mapWidgets;
}
@Override
protected void prepareGameSoundAssetNames(List<String> soundsFileNames) {
// TODO prepare game sound asset names
}
@Override
public void onBookmarkClick(int mapWidgetNumber) {
}
}
package cz.nic.tablexia.game.games.crime_scene;
import com.badlogic.gdx.graphics.Texture;
/**
* Objects placed in game Crime scene map
*
* Created by danilov on 11.4.16.
*/
public enum CrimeSceneObjectType {
DEMO_OBJECT (null, null);
private Texture texture;
private String soundPath;
CrimeSceneObjectType(Texture texture, String soundPath) {
this.texture = texture;
this.soundPath = soundPath;
}
public Texture getTexture() {
return texture;
}
public String getSoundPath() {
return soundPath;
}
}
package cz.nic.tablexia.game.games.crime_scene.assets;
/**
* Created by danilov on 11.4.16.
*/
public class CrimeSceneAssets {
public static final String GFX_PATH = "gfx/";
//TODO add assets and create paths
}
......@@ -81,6 +81,9 @@ public class ApplicationTextManager extends TablexiaDataManager<I18NBundle> impl
public static final String GAME_IN_THE_DARKNESS_DESCRIPTION = "game_in_the_darkness_description";
public static final String GAME_IN_THE_DARKNESS_PRELOADER_TEXT1 = "game_in_the_darkness_preloader1";
public static final String GAME_IN_THE_DARKNESS_PRELOADER_TEXT2 = "game_in_the_darkness_preloader2";
public static final String GAME_CRIME_SCENE_TITLE = "game_crime_scene_title";
public static final String GAME_CRIME_SCENE_DESCRIPTION = "game_crime_scene_description";
public static final String GAME_DIFFICULTY_NAME = "gamedifficulty_name";
public static final String GAME_SCORE = "game_score";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment