0 Members and 1 Guest are viewing this topic.
.the following variables you must supply. the rest will be calculated..MapWidth - the map's width in tiles..MapWidthScreens - the map's width in screens.ScreenX - X position of screen in map.ScreenY - Y position of screen in map.MapPointer - pointer to the beginning of the map.CharXPos - x position of zelda.CharYPos - y position of zelda.NumEnemies - number of enemies (get this by calling getEnemies).EnemySprite - pointer to the sprite of the enemyFor(LoopVar,1,NumEnemies {LoopVar-1*2+L1->Temp}+(<CharXPos)-({Temp}>CharXPos)->{Temp} Pt-On(,{Temp+1},EnemySprite) {Temp+1}+(<CharYPos)-({Temp+1}>CharXPos)->{Temp+1}EndReturn.Call this routine whenever you change screens. it returns the number of enemies.Lbl getEnemiesScreenY*MapWidthScreens+ScreenX+MapPointer->ScreenPointer0->CounterFor(Row,0,7) For(Column,0,11) If Counter!=10 and ({Row*MapWidth+Column+ScreenPointer}=4) Row*2048+Column*8->{L1+Counter}r Counter+2->Counter End EndEndCounter/2Return