Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6cd8ee4c1 |
@@ -25,5 +25,4 @@ replay_pid*
|
|||||||
|
|
||||||
target/
|
target/
|
||||||
|
|
||||||
engine-pi.*
|
engine-pi.properties
|
||||||
kebab.properties
|
|
||||||
|
|||||||
@@ -3,7 +3,5 @@
|
|||||||
"java.format.settings.url": "https://raw.githubusercontent.com/engine-pi/engine-pi/refs/heads/main/subprojects/build-tools/src/main/resources/eclipse-formatter.xml",
|
"java.format.settings.url": "https://raw.githubusercontent.com/engine-pi/engine-pi/refs/heads/main/subprojects/build-tools/src/main/resources/eclipse-formatter.xml",
|
||||||
"editor.tabSize": 4,
|
"editor.tabSize": 4,
|
||||||
"editor.insertSpaces": true,
|
"editor.insertSpaces": true,
|
||||||
"java.configuration.updateBuildConfiguration": "automatic",
|
"java.configuration.updateBuildConfiguration": "automatic"
|
||||||
"java.compile.nullAnalysis.mode": "disabled",
|
|
||||||
"terminal.integrated.defaultProfile.linux": "sh"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,74 +8,146 @@ Kleine Indie-Company. Sehr bescheiden. Wir machen. Döner. Revolutionär.
|
|||||||
|
|
||||||
## Story
|
## Story
|
||||||
|
|
||||||
- unsere Idee: Döner Bude errichten
|
* unsere Idee: Döner Bude errichten
|
||||||
- Investition kleine Hüte kaufen
|
* Sponsor bei Bank
|
||||||
- Döner laden aufmachen nach und nach lvln und Geld machen
|
* Investition kleine Hüte kaufen
|
||||||
- Upgrades Arbeiter und mehr DÖNER Mehr kunden
|
* Döner laden aufmachen nach und nach lvln und Geld machen
|
||||||
- Cookie clicker like main Story
|
* Upgrades Arbeiter und mehr DÖNER Mehr kunden
|
||||||
- und Mini-Spiele um Geld zu verdienen zb Jump n Run
|
* Cookie clicker like main Story
|
||||||
|
* und Mini-Spiele um Geld zu verdienen zb Jump n Run
|
||||||
|
|
||||||
|
|
||||||
## Kollaboration
|
## Prozess, Reflexion, Planung
|
||||||
|
|
||||||
- Sprache auf Englisch
|
|
||||||
- erst pullen!!! (IMMER)
|
|
||||||
- Dateien speichern bevor commit
|
|
||||||
- um zu commiten (git commit -a -m "-Nachricht-")
|
|
||||||
- bitte immer bei Nachricht hereinschreiben was geändert wurde
|
|
||||||
|
|
||||||
|
* Wie Geld? (Clicker Prinzip vorerst mit Upgrades)
|
||||||
|
* weitere Iteration vllt Döner selber machen (VLLT)
|
||||||
|
* eigene Grafik? (durch Website; Pixel; von [OpenGameArt](https://opengameart.org/):
|
||||||
|
[UI Pack](https://opengameart.org/content/pixui-asset-pack-1-ctatz))
|
||||||
|
|
||||||
## Weiterführende Links
|
## Weiterführende Links
|
||||||
|
|
||||||
- [Javadocs der Engine Pi](https://engine-pi.github.io/javadocs/pi/package-summary.html)
|
* [Javadocs der Engine Pi](https://engine-pi.github.io/javadocs/pi/package-summary.html)
|
||||||
- [Doku der Engine Pi](https://engine-pi.github.io/engine-pi/)
|
* [Doku der Engine Pi](https://engine-pi.github.io/engine-pi/)
|
||||||
|
|
||||||
|
|
||||||
## Rahmenbedingungen für das Projekt
|
## Rahmenbedingungen für das Projekt
|
||||||
|
|
||||||
- Freiwillige Benotung (mündliche Noten, individuell)
|
* Freiwillige Benotung (mündliche Noten, individuell)
|
||||||
- Abgabetermin des Projekts: Montag, der 27. Juli, 9:25 Uhr
|
* Abgabetermin d. Projekts: Montag, der 27. Juli, 9:25 Uhr
|
||||||
- Game-Engine: engine-pi
|
* Game-Engine: engine-pi
|
||||||
- [Anforderungen des Lehrplans](https://www.lehrplanplus.bayern.de/fachlehrplan/gymnasium/12/informatik/grundlegend)
|
* [Anforderungen des Lehrplans](https://www.lehrplanplus.bayern.de/fachlehrplan/gymnasium/12/informatik/grundlegend)
|
||||||
- einfache graphische Benutzeroberflächen
|
* einfache graphische Benutzeroberflächen
|
||||||
- überprüfen die Funktionalität eines vorgegebenen Softwareprodukts mit unterschiedlichen Testverfahren
|
* überprüfen die Funktionalität eines vorgegebenen Softwareprodukts mit unterschiedlichen Testverfahren
|
||||||
- verwenden dabei die zugehörige Dokumentation
|
* verwenden dabei die zugehörige Dokumentation
|
||||||
- verwenden Versionsverwaltung
|
* verwenden Versionsverwaltung
|
||||||
- UML-Diagramme
|
* UML-Diagramme
|
||||||
- KI-Verwendung erlaubt
|
* KI-Verwendung erlaubt
|
||||||
- Lizenz: frei; _wir: GPLv3_
|
* Lizenz: frei; GPLv3
|
||||||
- Anwesenheit zu den Unterrichtszeiten
|
* Anwesenheit zu den Unterrichtszeiten
|
||||||
|
|
||||||
## Einführung Game
|
## Einführung Game
|
||||||
|
|
||||||
### Ziel des Projekts
|
### Ziel des Projekts
|
||||||
|
|
||||||
- Kleiner Dönerladen-Simulator
|
* Kleiner Dönerladen-Simulator
|
||||||
- Kunde erscheint an der Bude
|
* Kunde erscheint an der Bude
|
||||||
- Spieler verkauft Döner per Button
|
* Spieler verkauft Döner per Button
|
||||||
- Spieler erhält Geld
|
* Spieler erhält Geld
|
||||||
- Geld kann für Upgrades ausgegeben werden
|
* Geld kann für Upgrades ausgegeben werden
|
||||||
- Upgrade erhöht die Anzahl der Kunden
|
* Upgrade erhöht die Anzahl der Kunden
|
||||||
|
* Fokus auf eine funktionierende Grundversion in 200 Minuten
|
||||||
|
|
||||||
### Geplanter Spielablauf
|
### Geplanter Spielablauf
|
||||||
|
|
||||||
- Kunde erscheint
|
* Kunde erscheint
|
||||||
- Spieler klickt auf „Döner verkaufen“
|
* Spieler klickt auf „Döner verkaufen“
|
||||||
- Geld erhöht sich
|
* Geld erhöht sich
|
||||||
- Kunde verschwindet
|
* Kunde verschwindet
|
||||||
- Neuer Kunde erscheint
|
* Neuer Kunde erscheint
|
||||||
- Spieler kann Upgrades kaufen
|
* Spieler kann Upgrades kaufen
|
||||||
- Mehr Upgrades = mehr Kunden
|
* Mehr Upgrades = mehr Kunden
|
||||||
|
|
||||||
### Weitere Ideen
|
### Person 1 – Fortgeschrittener
|
||||||
|
|
||||||
|
* Projektstruktur erstellen
|
||||||
|
* GameController erstellen
|
||||||
|
* Geldsystem programmieren
|
||||||
|
* Upgrade-System programmieren
|
||||||
|
* Systeme zusammenführen
|
||||||
|
* Fehler beheben
|
||||||
|
* Endintegration übernehmen
|
||||||
|
|
||||||
|
### Person 2 – Anfänger
|
||||||
|
|
||||||
|
* Kunden-Sprite oder Platzhalter erstellen
|
||||||
|
* Kunde spawnt im Spiel
|
||||||
|
* Kunde bewegt sich zur Theke
|
||||||
|
* Kunde wartet auf Bedienung
|
||||||
|
* Kunde verschwindet nach Verkauf
|
||||||
|
* Neuer Kunde erscheint
|
||||||
|
|
||||||
|
### Person 3 – Anfänger
|
||||||
|
|
||||||
|
* Benutzeroberfläche erstellen
|
||||||
|
* Geldanzeige einbauen
|
||||||
|
* Kundenzahl anzeigen
|
||||||
|
* Button „Döner verkaufen“ erstellen
|
||||||
|
* Button „Sitzplatz kaufen“ erstellen
|
||||||
|
* Anzeigen mit den Spielwerten verbinden
|
||||||
|
|
||||||
|
### Benötigte Klassen
|
||||||
|
|
||||||
|
* GameController
|
||||||
|
* Customer
|
||||||
|
* MoneyManager
|
||||||
|
* UpgradeManager
|
||||||
|
* UI
|
||||||
|
|
||||||
|
### Spielwerte (Beispiel)
|
||||||
|
|
||||||
|
* Startgeld: 50 €
|
||||||
|
* Dönerverkauf: +5 €
|
||||||
|
* Sitzplatz-Upgrade: -20 €
|
||||||
|
* Kundenplätze starten bei 1
|
||||||
|
* Upgrade erhöht Kundenplätze um 1
|
||||||
|
|
||||||
|
### Zeitplan
|
||||||
|
|
||||||
|
* 20 Minuten Planung
|
||||||
|
* 120 Minuten parallele Entwicklung
|
||||||
|
* 40 Minuten Systeme zusammenführen
|
||||||
|
* 20 Minuten Testen und Fehler beheben
|
||||||
|
|
||||||
|
### Was am Ende funktionieren muss
|
||||||
|
|
||||||
|
* Kunde erscheint
|
||||||
|
* Döner kann verkauft werden
|
||||||
|
* Geld erhöht sich
|
||||||
|
* Upgrade kann gekauft werden
|
||||||
|
* Kundenanzahl steigt durch Upgrade
|
||||||
|
* Keine Abstürze oder kritischen Fehler
|
||||||
|
|
||||||
|
### Was wir bewusst weglassen
|
||||||
|
|
||||||
|
* Sterne-Bewertungssystem
|
||||||
|
* Zutaten-Minispiele
|
||||||
|
* Mitarbeiter
|
||||||
|
* Mehrere Filialen
|
||||||
|
* Komplexe Bestellungen
|
||||||
|
* Animationen
|
||||||
|
* Speichersystem
|
||||||
|
|
||||||
|
### Präsentation
|
||||||
|
|
||||||
|
* Idee des Dönerladen-Simulators vorstellen
|
||||||
|
* Kundensystem zeigen
|
||||||
|
* Geldsystem zeigen
|
||||||
|
* Upgrade-System zeigen
|
||||||
|
* Kurz erklären, welche Erweiterungen später möglich wären (Bewertungen, Minispiele, größere Läden)
|
||||||
|
|
||||||
- Minigames (Jump n' Run)
|
|
||||||
- Startmenu mit versch. Schwierigkeitsgraden, die gespeichert werden
|
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
- [Font: Bitcount Grid Double](https://fonts.google.com/share?selection.family=Bitcount+Grid+Double:wght@100..900)
|
- [Font: Bitcount Grid Double](https://fonts.google.com/share?selection.family=Bitcount+Grid+Double:wght@100..900)
|
||||||
- [PixUI icon pack](https://opengameart.org/content/pixui-asset-pack-1-ctatz)
|
|
||||||
- Natürlich: [engine-pi](https://github.com/engine-pi/)
|
- Natürlich: [engine-pi](https://github.com/engine-pi/)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.pirckheimer-gymnasium</groupId>
|
<groupId>de.pirckheimer-gymnasium</groupId>
|
||||||
<artifactId>engine-pi</artifactId>
|
<artifactId>engine-pi</artifactId>
|
||||||
<version>0.52.0</version>
|
<version>0.49.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|||||||
@@ -1,40 +1,13 @@
|
|||||||
package project;
|
package project;
|
||||||
|
|
||||||
import project.scenes.GameScene;
|
|
||||||
import project.utils.Statistics;
|
|
||||||
import pi.Controller;
|
import pi.Controller;
|
||||||
import pi.config.ConfigLoader;
|
import project.scenes.LoadingScene;
|
||||||
|
|
||||||
import java.awt.Cursor;
|
|
||||||
import java.awt.Point;
|
|
||||||
import java.awt.Toolkit;
|
|
||||||
|
|
||||||
public class Main
|
public class Main
|
||||||
{
|
{
|
||||||
public static ConfigLoader CONFIG;
|
|
||||||
public static int WINDOW_WIDTH = 1000;
|
|
||||||
public static int WINDOW_HEIGHT = 600;
|
|
||||||
|
|
||||||
static {
|
|
||||||
CONFIG = new ConfigLoader("kebab.properties", new Statistics());
|
|
||||||
CONFIG.load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
{
|
{
|
||||||
Controller.instantMode(false);
|
Controller.instantMode(false);
|
||||||
Controller.title("Royal Kebab");
|
Controller.start(new LoadingScene(), 1000, 600);
|
||||||
Controller.start(new GameScene(), WINDOW_WIDTH, WINDOW_HEIGHT);
|
|
||||||
|
|
||||||
try {
|
|
||||||
Cursor customCursor = Toolkit.getDefaultToolkit().createCustomCursor(
|
|
||||||
Controller.images.get("images/pixui-pack/Misc/Cursor.png").getScaledInstance(25, 25, 0),
|
|
||||||
new Point(0, 0), // Hotspot (Klickpunkt)
|
|
||||||
"PixUI cursor"
|
|
||||||
);
|
|
||||||
Controller.frame().setCursor(customCursor);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,273 +0,0 @@
|
|||||||
package project.scenes;
|
|
||||||
|
|
||||||
import pi.Controller;
|
|
||||||
import pi.Rectangle;
|
|
||||||
import pi.Scene;
|
|
||||||
import pi.Text;
|
|
||||||
import pi.actor.Actor;
|
|
||||||
import pi.actor.Animation;
|
|
||||||
import pi.actor.Image;
|
|
||||||
import pi.config.ConfigLoader;
|
|
||||||
import pi.event.FrameListener;
|
|
||||||
import pi.event.MouseButton;
|
|
||||||
import pi.event.MouseClickListener;
|
|
||||||
import pi.graphics.geom.Vector;
|
|
||||||
import project.Main;
|
|
||||||
import project.utils.Statistics;
|
|
||||||
|
|
||||||
import static pi.Controller.fonts;
|
|
||||||
import java.awt.Font;
|
|
||||||
|
|
||||||
|
|
||||||
public class GameScene extends Scene implements FrameListener, MouseClickListener
|
|
||||||
{
|
|
||||||
Rectangle bg;
|
|
||||||
Image tatli;
|
|
||||||
Text[] texts;
|
|
||||||
Image[] ingredients; // array of all ingredients (including the final kebab lol)
|
|
||||||
Image ingredientsOutline;
|
|
||||||
static int INGREDIENTS_X = 10;
|
|
||||||
static int INGREDIENTS_X_TRESHOLD = 7;
|
|
||||||
static int INGREDIENTS_Y = -22;
|
|
||||||
|
|
||||||
int[] current_kebab; // used for remembering which ingredients have already been added to the current kebab build
|
|
||||||
Actor[] customers;
|
|
||||||
boolean[] fed_customers;
|
|
||||||
public static ConfigLoader loader;
|
|
||||||
boolean mouse_pressed_on_kebab;
|
|
||||||
Statistics s;
|
|
||||||
|
|
||||||
public GameScene() {
|
|
||||||
// the background music, color, stats (some meta information)
|
|
||||||
Controller.jukebox.playSound("sounds/Mozart_Turkish_March_-_Orchestral_Melodic_Techno_-_TVV_music_320k.mp3");
|
|
||||||
|
|
||||||
// background and stuff
|
|
||||||
bg = new Rectangle(2000, 2000);
|
|
||||||
bg.color("#ffffff");
|
|
||||||
bg.center(0, 0);
|
|
||||||
bg.layerPosition(-100);
|
|
||||||
addStatsCollectionOutline(this);
|
|
||||||
texts = createTexts(this);
|
|
||||||
camera().meter(10);
|
|
||||||
s = Main.CONFIG.getGroup(Statistics.class);
|
|
||||||
|
|
||||||
tatli = new Image("images/kebab-pack/tatli-ekmek-256x256.png");
|
|
||||||
tatli.size(2.56*13, 2.56*13);
|
|
||||||
tatli.center(-33.4, -23);
|
|
||||||
|
|
||||||
// create customers
|
|
||||||
customers = new Actor[2];
|
|
||||||
customers[0] = Animation.createFromAnimatedGif("images/kebab-pack/customer-sonic-on-white.gif", 1.48*25, 1.25*25);
|
|
||||||
customers[0].center(-60,0);
|
|
||||||
customers[0].applyImpulse(new Vector(1, 0).multiply(200000));
|
|
||||||
customers[1] = Animation.createFromAnimatedGif("images/kebab-pack/customer-mr-eggman.gif", 1.48*20, 1.48*20);
|
|
||||||
customers[1].center(-180,0);
|
|
||||||
customers[1].applyImpulse(new Vector(1, 0).multiply(100000));
|
|
||||||
fed_customers = new boolean[customers.length];
|
|
||||||
|
|
||||||
// initialize ingredients and current_kebab arrays
|
|
||||||
ingredients = createIngredients();
|
|
||||||
ingredientsOutline = createIngredientsOutline(ingredients);
|
|
||||||
current_kebab = new int[ingredients.length-1];
|
|
||||||
|
|
||||||
mouse_pressed_on_kebab = false;
|
|
||||||
|
|
||||||
// add all actors with correct sorting
|
|
||||||
add(bg);
|
|
||||||
add(customers);
|
|
||||||
add(tatli);
|
|
||||||
add(ingredientsOutline);
|
|
||||||
add(ingredients);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void sellKebabStatistics(int amount) {
|
|
||||||
s.kebabSold(s.kebabSold()+amount);
|
|
||||||
s.money(s.money() + s.kebabPrice());
|
|
||||||
Main.CONFIG.save();
|
|
||||||
setKebabSold(texts, s.kebabSold());
|
|
||||||
setMoney(texts, s.money());
|
|
||||||
|
|
||||||
if(s.money() >= 67) {
|
|
||||||
resetStats();
|
|
||||||
Controller.transitionToScene(new VictoryScene());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void incrementLostCustomers(int amount) {
|
|
||||||
s.lostCustomers(s.lostCustomers() + amount);
|
|
||||||
Main.CONFIG.save();
|
|
||||||
setLostCustomers(texts, s.lostCustomers());
|
|
||||||
}
|
|
||||||
public void resetStats() {
|
|
||||||
s.totalEarned(s.totalEarned() + s.money()-Statistics.STARTER_MONEY);
|
|
||||||
s.money(Statistics.STARTER_MONEY);
|
|
||||||
s.kebabPrice(5);
|
|
||||||
s.kebabSold(0);
|
|
||||||
s.lostCustomers(0);
|
|
||||||
Main.CONFIG.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFrame(double pastTime)
|
|
||||||
{
|
|
||||||
for(int i=0; i<customers.length; i++) {
|
|
||||||
if(visibleArea().xRight() < customers[i].anchor().add(new Vector(-20, 0)).x()) {
|
|
||||||
customers[i].center(-60,0);
|
|
||||||
if(fed_customers[i]) {
|
|
||||||
fed_customers[i] = false;
|
|
||||||
} else {
|
|
||||||
incrementLostCustomers(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mouse_pressed_on_kebab) {
|
|
||||||
ingredients[ingredients.length-1].center(Controller.mousePosition());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onMouseDown(Vector position, MouseButton button)
|
|
||||||
{
|
|
||||||
if(ingredients[ingredients.length-1].contains(Controller.mousePosition()) && ingredients[ingredients.length-1].isVisible()) {
|
|
||||||
mouse_pressed_on_kebab = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(int i=0; i<4; i++) {
|
|
||||||
if (ingredients[i].contains(position)) {
|
|
||||||
current_kebab[i] += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean everything_added = true;
|
|
||||||
for(int i : current_kebab){
|
|
||||||
if(i == 0) {
|
|
||||||
everything_added = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(everything_added) {
|
|
||||||
for(int i=0; i<current_kebab.length; i++) {
|
|
||||||
current_kebab[i] = 0;
|
|
||||||
}
|
|
||||||
ingredients[ingredients.length-1].visible(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onMouseUp(Vector position, MouseButton button) {
|
|
||||||
for (int i=0; i<customers.length; i++) {
|
|
||||||
// only sell kebab when (1) a kebab is (2) dragged on a customer that has (3) not already been fed
|
|
||||||
if(mouse_pressed_on_kebab && customers[i].contains(position) && !fed_customers[i]) {
|
|
||||||
sellKebabStatistics(1);
|
|
||||||
ingredients[ingredients.length-1].visible(false);
|
|
||||||
ingredients[ingredients.length-1].center(INGREDIENTS_X + INGREDIENTS_X_TRESHOLD*(ingredients.length-1) +2, INGREDIENTS_Y);
|
|
||||||
fed_customers[i] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// must be at bottom for previous checks to work
|
|
||||||
mouse_pressed_on_kebab = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Static helper methods
|
|
||||||
public static Image createIngredientsOutline(Image[] ingredients) {
|
|
||||||
double ingredients_width = (ingredients[ingredients.length-1].anchor().x()+ingredients[ingredients.length-1].width()) - ingredients[0].anchor().x();
|
|
||||||
int padding_width = 3;
|
|
||||||
int padding_height = 2;
|
|
||||||
|
|
||||||
Image io = new Image("images/pixui-pack/Buttons/Button_White_Outline (5).png").width(ingredients_width + padding_width*2).height(6 + padding_height*2);
|
|
||||||
io.center(INGREDIENTS_X - ingredients[0].width()/2 + (ingredients_width)/2, INGREDIENTS_Y);
|
|
||||||
|
|
||||||
return io;
|
|
||||||
}
|
|
||||||
public static Image[] createIngredients() {
|
|
||||||
Image[] ingredients = new Image[5];
|
|
||||||
|
|
||||||
ingredients[0] = new Image("images/kebab-pack/bread-256x256.png");
|
|
||||||
ingredients[1] = new Image("images/kebab-pack/lettuce-96x96.png");
|
|
||||||
ingredients[2] = new Image("images/kebab-pack/onion-256x256.png");
|
|
||||||
ingredients[3] = new Image("images/kebab-pack/meat-256x256.png");
|
|
||||||
ingredients[4] = new Image("images/kebab-pack/kebab-128x128.png");
|
|
||||||
ingredients[4].visible(false);
|
|
||||||
|
|
||||||
for (int i=0; i<ingredients.length-1; i++) {
|
|
||||||
ingredients[i].size(5, 5).center(INGREDIENTS_X + INGREDIENTS_X_TRESHOLD*i, INGREDIENTS_Y);
|
|
||||||
}
|
|
||||||
|
|
||||||
ingredients[ingredients.length-1].size(7, 7).center(INGREDIENTS_X + INGREDIENTS_X_TRESHOLD*(ingredients.length-1) +2, INGREDIENTS_Y);
|
|
||||||
|
|
||||||
return ingredients;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void addStatsCollectionOutline(Scene scene) {
|
|
||||||
Image moneyButton = new Image("images/pixui-pack/Buttons/Button_White_Outline (9).png");
|
|
||||||
moneyButton.center(-10, 25);
|
|
||||||
Image kebabSoldButton = new Image("images/pixui-pack/Buttons/Button_White_Outline (9).png");
|
|
||||||
kebabSoldButton.center(0, 25);
|
|
||||||
Image lostCustomersButton = new Image("images/pixui-pack/Buttons/Button_White_Outline (9).png");
|
|
||||||
lostCustomersButton.center(10, 25);
|
|
||||||
|
|
||||||
Image moneyIcon = new Image("images/kebab-pack/money-128x128.png").size(2, 2);
|
|
||||||
moneyIcon.center(-12, 25);
|
|
||||||
Image kebabSoldIcon = new Image("images/kebab-pack/kebab-128x128.png").size(2, 2);
|
|
||||||
kebabSoldIcon.center(-2, 25);
|
|
||||||
Image lostCustomersIcon = new Image("images/kebab-pack/customer.png").size(2, 2);
|
|
||||||
lostCustomersIcon.center(8, 25);
|
|
||||||
|
|
||||||
scene.add(moneyButton);
|
|
||||||
scene.add(moneyIcon);
|
|
||||||
scene.add(kebabSoldButton);
|
|
||||||
scene.add(kebabSoldIcon);
|
|
||||||
scene.add(lostCustomersButton);
|
|
||||||
scene.add(lostCustomersIcon);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Text[] createTexts(Scene scene) {
|
|
||||||
Text[] texts = new Text[10];
|
|
||||||
Font font = fonts.get("fonts/BitcountGridDouble-Regular.ttf");
|
|
||||||
|
|
||||||
Statistics s = Main.CONFIG.getGroup(Statistics.class);
|
|
||||||
|
|
||||||
Text money = new Text(s.money());
|
|
||||||
money.color("#000000");
|
|
||||||
money.font(font);
|
|
||||||
money.height(2.5);
|
|
||||||
money.center(-9, 25);
|
|
||||||
texts[0] = money;
|
|
||||||
Text kebabSold = new Text(s.kebabSold());
|
|
||||||
kebabSold.color("#000000");
|
|
||||||
kebabSold.font(font);
|
|
||||||
kebabSold.height(2.5);
|
|
||||||
kebabSold.center(1, 25);
|
|
||||||
texts[1] = kebabSold;
|
|
||||||
Text lostCustomers = new Text(s.lostCustomers());
|
|
||||||
lostCustomers.color("#000000");
|
|
||||||
lostCustomers.font(font);
|
|
||||||
lostCustomers.height(2.5);
|
|
||||||
lostCustomers.center(11, 25);
|
|
||||||
texts[2] = lostCustomers;
|
|
||||||
|
|
||||||
scene.add(money);
|
|
||||||
scene.add(kebabSold);
|
|
||||||
scene.add(lostCustomers);
|
|
||||||
|
|
||||||
return texts;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setTexts(Text[] texts, int money, int kebabSold, int lostCustomers) {
|
|
||||||
texts[0].content(String.valueOf(money));
|
|
||||||
texts[1].content(String.valueOf(kebabSold));
|
|
||||||
texts[2].content(String.valueOf(lostCustomers));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setMoney(Text[] texts, int money) {
|
|
||||||
texts[0].content(String.valueOf(money));
|
|
||||||
}
|
|
||||||
public static void setKebabSold(Text[] texts, int kebabSold) {
|
|
||||||
texts[1].content(String.valueOf(kebabSold));
|
|
||||||
}
|
|
||||||
public static void setLostCustomers(Text[] texts, int lostCustomers) {
|
|
||||||
texts[2].content(String.valueOf(lostCustomers));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package project.scenes;
|
package project.scenes;
|
||||||
|
|
||||||
import pi.Controller;
|
import pi.Camera;
|
||||||
import pi.Scene;
|
import pi.Scene;
|
||||||
import pi.Text;
|
import pi.Text;
|
||||||
import pi.actor.Image;
|
import pi.actor.Image;
|
||||||
@@ -8,7 +8,6 @@ import pi.actor.Image;
|
|||||||
import static pi.Controller.fonts;
|
import static pi.Controller.fonts;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
|
|
||||||
|
|
||||||
public class LoadingScene extends Scene
|
public class LoadingScene extends Scene
|
||||||
{
|
{
|
||||||
private Text title;
|
private Text title;
|
||||||
@@ -21,28 +20,21 @@ public class LoadingScene extends Scene
|
|||||||
subtitle_content = "Loading";
|
subtitle_content = "Loading";
|
||||||
subtitle = new Text(subtitle_content);
|
subtitle = new Text(subtitle_content);
|
||||||
tatli = new Image("images/kebab-pack/tatli-ekmek-256x256.png");
|
tatli = new Image("images/kebab-pack/tatli-ekmek-256x256.png");
|
||||||
|
|
||||||
|
|
||||||
Font font = fonts.get("fonts/BitcountGridDouble-Regular.ttf");
|
Font font = fonts.get("Fonts/BitcountGridDouble-Regular.ttf");
|
||||||
|
title.center(0, 3);
|
||||||
title.font(font);
|
title.font(font);
|
||||||
|
|
||||||
|
subtitle.center(0, -3);
|
||||||
subtitle.font(font);
|
subtitle.font(font);
|
||||||
|
|
||||||
title.center(0, 3);
|
tatli.center(0,0);
|
||||||
subtitle.center(0, -3);
|
|
||||||
tatli.center(0, 0);
|
|
||||||
|
|
||||||
add(title);
|
add(title);
|
||||||
add(subtitle);
|
add(subtitle);
|
||||||
add(tatli);
|
add(tatli);
|
||||||
|
|
||||||
repeat(0.5, 4, (int i)->{
|
repeat(0.3, (counter) -> subtitle.content(subtitle_content + ".".repeat(counter)));
|
||||||
remove(subtitle);
|
|
||||||
subtitle_content = subtitle_content + ".";
|
|
||||||
subtitle = new Text(subtitle_content);
|
|
||||||
subtitle.font(font);
|
|
||||||
subtitle.center(0, -3);
|
|
||||||
add(subtitle);
|
|
||||||
}, (int i)->{
|
|
||||||
Controller.transitionToScene(new GameScene());
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package project.scenes;
|
||||||
|
|
||||||
|
import pi.Scene;
|
||||||
|
|
||||||
|
public class StartScene extends Scene
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
package project.scenes;
|
|
||||||
|
|
||||||
import pi.Controller;
|
|
||||||
import pi.Scene;
|
|
||||||
import pi.actor.Actor;
|
|
||||||
import pi.actor.Animation;
|
|
||||||
import pi.actor.Rectangle;
|
|
||||||
import pi.actor.Text;
|
|
||||||
import pi.event.FrameListener;
|
|
||||||
import pi.event.MouseButton;
|
|
||||||
import pi.event.MouseClickListener;
|
|
||||||
import pi.graphics.geom.Vector;
|
|
||||||
import pi.resources.sound.SoundPlayback;
|
|
||||||
import project.Main;
|
|
||||||
|
|
||||||
import static pi.Controller.fonts;
|
|
||||||
|
|
||||||
import java.awt.Font;
|
|
||||||
|
|
||||||
|
|
||||||
public class VictoryScene extends Scene implements FrameListener, MouseClickListener {
|
|
||||||
Font font;
|
|
||||||
boolean faded_out;
|
|
||||||
Text designer;
|
|
||||||
Text pr;
|
|
||||||
Text programmer;
|
|
||||||
Rectangle rect;
|
|
||||||
Actor sixseven;
|
|
||||||
|
|
||||||
boolean clicked;
|
|
||||||
boolean game_over_playing;
|
|
||||||
|
|
||||||
public VictoryScene() {
|
|
||||||
Controller.jukebox.playSound("sounds/reward.mp3");
|
|
||||||
|
|
||||||
clicked = false;
|
|
||||||
game_over_playing = false;
|
|
||||||
|
|
||||||
font = fonts.get("fonts/BitcountGridDouble-Regular.ttf");
|
|
||||||
|
|
||||||
designer = new Text("Design: Alf");
|
|
||||||
designer.color("#ffffff");
|
|
||||||
designer.font(font);
|
|
||||||
designer.height(2.5);
|
|
||||||
pr = new Text("PR: Kevon Faison");
|
|
||||||
pr.color("#ffffff");
|
|
||||||
pr.font(font);
|
|
||||||
pr.height(2.5);
|
|
||||||
programmer = new Text("Programming: Benjamin Burkhardt");
|
|
||||||
programmer.color("#ffffff");
|
|
||||||
programmer.font(font);
|
|
||||||
programmer.height(1.5);
|
|
||||||
rect = new Rectangle(Main.WINDOW_WIDTH/camera().meter(), Main.WINDOW_HEIGHT/camera().meter()+5);
|
|
||||||
rect.color("#4d0000");
|
|
||||||
|
|
||||||
designer.center(0, 4);
|
|
||||||
pr.center(0, 0);
|
|
||||||
programmer.center(0, -4);
|
|
||||||
rect.center(0, 0);
|
|
||||||
|
|
||||||
add(designer);
|
|
||||||
add(pr);
|
|
||||||
add(programmer);
|
|
||||||
add(rect);
|
|
||||||
|
|
||||||
sixseven = Animation.createFromAnimatedGif("images/kebab-pack/reward.gif", 1.48*15, 1.25*15);
|
|
||||||
sixseven.center(0, 0);
|
|
||||||
|
|
||||||
rect.applyImpulse(new Vector(0, -1).multiply(67000));
|
|
||||||
|
|
||||||
sixseven.angularVelocity(-0.1);
|
|
||||||
|
|
||||||
add(sixseven);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFrame(double pastTime)
|
|
||||||
{
|
|
||||||
sixseven.center(rect.center());
|
|
||||||
|
|
||||||
if(clicked) {
|
|
||||||
for(SoundPlayback sp : Controller.jukebox.allSounds()) {
|
|
||||||
if(sp.toString().contains("Mozart") || sp.toString().contains("reward")) {
|
|
||||||
sp.volume(sp.volume()*0.97);
|
|
||||||
if(sp.volume() < 0.01) {
|
|
||||||
if(!game_over_playing) {
|
|
||||||
Controller.jukebox.playSound("sounds/Game-Over.mp3");
|
|
||||||
game_over_playing = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
camera().zoomOut(0.01);
|
|
||||||
|
|
||||||
if (camera().meter() < 0.5) {
|
|
||||||
System.exit(0);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onMouseDown(Vector position, MouseButton button)
|
|
||||||
{
|
|
||||||
sixseven.visible(false);
|
|
||||||
rect.visible(false);
|
|
||||||
|
|
||||||
clicked = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
package project.utils;
|
|
||||||
|
|
||||||
import pi.config.ConfigGroup;
|
|
||||||
|
|
||||||
public class Statistics extends ConfigGroup {
|
|
||||||
public static int STARTER_MONEY = 2;
|
|
||||||
|
|
||||||
private int money = 0;
|
|
||||||
private int kebabPrice = 5;
|
|
||||||
private int upgradeLevel = 0;
|
|
||||||
private int kebabSold = 0;
|
|
||||||
private int lostCustomers = 0;
|
|
||||||
private int totalEarned = 0;
|
|
||||||
|
|
||||||
public Statistics() {
|
|
||||||
money(STARTER_MONEY);
|
|
||||||
kebabPrice(5);
|
|
||||||
upgradeLevel(0);
|
|
||||||
kebabSold(0);
|
|
||||||
lostCustomers(0);
|
|
||||||
totalEarned(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- money ---
|
|
||||||
public int money(){
|
|
||||||
return money;
|
|
||||||
}
|
|
||||||
public Statistics money(int money) {
|
|
||||||
set("money", money);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- kebabPrice ---
|
|
||||||
public int kebabPrice() {
|
|
||||||
return kebabPrice;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Statistics kebabPrice(int kebabPrice) {
|
|
||||||
set("kebabPrice", kebabPrice);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- upgradeLevel ---
|
|
||||||
public int upgradeLevel() {
|
|
||||||
return upgradeLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Statistics upgradeLevel(int upgradeLevel) {
|
|
||||||
set("upgradeLevel", upgradeLevel);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- kebabSold ---
|
|
||||||
public int kebabSold() {
|
|
||||||
return kebabSold;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Statistics kebabSold(int kebabSold) {
|
|
||||||
set("kebabSold", kebabSold);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- lostCustomers ---
|
|
||||||
public int lostCustomers() {
|
|
||||||
return lostCustomers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Statistics lostCustomers(int lostCustomers) {
|
|
||||||
set("lostCustomers", lostCustomers);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- totalEarned ---
|
|
||||||
public int totalEarned() {
|
|
||||||
return totalEarned;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Statistics totalEarned(int totalEarned) {
|
|
||||||
set("totalEarned", totalEarned);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 325 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 401 B |
|
Before Width: | Height: | Size: 373 B |
|
Before Width: | Height: | Size: 389 B |
|
Before Width: | Height: | Size: 407 B |
|
Before Width: | Height: | Size: 667 B |
|
Before Width: | Height: | Size: 634 B |
|
Before Width: | Height: | Size: 645 B |
|
Before Width: | Height: | Size: 651 B |
|
Before Width: | Height: | Size: 668 B |
|
Before Width: | Height: | Size: 356 B |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 375 B |
|
Before Width: | Height: | Size: 376 B |
|
Before Width: | Height: | Size: 358 B |
|
Before Width: | Height: | Size: 371 B |
|
Before Width: | Height: | Size: 384 B |
|
Before Width: | Height: | Size: 289 B |
|
Before Width: | Height: | Size: 279 B |
|
Before Width: | Height: | Size: 343 B |
|
Before Width: | Height: | Size: 250 B |
|
Before Width: | Height: | Size: 450 B |
|
Before Width: | Height: | Size: 290 B |
|
Before Width: | Height: | Size: 235 B |
|
Before Width: | Height: | Size: 255 B |
|
Before Width: | Height: | Size: 372 B |
|
Before Width: | Height: | Size: 239 B |
|
Before Width: | Height: | Size: 403 B |
|
Before Width: | Height: | Size: 418 B |
|
Before Width: | Height: | Size: 240 B |
|
Before Width: | Height: | Size: 363 B |
|
Before Width: | Height: | Size: 251 B |
|
Before Width: | Height: | Size: 225 B |
|
Before Width: | Height: | Size: 286 B |
|
Before Width: | Height: | Size: 333 B |
|
Before Width: | Height: | Size: 233 B |
|
Before Width: | Height: | Size: 396 B |
|
Before Width: | Height: | Size: 656 B |
|
Before Width: | Height: | Size: 978 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 775 B |
|
Before Width: | Height: | Size: 873 B |
|
Before Width: | Height: | Size: 720 B |
|
Before Width: | Height: | Size: 771 B |
|
Before Width: | Height: | Size: 682 B |
|
Before Width: | Height: | Size: 851 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1016 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1012 B |
|
Before Width: | Height: | Size: 974 B |
|
Before Width: | Height: | Size: 908 B |
|
Before Width: | Height: | Size: 662 B |
|
Before Width: | Height: | Size: 996 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 783 B |
|
Before Width: | Height: | Size: 894 B |
|
Before Width: | Height: | Size: 716 B |
|
Before Width: | Height: | Size: 790 B |
|
Before Width: | Height: | Size: 676 B |
|
Before Width: | Height: | Size: 956 B |
|
Before Width: | Height: | Size: 968 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 484 B |
|
Before Width: | Height: | Size: 565 B |
|
Before Width: | Height: | Size: 622 B |
|
Before Width: | Height: | Size: 417 B |
|
Before Width: | Height: | Size: 235 B |
|
Before Width: | Height: | Size: 500 B |
|
Before Width: | Height: | Size: 517 B |
|
Before Width: | Height: | Size: 501 B |