Post 132
Back To Coding
Today I decided to just jump back into my game development and get my crap together. So i started by making my attack animation look a little bit smoother by adding some extra frames.
Currently this looks and feels better, but the actually attack occurs right as the player hits the mouse button, so the enemy will take damage even when the players sword is still being swung. This doesn't make that much sense, so I am trying to make the hit box only appear after the second or third frame of the animation. However game makers Image_index can be tricky and I can't seem to make this occur easily. The detection of image frames is somewhat inaccurate depending on the speed of the animation. Currently it will not detect when it should actually make the enemy take damage because it cant detect when the animation is on image 3. This is because when its detecting the frames it has the tendency to skip frames (says the internet and various Youtube videos). The common solution to this problem is to change my equal signs to a greater than sign. So instead of it detecting a split millisecond of a single frame, all it has to do is detect one of the frames beyond it. But even after doing that the code still cannot and will not detect when the image frame has gone beyond 3. Currently there are only 5 frames in the animation, so I am unsure whether its because of the low amount of frames that causes this to be incredibly difficult or if its just because of a stupid inconvenience inside Game Maker itself.
Tomorrow I will continue to work on this issue and hopefully fix it to work exactly how I want it to work.
No comments:
Post a Comment