2013-10-03 50 views
-2

我需要在我如何一步步移动我的建议。AndEngine然后移动字符

我知道它不完整。延迟

for (int redmove = Red_Current_Location; redmove < Red_Moving_Location; redmove++) { 
    RedCoinSprite.setPosition(Numbers_Text[redmove].getX(), Numbers_Text[redmove].getY(
    thread.sleep(1000);//kinda like this,Because this is very worng. 
} 
+0

看起来像你的代码是不完整的。 – Raptor

+0

使用moveBy修饰符指定要移动多少距离,并指定interval.Put延迟修饰符并根据您的步骤使用loopEntity修饰符。 – Rama

回答

0
spritemoveHandler= new TimerHandler(time, true, 
     new ITimerCallback() 
     { 
      @Override 
      public void onTimePassed(TimerHandler arg0) 
      { 
          MoveModifier mod=new Modifier(time-1,fromPoint,toPoint); 
          sprite.registerEntityModifier(mod); 
         } 

     }); 
     scene.registerUpdateHandler(mObstacleCreatorTimeHandler); 

使用此处理

需要建议移动精灵等待第二次再次孔蒂移动精灵。时间间隔。

+0

我认为你给我的语法来自不同的游戏。我只想让精灵从瓦片闪烁到瓦片去往目标瓦片。 –

+0

您想要将图像从一个位置移动到另一个位置或在同一位置上更改图像。我认为您需要10张图像将第一张图像改变为第二张图像停留一段时间再次从第二张改变为第三张并停留一段时间等等..天气是否正确? –

0

为这

MoveByModifier RedMoveto = new MoveByModifier(100,32*5,32*5); 

RedCoinSprite.registerEntityModifier(RedMoveto);