Scrolling Game Development Kit Forum

SGDK Version 1 => Script => Topic started by: Mcgooter on 2006-02-23, 04:06:50 PM

Title: RemoveSprite
Post by: Mcgooter on 2006-02-23, 04:06:50 PM
I haven't a clue about code and scripting.  I've tried to read through the docutorial a couple times, yet it all seems foreign and full of gibberish to me.  I just want to be able to remove a sprite after a certain frame number.  Here's what I got.

Code: [Select]
Dim nIdx
   With  ProjectObj.GamePlayer.PlayerSprite.rDef.rLayer
     For nIdx = 0 to .SpriteCount - 1
       If .Sprite(nIdx) Is .Sprite = "Guard1" Then
       .RemoveSprite(nIdx)
     End If
     Next
   End With

Can anyone send some info my way to how I could accomplish this correctly?
Title: Re: RemoveSprite
Post by: bluemonkmn on 2006-02-23, 04:54:19 PM
Have you considered doing this without scripting by putting the sprite on a path and having it delete itself at the end of the path?
Title: Re: RemoveSprite
Post by: durnurd on 2006-02-23, 05:44:45 PM
Take a look here (http://gamedev.comdel.net/index.php?topic=682.msg2324#msg2324) for the "official" equation for exactly how long a sprite animation is.  Then, create a path with just one point and one delay equal to the length of the animation, and have it auto-delete at end of path.