Case 4
This time we have to code the character so it's walking when pressing a key and doing an idle when releasing a key.
I thought i was starting to understand more about coding, so i tried to make the codes on this case based on the notes i took in class on monday. I opened the flash and actionscript files that i had made on Case 3(that wasn't a smart move). Based on the notes I typed in the codes for importing keyboard events and the event listeners for keyboards. Honestly i wasn't a 100% sure what i did, and few attempted fail, i gave up and decided to see how it's done on our weekly tutorial about flash and actionscript. So far I find them more helping than reading the actionscript manual, even though they explain things too fast
I made a new file only to be sure i wasn't messing up my case 3 file any further. They typed in some explanations before getting on with the code. I think it helps to understand what the codes stands for. One code we were shown was the scaleX, but it didn't work well for me. Maybe because I put in two different sprites - one walking left and the other walking right. So I removed the scaleX code, but then the idle didn't work when i released the key. It wasn't until later I found out the idle name was wrong, and when that was fixed it faced left only when releasing the key.
A few weeks later I typed in the scaleX code again. The sprites for when the key was pressed and released were changed several times too. Then i found out it would only work properly by typing in the sprites facing one direction, in this case right. If one sprite is facing the other direction than the others, it might either moonwalk or do an idle from the opposite way it was orignally facing.
This link will bring you to my case 4
I found out i had deleted the entired addEventListener on my case 3, and fixed it. Only it's only walking off the screen and not turning. Maybe I messed up something on the if codings, or maybe there is something don't notice.
I thought i was starting to understand more about coding, so i tried to make the codes on this case based on the notes i took in class on monday. I opened the flash and actionscript files that i had made on Case 3(that wasn't a smart move). Based on the notes I typed in the codes for importing keyboard events and the event listeners for keyboards. Honestly i wasn't a 100% sure what i did, and few attempted fail, i gave up and decided to see how it's done on our weekly tutorial about flash and actionscript. So far I find them more helping than reading the actionscript manual, even though they explain things too fast
I made a new file only to be sure i wasn't messing up my case 3 file any further. They typed in some explanations before getting on with the code. I think it helps to understand what the codes stands for. One code we were shown was the scaleX, but it didn't work well for me. Maybe because I put in two different sprites - one walking left and the other walking right. So I removed the scaleX code, but then the idle didn't work when i released the key. It wasn't until later I found out the idle name was wrong, and when that was fixed it faced left only when releasing the key.
A few weeks later I typed in the scaleX code again. The sprites for when the key was pressed and released were changed several times too. Then i found out it would only work properly by typing in the sprites facing one direction, in this case right. If one sprite is facing the other direction than the others, it might either moonwalk or do an idle from the opposite way it was orignally facing.
This link will bring you to my case 4
I found out i had deleted the entired addEventListener on my case 3, and fixed it. Only it's only walking off the screen and not turning. Maybe I messed up something on the if codings, or maybe there is something don't notice.
Kommentarer
Legg inn en kommentar