Here is what I do for my Metroid Classic....this is my routine for the Zoomers
-cbmeeks
;------------------------------------------------------------ ; UpdateZoomers() -- Updates all alive zoomers ;------------------------------------------------------------ Function UpdateZoomers() ZoomersOnScreen = 0 For z.ZoomerType = Each ZoomerType ;only process Zoomers that are on screen...just like the original If ((z\x - MAPX) > -ZoomerWidth) And ((z\x - MAPX) < SCR_WIDTH) Then ;Zoomer Timer z\ZoomerTimer = z\ZoomerTimer - 1 ;draw them Select z\state Case ALIVE AnimZoomer(z) MoveZoomer(z) DrawZoomer(z) ZoomersOnScreen = ZoomersOnScreen + 1 End Select ;debug If ZoomerDebug = 1 Then Color 255,255,0 Text z\x - MAPX, (z\y + ZoomerHeight + 5) - MAPY, "sx: " +( z\x - MAPX) Text z\x - MAPX, (z\y + ZoomerHeight + 15) - MAPY, "sy: " +( z\y - MAPY) Text z\x - MAPX, (z\y + ZoomerHeight + 25) - MAPY, "wx: " +( z\x ) Text z\x - MAPX, (z\y + ZoomerHeight + 35) - MAPY, "wy: " +( z\y ) Text z\x - MAPX, (z\y + ZoomerHeight + 45) - MAPY, "d: " + z\direction Text z\x - MAPX, (z\y + ZoomerHeight + 55) - MAPY, "f: " + z\frame End If End If Next If ZoomerDebug = 2 Then Color 255,0,255 Text VIEWPORT_X,20,"Zoomers On Screen: " + ZoomersOnScreen End If End Function
-cbmeeks