2
« on: 2005-10-07, 01:52:40 PM »
Hello. I am writing a script so that I can switch the playersprite to an animated sprite. The animated sprite is player_strike and the original sprite is player
So taht when you press button1 you see him swing his sword. I hope I make myself clear?
But everytime I press button1 it makes a new player_strike sprite. This is because of my .removesprite method call. It removes I believe the (0)indexed sprite from the layer.
I want to execute my If then(oldAction NewAction and action button 1 statement based on which sprite is the player sprite.
If it is player, then it wille execute. If it is player_strike I don't want it to execute until I change the playersprite back to player. I havn't coded the back player script yet.
'How do I check to see which sprite is the playersprite?
'I tried to use an If then statement,
If ProjectObj.GamePlayer.PlayerSprite = _
ProjectObj.GamePlayer.rMap.rDef.SpriteDefs_("Player") Then blah blah.......
End If
I also was wondering how to index it to (0) when I change back to "player" as the playersprite. So that in my code .RemoveSprite(0)(whenever I change to "player_strike") will work. Because obviously if I change back to my playersprite and do not index it to (0). Then it will not work.
One reason why I am changing sprite is because I don't want the main player to move while attacking. That is why I use to different sprites.