[AndEngine] Reusable MoveModifier

Hello forums,

to prevent the java garbage collector kicking in, it is common sense to avoid object allocation during runtime.

However, during your AndEngine adventures, you may have seen something like this:

  1. publicvoidfireTo(floatx,floaty)
  2. {
  3. MoveModifier mm=newMoveModifier(1.0f, 100, x, 100, y);
  4. registerEntityModifier(mm);
  5. }

http://www.andengine.org/forums/tutorials/code-snippet-reusable-movemodifier-t8291.html
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章