OK i was going through some posts and saw a solution to a problem the other day, and it made me go check on an old piece of code. in checking the old piece of code, i found that the problems was not the same as in the post but i still tried to fix it. i have "pruned" my code and tried fixing it several ways but i cant get it to work. here it is:
what happens, is that when i run into my power-up, its supposed to activate a timer and do a certain effect. the part i can't get to work is the removal of the one object. what happens right now is that it activates and then it deletes all the other power ups any help would be nice.
Function updatepickup() For o.pickup=Each pickup For p.player=Each player If EntityCollided (p\e,pikup) o\active=True ;FreeEntity o\e End If If o\kind=3 And o\active=False TurnEntity o\e,1,2,1;if its a health pack and its not used, make it spin If o\kind=1 And o\active=True;if the player has run into a cloaking power-up ;ON o\life=o\life-1 ;count down the cloaking counter If o\life>1 ;if time is not up EntityAlpha p\e,.1 ;set alpha to see-through p\state=1 ;set state to on ;OFF Else If o\life<1 ;if "dead" EntityAlpha p\e,1 ;set alpha to opaque p\state=0 ;set state to off Stop End If Delete o ElseIf o\kind=2 And o\active=True o\life=o\life-1;count down the "x-ray" counter If o\life>1;if time is not up WireFrame True;turn on "x-ray vision" Else If o\life<1;if "dead" WireFrame False;turn off "x-ray vision" End If Delete o ElseIf o\kind=3 And o\active=True If p\hp<3 p\hp=p\hp+1 End If Delete o End If Next Next End Function
what happens, is that when i run into my power-up, its supposed to activate a timer and do a certain effect. the part i can't get to work is the removal of the one object. what happens right now is that it activates and then it deletes all the other power ups any help would be nice.