Need a bit of help

Blitz3D Forums/Blitz3D Beginners Area/Need a bit of help

En929(Posted 2011) [#1]
I know this isn't the 2d Blitz Basic forum (but it seems like this is quite an active forum). I need a bit of help with some frame problems in a 2d Blitz Basic game that I'm trying to make. I posted my problem in the 2d Blitz Basic forum here: http://www.blitzbasic.com/Community/posts.php?topic=95265


Who was John Galt?(Posted 2011) [#2]
I only have BlitzMax, otherwise I would run it and give you a bit more detail, but it looks like you have walking frames followed by a couple of frames of punching in your anim strip?

Your punch sequence increments the frame number, which is identical to what your walking code does. What you actually want to do, is if punch is pressed, jump straight to the first punch frame.

To automate the punching, have a flag to show if the character is punching. If the punch key is hit and the punching flag is false (i.e. you are not already in the middle of a punch), set the frame to the first punch frame and set the punching flag to true. Then if the punching flag is true each loop, do what you already do- increment the frame to advance the punch, and if you get to the last punch frame, set the punch flag to false and revert to a walking frame.

I hope that makes sense. Bit of a mouthful, but have a crack at it and report back.


Who was John Galt?(Posted 2011) [#3]
I know you got the code written for you in other threads which is very helpful of those involved, but i think it's basic netiquette to at least acknowledge those who take the time formulating a response. Thinking from a purely selfish standpoint, it could be the difference between receiving useful help from that person in future and not.


En929(Posted 2011) [#4]
Thanks John. I totally agree with you. That is the right thing to do. I will definitely acknowledge all of you who are helping me and in the future if I could make a game or so and it suddenly makes money or something, I will split it all with whoever helped me. I’ll also help people who want to learn too whenever I happen to get good enough at using Blitz.


Who was John Galt?(Posted 2011) [#5]
Good man... haha... I don't think anyone expects a share of the green.