Rick added

This commit is contained in:
Max 2021-07-01 11:00:27 +02:00
parent 21790ecd7a
commit 66d36c4ea2
3 changed files with 50 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -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);
}
}
}

View File

Before

Width:  |  Height:  |  Size: 444 B

After

Width:  |  Height:  |  Size: 444 B