0
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.";
}

这是我的问题......我如何/在哪里设置最小/最大攻击伤害和角色视觉?这是我的第一个脚本游戏。

4

1 回答 1

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
    }
}
于 2013-08-31T15:22:21.587 回答