Actors クラスのいくつかの利点のために、ゲームで Actor クラスを使用しています。しかし、現在、Stage.hit(...) メソッドの使用に関する問題に直面しています。
ご存じのとおり、"hit" は Actor オブジェクトを返します。
public class Enemy extends Actor
{
int health = 100;
public Enemy (int type, float x, float y)
{
setX(x);
setY(y);
}
public void act(float deltaTime)
{
Actor hitActor = GameAsset.stage.hit(getX(), getY(), false);
if(hitActor != null))
{
health -= 10;
// next, should be reducing hitActor health in stage, but how?
}
}
...
質問は、上記のコメントで行う方法はありますか?
下手な英語でごめんなさい:D