søndag 15. november 2009

Case 8 - Picking It Up

The task in this case was to create something for the hero to pick up and gather. In some games a timer is also implemented, so if you wanted the game to be timed, this was the case to solve it.

I decided to create my energy orbs in an array. An array is a kind of container in AS3 which contains several instances of an object. When I had placed to orbs in this array, I used the code and placed them individually around my level. In this week I also placed out the platforms, creating a first draft of my world. I also tried spreading the orbs around randomly using a math code, but I wanted to have full control over them. I also decided to only have 4 orbs around the map. And story vice these were the energy orbs to charge our hero’s gun so that he could defeat the Mother-Virus.

In the lab on Thursday, they showed a really good and simple example of how to create and use an array. They created 10 balls, and first placed them orderly around the screen, then randomly using the math code I mentioned earlier. This really helped me a lot, and made me understand the usage of arrays.

I decided not to use a timer in my game, because I wanted it to be simple. I may later add a timer if I see that the game needs more challenges. But I tried to make a “test-timer” just for the learning experience, and it worked well. The examples shown in the lab were also very useful here.

One way I think I’m going to implement the timer later, is when I’m going to move my enemy back and forth. Since I move all my backgrounds, platforms and objects, instead of my character, I have to find a way to make my enemy move along the x-axis, without using a code similar to the ones we created in case 3.

1 kommentar: