public abstract class Weapon extends Item {
Weapon (GameEngine parentEngine)
{
super(parentEngine);
}
abstract int getMinAttackDamage();
abstract int getMaxAttackDamage();
abstract String getAttackVisual(Character attacker, Character attacked, Room attackLocation);
}
So far I have:
Class Axe extends Weapon{
Axe(GameEngine parentGameEngine)[
Super(parentGameEngine);
{
boolean getItemUsable(){
return true;
}
public String get ObjectName();
return "Axe";
}
Public String getItemVisual(){
return "4 foot long handle with a very sharp blade.";
}
这是我的问题...我如何/在哪里设置最小/最大攻击伤害&人物视觉?这是我的第一个脚本游戏。
答案 0 :(得分:0)
您的示例代码中有数千个错误。你尝试过使用IDE吗?它们可以帮助您更快地学习,因为它们可以很好地告诉您哪些是错误的。
public class Axe extends Weapon
{
public Axe(GameEngine parentGameEngine)
{
super(parentGameEngine);
}
public boolean getItemUsable()
{
return true;
}
public String getObjectName()
{
return "Axe";
}
public String getItemVisual()
{
return "4 foot long handle with a very sharp blade.";
}
public int getMinAttackDamage()
{
// fill in
}
public int getMaxAttackDamage()
{
// fill in
}
public String getAttackVisual(Character attacker, Character attacked, Room attackLocation)
{
// fill in
}
}