Post 95
Bug Fixes
Today I fixed my very first game glitch. The glitch I am referring to is when you press both "A" and "D" the player character does not move but his animation still plays as him running to the right.My first thought was to make more variables to tell the game when the player is pressing "A" and "D" and to switch the sprite index, but then I couldn't have the character switch idle sides. So I had to find I way to tie it in with the Idle direction Variable. Eventually I tried to just add more to the basic movement codes trying to get it to switch. That didn't up working either. So I tried a third time, this time with a variable called "Notmoving". This variable is always equal to 1, UNLESS "A" or "D" is pressed. Then all I needed to do was setup a few lines of code a hope it works.
AND IT DOES!!!
Tomorrow I will be blogging from home because I have a field trip, so I will work on the "Lifter" enemis visuals and animations.
Below is a GIF of the working game and the code that was required to fix it!
No comments:
Post a Comment