thx guys... no labels or gotos or gosubs... just a series of instructions within if/else/endif or select/case branches within a single function...
the function serves as the sole update function for a class in my OO engine... and i was just planning to use the labels as markers for quickly locating stuff in the editor...
;------------------------------------------------------------------------------------------------------
;
; Gato Class Submarine Class Implementation
;
; the methods are actually contained within conditional clauses, depending on what is needed
;
;------------------------------------------------------------------------------------------------------
Function UpdateGatoClassSubs(this.tObject)
;----------------------------------------------------------------------- one time initialization
;
If this\status=0
; sub must be modelled to actual scale
gatoDraught=8 ; draught is represented as 1/2 the real world draught
gatoDepth(this\objID)=gatoDraught
gatoIndicatedDepth(MaxGatoClassSubs)=gatoDepth(this\objID)-gatoDraught
PositionEntity this\hEntity,-300,gatoDraught,400,True
this\status=1
EndIf
;--------------------------------------------------------------------------------------- always
;
gatoIndicatedDepth(MaxGatoClassSubs)=gatoDepth(this\objID)-gatoDraught
;----------------------------------------------------- if on the surface
;
If gatoDepth(this\objID)>(gatoDraught-6)
; roll with the waves
;
;PositionEntity this\hEntity,EntityX(this\hEntity),gatoDepth(this\objID)+(Sin(gatoDeckAngle(this\objID))/-10),EntityZ(this\hEntity)
MoveEntity this\hEntity,0,Sin(gatoDeckAngle(this\objID))/-16,gatoActualSpeed(this\objID)
RotateEntity this\hEntity,-.4+(Sin(GatoDeckAngle(this\objID))),0,0
gatoDeckAngle(this\objID)=gatoDeckAngle(this\objID)+1.2
; check not exceeding surfaced Y limits
;
If EntityY(this\hEntity)>gatoDraught Then PositionEntity(this\hEntity,EntityX(this\hEntity),gatoDraught,EntityZ(this\hEntity))
;If EntityY(this\hEntity)<(gatoDraught*-1) Then PositionEntity(this\hEntity,EntityX(this\hEntity),(gatoDraught*-1),EntityZ(this\hEntity))
MoveEntity this\hEntity,0,0.02,0
EndIf
.throttle
;----------------------------------------------------------------- register throttle changes
; 1=slow 2=1/3 3=2/3 4=std 5=full 6=flank
Select gatoThrottlePos(this\objID)
Case 0
gatoTargetSpeed(this\objID)=.0
Case 1
gatoTargetSpeed(this\objID)=.5
Case 2
gatoTargetSpeed(this\objID)=1
Case 3
gatoTargetSpeed(this\objID)=1.5
Case 4
gatoTargetSpeed(this\objID)=2
Case 5
gatoTargetSpeed(this\objID)=2.3
Case 6
gatoTargetSpeed(this\objID)=2.5
End Select
....
....
....
that should be ok, right...
--Mike