引用:http://www.oschina.net/code/snippet_12_4121
[代码] [Java]代码
01 |
public class Player extends AnimatedSprite { |
04 |
protected void onManagedUpdate( final float pSecondsElapsed) { |
05 |
super .onManagedUpdate(pSecondsElapsed); |
06 |
onBeforePositionChanged(); |
09 |
private boolean onBeforePositionChanged(){ |
18 |
int enemyListSize = levelController.getEnemyList().size(); |
19 |
for ( int i = 0 ; i < enemyListSize; i++) |
20 |
if ( this .collidesWith(levelController.getEnemyList().get(i))) |
22 |
levelController.callbackCollisionEnemy(); |
25 |
for ( int i = 0 ; i < levelController.getGoodsList().size(); i++) |
26 |
if ( this .collidesWith(levelController.getGoodsList().get(i))) |
28 |
levelController.callbackCollisionGoods(i); |
32 |
for ( int i = 0 ; i < levelController.getEndPointList().size(); i++) |
33 |
if ( this .collidesWith(levelController.getEndPointList().get(i))) |
35 |
levelController.callbackCollisionWithEndPoint(); |
[文件] TheHardestGame.zip ~ 6MB 下载(453)