Getneightbourhood without edge detection.

This commit is contained in:
Kristian Knarvik 2018-03-07 21:39:56 +01:00
parent b2883a1c80
commit ea0a2695cc
2 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,63 @@
package inf101.v18.rogue101.examples;
import inf101.v18.gfx.gfxmode.ITurtle;
import inf101.v18.rogue101.game.IGame;
import inf101.v18.rogue101.objects.IItem;
import javafx.scene.paint.Color;
public class Manga implements IItem {
int hp = getMaxHealth();
@Override
public boolean draw(ITurtle painter, double w, double h) {
painter.save();
painter.jump(-10);
painter.setInk(Color.BLACK);
painter.draw(getSize());
painter.turn(90);
painter.draw(getSize()/2);
painter.turn(90);
painter.draw(getSize());
painter.turn(90);
painter.draw(getSize()/2);
painter.restore();
return true;
}
@Override
public int getCurrentHealth() {
return hp;
}
@Override
public int getDefence() {
return 0;
}
@Override
public int getMaxHealth() {
return 1;
}
@Override
public String getName() {
return "Manga";
}
@Override
public int getSize() {
return 20;
}
@Override
public String getSymbol() {
//return "🕮";
return "M";
}
@Override
public int handleDamage(IGame game, IItem source, int amount) {
hp -= amount;
return amount;
}
}

View File

@ -0,0 +1,4 @@
package inf101.v18.rogue101.items;
public class Player {
}