Esempio n. 1
0
    @Override
    public void execute(Hero hero, String action) {
      if (action.equals(AC_PLANT)) {

        hero.spend(TIME_TO_PLANT);
        hero.busy();
        ((Seed) detach(hero.belongings.backpack)).onThrow(hero.pos);

        hero.getSprite().operate(hero.pos);

      } else if (action.equals(Food.AC_EAT)) {
        detach(hero.belongings.backpack);

        hero.getSprite().operate(hero.pos);
        hero.busy();

        SpellSprite.show(hero, SpellSprite.FOOD);
        Sample.INSTANCE.play(Assets.SND_EAT);

        hero.spend(Food.TIME_TO_EAT);
      }

      super.execute(hero, action);
    }
Esempio n. 2
0
 public void spendAndNext(float time) {
   busy();
   spend(time);
   next();
 }