Case 4, 5 and 6It's been a while since I last posted something here. The entries for case four and five are way too late, so I made it a multicase entry, or something. Short description of cases four through six; Case 4: Create your main scene using actionscript, and make the character move by using the arrowkeys. Additionally the character should be constrained from moving outside the confines of the scene. Case 5: Trigger the character's different animations at differing times, make the character pick up objects and construct a simple gravitational system using collision detection. Case 6: Create an enemy non playable character and make him follow the main character. Something should happen when the enemy hits the hero. Have a break and check out the result before we proceed with the less exciting stuff (assuming the result was fun). Now the (hopefully) less exciting stuff; As mentioned in the previous entry, I already got a crash-course in scripting during case 3 from my roommate, and our research assistant. I have previously coded a bit in HTML, CSS and PHP, so the concept was at the very least graspable to me. Before we started on case 4 I had a script that made the character walk, jump and fall with gravity. So I could have just waited patiently until case 5, but I felt I had to do something. I came to the conclusion that my current script was too messy with alot of flaws. So I started with a blank slate and started planning my script from the very beginning using psudocode. After having learnt the basics I quickly reached the level my script was at previously, only alot less messy. I also started experimenting with arrays, and after some struggle I finally understood enough to use it. Using arrays I probably shortened my script by one third, and it allowed me to change level in an easier manner. During case 5 I added nasalsprays for my hero to pick up, these sprays acts as "lives". The more sprays you have, the more damage you can handle. Case 6 was pretty straight forward, I already had a rough idea of how to solve it, and it worked the first time i pressed Ctrl+Enter. What took me a while was to add a deathscreen and let the player start over again. But after a long night of trying and failing I finally made it, although it's far from perfect, and merely a temporary solution. This also counts for how the enemy NPC works, the way it's coded now only works with one enemy at a time. After the sixth case I'll probably rebuild my script yet again, and I'm looking forward to it!
| ||
|
Hello, and welcome to my blog!
My name is Gisle Sølvberg, and I am currently attending the Virtual Art and Design course at Hedmark College, Norway.
I will write regularly about what I'm currently learning and making, I'll also upload all my creations for your enjoyment.
Have fun, and feel free to send me feedback from the "contact"-section.