stuff
This commit is contained in:
parent
08d256e0cd
commit
e2be0077d5
@ -10,10 +10,10 @@
|
|||||||
*** DONE Zombies random spawn
|
*** DONE Zombies random spawn
|
||||||
*** TODO reales level
|
*** TODO reales level
|
||||||
vllt https://limezu.itch.io/modernexteriors
|
vllt https://limezu.itch.io/modernexteriors
|
||||||
** TODO Persistierung des Spielstandes (abspeichern)
|
** DONE Persistierung des Spielstandes (abspeichern)
|
||||||
*** DONE only 1 save or pick save
|
*** DONE only 1 save or pick save
|
||||||
only one save
|
only one save
|
||||||
*** TODO dont show full intro when save exists
|
*** DONE dont show full intro when save exists
|
||||||
* Dokumentation
|
* Dokumentation
|
||||||
** TODO Kurze Präsentation (10 min) im letzten Labortermin (eine pro Gruppe)
|
** TODO Kurze Präsentation (10 min) im letzten Labortermin (eine pro Gruppe)
|
||||||
** DONE JavaDoc-Dokumentation
|
** DONE JavaDoc-Dokumentation
|
||||||
@ -21,3 +21,8 @@ only one save
|
|||||||
|
|
||||||
* Spaß
|
* Spaß
|
||||||
** level system
|
** level system
|
||||||
|
** Save points
|
||||||
|
** Zombies follow
|
||||||
|
** Something to do with levels
|
||||||
|
** Minimap of some sort
|
||||||
|
** Better start screen
|
||||||
|
|||||||
@ -9,9 +9,8 @@ public class Character implements Drawable {
|
|||||||
int color;
|
int color;
|
||||||
boolean collidable;
|
boolean collidable;
|
||||||
Position pos;
|
Position pos;
|
||||||
int experience = 0;
|
|
||||||
int level = 1;
|
|
||||||
float damage_mult = (float) (1 + level * 0.4);
|
|
||||||
int textsize = 20;
|
int textsize = 20;
|
||||||
|
|
||||||
Character (Fenster window, String type) {
|
Character (Fenster window, String type) {
|
||||||
|
|||||||
@ -112,11 +112,10 @@ public class Fenster extends PApplet {
|
|||||||
|
|
||||||
gameScreen.draw();
|
gameScreen.draw();
|
||||||
fightScreen.draw();
|
fightScreen.draw();
|
||||||
deathScreen.draw();
|
|
||||||
|
|
||||||
|
|
||||||
popMatrix();
|
popMatrix();
|
||||||
ui.draw();
|
ui.draw();
|
||||||
|
deathScreen.draw();
|
||||||
if (gametitel) {
|
if (gametitel) {
|
||||||
fill(color(49, 54, 63), gametitel_gamma);
|
fill(color(49, 54, 63), gametitel_gamma);
|
||||||
rect(0, 0, 800, 800);
|
rect(0, 0, 800, 800);
|
||||||
|
|||||||
@ -1,4 +1,7 @@
|
|||||||
public abstract class Fightable extends Character {
|
public abstract class Fightable extends Character {
|
||||||
|
int experience = 0;
|
||||||
|
int level = 1;
|
||||||
|
float damage_mult = (float) (1 + level * 0.4);
|
||||||
|
|
||||||
public Fightable(Fenster window) {
|
public Fightable(Fenster window) {
|
||||||
super(window);
|
super(window);
|
||||||
|
|||||||
@ -9,8 +9,10 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class Player extends Fightable implements Health {
|
public class Player extends Fightable implements Health {
|
||||||
int health;
|
int health;
|
||||||
|
|
||||||
int maxHealth = 20;
|
int maxHealth = 20;
|
||||||
|
|
||||||
|
|
||||||
List<Skill> skills = new ArrayList<Skill>();
|
List<Skill> skills = new ArrayList<Skill>();
|
||||||
Skill skill = new Tritt(window, this);
|
Skill skill = new Tritt(window, this);
|
||||||
|
|
||||||
@ -46,4 +48,17 @@ public class Player extends Fightable implements Health {
|
|||||||
health = maxHealth;
|
health = maxHealth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void level_sync() {
|
||||||
|
level = experience/100;
|
||||||
|
}
|
||||||
|
public void draw() {
|
||||||
|
if (window.gameScreen.active()) {
|
||||||
|
pos.sync_grid();
|
||||||
|
}
|
||||||
|
level_sync();
|
||||||
|
window.fill(color);
|
||||||
|
window.textSize(textsize);
|
||||||
|
window.text(type, pos.get().x, pos.get().y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
*/
|
*/
|
||||||
public class Skill {
|
public class Skill {
|
||||||
Fenster window;
|
Fenster window;
|
||||||
Character user;
|
Fightable user;
|
||||||
Character target;
|
Fightable target;
|
||||||
static int power = 5;
|
static int power = 5;
|
||||||
int numPoints = 10;
|
int numPoints = 10;
|
||||||
|
|
||||||
|
|||||||
@ -5,12 +5,19 @@ import processing.core.PApplet;
|
|||||||
*/
|
*/
|
||||||
public class Talkable extends Character implements Interactable{
|
public class Talkable extends Character implements Interactable{
|
||||||
Bubble bubble;
|
Bubble bubble;
|
||||||
|
boolean healme = false;
|
||||||
|
|
||||||
|
|
||||||
Talkable (Fenster window, String type, int color, boolean collidable, Bubble bubble) {
|
Talkable (Fenster window, String type, int color, boolean collidable, Bubble bubble) {
|
||||||
super(window, type, color, collidable);
|
super(window, type, color, collidable);
|
||||||
this.bubble = bubble;
|
this.bubble = bubble;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Talkable (Fenster window, String type, int color, boolean collidable, Bubble bubble, boolean healme) {
|
||||||
|
super(window, type, color, collidable);
|
||||||
|
this.bubble = bubble;
|
||||||
|
this.healme = healme;
|
||||||
|
}
|
||||||
Talkable(Talkable another) {
|
Talkable(Talkable another) {
|
||||||
super(another);
|
super(another);
|
||||||
}
|
}
|
||||||
@ -21,8 +28,10 @@ public class Talkable extends Character implements Interactable{
|
|||||||
|
|
||||||
public void interact() {
|
public void interact() {
|
||||||
if(!this.bubble.toggle()) {
|
if(!this.bubble.toggle()) {
|
||||||
window.player.heal(20);
|
if (healme) {
|
||||||
window.healEffect.play();
|
window.player.heal(20);
|
||||||
|
window.healEffect.play();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@ public class Tiles implements Drawable {
|
|||||||
Cell[][] tileMap;
|
Cell[][] tileMap;
|
||||||
float tilewidth;
|
float tilewidth;
|
||||||
Talkable old_dude;
|
Talkable old_dude;
|
||||||
|
Talkable item;
|
||||||
|
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
|
|
||||||
@ -31,7 +32,8 @@ public class Tiles implements Drawable {
|
|||||||
}
|
}
|
||||||
void settings() {
|
void settings() {
|
||||||
|
|
||||||
old_dude = new Talkable(window, "T", window.color(20,20,200), true, new Bubble(window, Arrays.asList("Hey Junge!", "Was machst du hier unten?", "Lass mich dich heilen...")));
|
old_dude = new Talkable(window, "T", window.color(20,20,200), true, new Bubble(window, Arrays.asList("Hey Junge!", "Was machst du hier unten?", "Lass mich dich heilen...")), true);
|
||||||
|
item = new Talkable(window, "?", window.color(20,20,200), true, new Bubble(window, Arrays.asList("You found an item", "There is probably nothing", "you can do with it right now...")));
|
||||||
|
|
||||||
tileMap = new Cell[100][100];
|
tileMap = new Cell[100][100];
|
||||||
for(int i = 0; i < tileMap.length; i++) {
|
for(int i = 0; i < tileMap.length; i++) {
|
||||||
@ -63,6 +65,8 @@ public class Tiles implements Drawable {
|
|||||||
|
|
||||||
tileMap[30][30].character = old_dude;
|
tileMap[30][30].character = old_dude;
|
||||||
tileMap[10][10].character = new Enemy(window);
|
tileMap[10][10].character = new Enemy(window);
|
||||||
|
|
||||||
|
tileMap[rand.nextInt(50)][rand.nextInt(50)].character = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
13
src/UI.java
13
src/UI.java
@ -12,8 +12,12 @@ public class UI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void bottomBar(float x, float y) {
|
private void bottomBar(float x, float y) {
|
||||||
|
window.textSize(20);
|
||||||
|
window.fill(255);
|
||||||
window.rectMode(window.CENTER);
|
window.rectMode(window.CENTER);
|
||||||
window.rect(x, 775, 300, 50);
|
window.rect(x, 775, 300, 50);
|
||||||
|
exp(window.player.experience, window.player.level, x, 780);
|
||||||
|
healthBar(x, 760, window.player.health, window.player.maxHealth);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void healthBar(float x, float y, int health, int maxHealth) {
|
public void healthBar(float x, float y, int health, int maxHealth) {
|
||||||
@ -26,13 +30,14 @@ public class UI {
|
|||||||
window.rect(x - barlength/2, y, healthLength, 5);
|
window.rect(x - barlength/2, y, healthLength, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void exp(int exp) {
|
public void exp(int exp, int level, float x, float y) {
|
||||||
window.text(exp, 50, 100);
|
window.fill(0);
|
||||||
|
window.text("exp " + exp + " level " + level, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void draw() {
|
public void draw() {
|
||||||
bottomBar(400, 700);
|
bottomBar(400, 700);
|
||||||
healthBar(50, 50, window.player.health, window.player.maxHealth);
|
|
||||||
exp(window.player.experience);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user