From 66d36c4ea2fe433e56f9a696e5e7f8ea7c14aed3 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 1 Jul 2021 11:00:27 +0200 Subject: [PATCH] Rick added --- Zoelda/src/main/entities/Rick.java | 36 ++++++++++++++++++ Zoelda/src/main/worlds/TestWorld.java | 14 +++++++ .../res/{ => images}/rick_sprite_sheet.png | Bin 3 files changed, 50 insertions(+) create mode 100644 Zoelda/src/main/entities/Rick.java rename Zoelda/src/res/{ => images}/rick_sprite_sheet.png (100%) diff --git a/Zoelda/src/main/entities/Rick.java b/Zoelda/src/main/entities/Rick.java new file mode 100644 index 0000000..32d1ba0 --- /dev/null +++ b/Zoelda/src/main/entities/Rick.java @@ -0,0 +1,36 @@ +package main.entities; + +import main.SheetLoader; + +public class Rick extends LivingEntity{ + + private static SheetLoader loader = new SheetLoader("/res/images/rick_sprite_sheet.png"); + + public Rick() { + loader.generateFigures(24, 24, new int[] {4}); + + width = 0.7f; + height = 0.8f; + spriteOffsetY = -0.14f; + spriteScale = 0.8f; + posX = 4f; + posY = 4f; + mirrored = true; + + loader.getFigur(0).animationsGeschwindigkeitSetzen(531); + actionFigur.neuerZustand(loader.getFigur(0), "dancin"); + zustandSetzen("dancin"); + } + + @Override + public String getDeathAnimationName() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getDamageAnimationName() { + // TODO Auto-generated method stub + return null; + } +} diff --git a/Zoelda/src/main/worlds/TestWorld.java b/Zoelda/src/main/worlds/TestWorld.java index dadf214..120dd3d 100644 --- a/Zoelda/src/main/worlds/TestWorld.java +++ b/Zoelda/src/main/worlds/TestWorld.java @@ -1,7 +1,9 @@ package main.worlds; import main.entities.Coin; +import main.entities.Rick; import main.entities.Snake; +import main.entities.Spider; import main.maps.Map; public class TestWorld extends World { @@ -23,5 +25,17 @@ public class TestWorld extends World { s.setPosX((float) (Math.random() * 5 + 2)); getCurrentMap().addAnimatedEntity(s); } + + for (int i = 0; i < 20; i++) { + Spider spooda = new Spider(); + spooda.setPosX((float) (Math.random() * 5 + 2)); + getCurrentMap().addAnimatedEntity(spooda); + } + + for (int i = 0; i < 1; i++) { + Rick astley = new Rick(); + astley.setPosX((float) (Math.random() * 5 + 2)); + getCurrentMap().addAnimatedEntity(astley); + } } } diff --git a/Zoelda/src/res/rick_sprite_sheet.png b/Zoelda/src/res/images/rick_sprite_sheet.png similarity index 100% rename from Zoelda/src/res/rick_sprite_sheet.png rename to Zoelda/src/res/images/rick_sprite_sheet.png