Merge branch 'main' of https://inf.pirckheimer-gymnasium.de/kebab/kebab
@@ -148,6 +148,7 @@ Kleine Indie-Company. Sehr bescheiden. Wir machen. Döner. Revolutionär.
|
|||||||
## 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/)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +1,25 @@
|
|||||||
package project.scenes;
|
package project.scenes;
|
||||||
|
|
||||||
import pi.Camera;
|
import pi.Controller;
|
||||||
import pi.Scene;
|
import pi.Scene;
|
||||||
import pi.Text;
|
import pi.Text;
|
||||||
import pi.actor.Image;
|
import pi.actor.Image;
|
||||||
import pi.event.FrameListener;
|
|
||||||
|
|
||||||
import static pi.Controller.fonts;
|
import static pi.Controller.fonts;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
|
|
||||||
public class LoadingScene extends Scene implements FrameListener
|
public class LoadingScene extends Scene
|
||||||
{
|
{
|
||||||
private Text title;
|
private Text title;
|
||||||
private Text subtitle;
|
private Text subtitle;
|
||||||
private String subtitle_content;
|
private String subtitle_content;
|
||||||
private Image tatli;
|
private Image tatli;
|
||||||
private double lastUpdated;
|
|
||||||
|
|
||||||
public LoadingScene() {
|
public LoadingScene() {
|
||||||
title = new Text("Royal Kebab");
|
title = new Text("Royal Kebab");
|
||||||
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");
|
||||||
lastUpdated = System.currentTimeMillis();
|
|
||||||
|
|
||||||
Font font = fonts.get("Fonts/BitcountGridDouble-Regular.ttf");
|
Font font = fonts.get("Fonts/BitcountGridDouble-Regular.ttf");
|
||||||
title.center(0, 3);
|
title.center(0, 3);
|
||||||
@@ -36,13 +33,16 @@ public class LoadingScene extends Scene implements FrameListener
|
|||||||
add(title);
|
add(title);
|
||||||
add(subtitle);
|
add(subtitle);
|
||||||
add(tatli);
|
add(tatli);
|
||||||
}
|
|
||||||
|
|
||||||
public void onFrame(double pastTime)
|
repeat(0.5, 4, (int i)->{
|
||||||
{
|
remove(subtitle);
|
||||||
if(System.currentTimeMillis() - lastUpdated > 300) {
|
|
||||||
subtitle_content = subtitle_content + ".";
|
subtitle_content = subtitle_content + ".";
|
||||||
subtitle.content(subtitle_content);
|
subtitle = new Text(subtitle_content);
|
||||||
}
|
subtitle.center(0, -3);
|
||||||
|
subtitle.font(font);
|
||||||
|
add(subtitle);
|
||||||
|
}, (int i)->{
|
||||||
|
Controller.transitionToScene(new StartScene());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
public class Ordersystem {
|
|
||||||
private int money = 0;
|
|
||||||
private int kebabPrice = 5;
|
|
||||||
private int upgradeLevel = 0;
|
|
||||||
private int kebabSold = 0;
|
|
||||||
|
|
||||||
public void sellKebab() {
|
|
||||||
Money += kebabPrice;
|
|
||||||
kebabSold++;
|
|
||||||
}
|
|
||||||
public int getMoney(){
|
|
||||||
return money;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getKebabSold(){
|
|
||||||
return kebabSold;
|
|
||||||
}
|
|
||||||
public void setKebabPrice(int price){
|
|
||||||
kebabPrice = price;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package project.utils;
|
||||||
|
|
||||||
|
public class Ordersystem {
|
||||||
|
private int money = 0;
|
||||||
|
private int kebabPrice = 5;
|
||||||
|
private int upgradeLevel = 0;
|
||||||
|
private int kebabSold = 0;
|
||||||
|
private int workers = 0;
|
||||||
|
private int waitingCustomers = 0;
|
||||||
|
private int totalEarned = 0;
|
||||||
|
|
||||||
|
|
||||||
|
public int getMoney(){
|
||||||
|
return money;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getKebabSold(){
|
||||||
|
return kebabSold;
|
||||||
|
}
|
||||||
|
public void setKebabPrice(int price){
|
||||||
|
kebabPrice = price;
|
||||||
|
}
|
||||||
|
public boolean buyUpgrade() {
|
||||||
|
int cost = (upgradeLevel + 1) * 50;
|
||||||
|
|
||||||
|
if(money >= cost) {
|
||||||
|
money -= cost;
|
||||||
|
upgradeLevel++;
|
||||||
|
kebabPrice += 2;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeLevel() {
|
||||||
|
return upgradeLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean buyWorker() {
|
||||||
|
|
||||||
|
int cost = getWorkerCost();
|
||||||
|
|
||||||
|
if(money >= cost) {
|
||||||
|
money -= cost;
|
||||||
|
workers++;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWorkers() {
|
||||||
|
return workers;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void addCustomer() {
|
||||||
|
waitingCustomers++;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean sellKebab() {
|
||||||
|
if(waitingCustomers > 0) {
|
||||||
|
waitingCustomers--;
|
||||||
|
money += kebabPrice;
|
||||||
|
totalEarned += kebabPrice;
|
||||||
|
kebabSold++;
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotalIncome() {
|
||||||
|
return totalEarned;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWaitingCustomers() {
|
||||||
|
|
||||||
|
return waitingCustomers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getKebabPrice() {
|
||||||
|
return kebabPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpgradeCost() {
|
||||||
|
return (upgradeLevel + 1) * 50;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWorkerCost() {
|
||||||
|
return 100 + workers * 50;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void workerSellKebabs() {
|
||||||
|
for(int i = 0; i < workers; i++) {
|
||||||
|
if (waitingCustomers > 0) {
|
||||||
|
sellKebab();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
After Width: | Height: | Size: 401 B |
|
After Width: | Height: | Size: 373 B |
|
After Width: | Height: | Size: 389 B |
|
After Width: | Height: | Size: 407 B |
|
After Width: | Height: | Size: 667 B |
|
After Width: | Height: | Size: 634 B |
|
After Width: | Height: | Size: 645 B |
|
After Width: | Height: | Size: 651 B |
|
After Width: | Height: | Size: 668 B |
|
After Width: | Height: | Size: 356 B |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 375 B |
|
After Width: | Height: | Size: 376 B |
|
After Width: | Height: | Size: 358 B |
|
After Width: | Height: | Size: 371 B |
|
After Width: | Height: | Size: 384 B |
|
After Width: | Height: | Size: 289 B |
|
After Width: | Height: | Size: 279 B |
|
After Width: | Height: | Size: 343 B |
|
After Width: | Height: | Size: 250 B |
|
After Width: | Height: | Size: 450 B |
|
After Width: | Height: | Size: 290 B |
|
After Width: | Height: | Size: 235 B |
|
After Width: | Height: | Size: 255 B |
|
After Width: | Height: | Size: 372 B |
|
After Width: | Height: | Size: 239 B |
|
After Width: | Height: | Size: 403 B |
|
After Width: | Height: | Size: 418 B |
|
After Width: | Height: | Size: 240 B |
|
After Width: | Height: | Size: 363 B |
|
After Width: | Height: | Size: 251 B |
|
After Width: | Height: | Size: 225 B |
|
After Width: | Height: | Size: 286 B |
|
After Width: | Height: | Size: 333 B |
|
After Width: | Height: | Size: 233 B |
|
After Width: | Height: | Size: 396 B |
|
After Width: | Height: | Size: 656 B |
|
After Width: | Height: | Size: 978 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 775 B |
|
After Width: | Height: | Size: 873 B |
|
After Width: | Height: | Size: 720 B |
|
After Width: | Height: | Size: 771 B |
|
After Width: | Height: | Size: 682 B |
|
After Width: | Height: | Size: 851 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1016 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1012 B |
|
After Width: | Height: | Size: 974 B |
|
After Width: | Height: | Size: 908 B |
|
After Width: | Height: | Size: 662 B |
|
After Width: | Height: | Size: 996 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 783 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 716 B |
|
After Width: | Height: | Size: 790 B |
|
After Width: | Height: | Size: 676 B |
|
After Width: | Height: | Size: 956 B |
|
After Width: | Height: | Size: 968 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 484 B |
|
After Width: | Height: | Size: 565 B |
|
After Width: | Height: | Size: 622 B |
|
After Width: | Height: | Size: 417 B |
|
After Width: | Height: | Size: 235 B |
|
After Width: | Height: | Size: 500 B |
|
After Width: | Height: | Size: 517 B |
|
After Width: | Height: | Size: 501 B |
|
After Width: | Height: | Size: 351 B |
|
After Width: | Height: | Size: 373 B |
|
After Width: | Height: | Size: 565 B |
|
After Width: | Height: | Size: 675 B |
|
After Width: | Height: | Size: 644 B |
|
After Width: | Height: | Size: 788 B |
|
After Width: | Height: | Size: 720 B |
|
After Width: | Height: | Size: 807 B |
|
After Width: | Height: | Size: 577 B |
|
After Width: | Height: | Size: 295 B |
|
After Width: | Height: | Size: 746 B |
|
After Width: | Height: | Size: 720 B |
|
After Width: | Height: | Size: 650 B |
|
After Width: | Height: | Size: 447 B |
|
After Width: | Height: | Size: 505 B |