Getneightbourhood without edge detection.
This commit is contained in:
parent
b2883a1c80
commit
ea0a2695cc
63
src/inf101/v18/rogue101/items/Manga.java
Normal file
63
src/inf101/v18/rogue101/items/Manga.java
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
4
src/inf101/v18/rogue101/objects/Player.java
Normal file
4
src/inf101/v18/rogue101/objects/Player.java
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
package inf101.v18.rogue101.items;
|
||||||
|
|
||||||
|
public class Player {
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user