lørdag 31. desember 2011

SEFarstad Revamped

Just a quick note:

I am now gonna use this blog to write about design and web related stuff. I've just started my own small design-company and I'm currently putting the finishing touches on the website.

This blog will be used to write small articles and just to have a place for me to share my thoughts on stuff that interests me and hopefully you. I will also continue to write in the good ol' English language, both to practice me writing skills (probably going to Australia for a semester this summer) and to be able to communicate with a broader group of people.

torsdag 26. november 2009

Case 10 - Victory or defeat


Nortrom MacFree - Beta version by ~SveinE89 on deviantART

In this week’s case our objective was to create some kind of way to show the player that you’ve either won or lost. In addition we also were supposed to create a starting menu with instructions and a button to start the game. In the win/loose screens we should make it possible to restart the game.

In this case I first had to reorganize my script-file. I learned what I needed to do in our group meeting on Monday, where we were introduced to the concept. The first function I called in was the constructor, where all the main objects of the game are added. But now that I needed a start screen, I had to move this constructor further down in the script. I added two new functions over it; the intro and menu function (in addition to the functions for the buttons).

I spent a lot of time this week on designing the different screens, since the programming went pretty smoothly. I decided to make the loosing screen a so called “blue screen of death”, which is a familiar term in the computer world. I created a replica of the well known blue screen that appears in the earlier versions of the Windows operation system when you crash your computer. I also decided that instead of creating a button to click with on with your mouse to restart, I just bound a key to restart the game. This suited the blue screen more, since you often got the message “Press any key to attempt to continue”. For the intro and win screen, I decided to create a small movie sequence to create a sort of background story.

After letting people see my game and give me feedback, I also spent a lot of time revamping the game. I made it a bit harder by adding more enemies, and increasing their speed. I’ve also added a timer that makes you lose if the time runs out. I also worked on the design and placing of the different objects.

søndag 15. november 2009

Case 9 - Behold: Sound.

In this week we got to make sounds and music for our game. All the sound have to be triggered by AS3. It also has to be license-free, meaning that I can’t use for instance Britney Spears – Oop I did it Again in my game.

I wanted to have one special theme that was going to loop in the background, a sound when the hero picked up orbs, a sound for when the he hit enemies, some catch-phrases my hero would shout out every once and a while, and some other music bits I could use in my intro/outro. I tried looking on the internet on several free-sound web-pages, but I wasn’t completely happy with the material I found. Therefore I contacted a friend of mine, who makes digital music and sounds. I explained how my game worked and described what kind of sounds I wanted. And after a while I got some material that I’m very happy with.

The way of adding music was quite simple. On our group meeting on Monday I learned all I needed to know. This time Ole Andreas created a chat-like thing in our Fronter-room that he used to show us what code we needed to use sound in AS3. I think that method worked out really good, because we could all talk, read/write the code, and use the code by typing it in our own scripts at the same time.

The way I added sound to my game was quite easy. First I imported the necessary properties, made variables for the sound I would use from my library, and then I made variables for 3 different sound channels. By creating sound channels you can play several sounds “on top of each other”. For instance background music and a sound when you pick up orbs. I created one channel for background sound/music, one for sound-effects, and one for vocals.

I managed to add a background music easily and a sound when you pick up an orb. One problem I’ve encountered here is that I chosen to just scale the orbs down to 0 when they’re picked up, instead of removing them, and that leads to that every time I walk over the place where an orb used to be, the sound is also played. I’m currently working on this at the moment and I won’t publish a new version of the game before I feel comfortable with it.

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.

Case 7 - Bad Guys

In this case we were supposed to design enemies for our heroes. Like I’ve mentioned earlier I was going with viruses and Trojan horses as the bad guys. These bad guys should have some kind of AI, they can follow the character, patrol a certain path or whatever. In this case we also were supposed to learn about using more than one class/.as-file. This can make your code easier to control and is a must if you’re creating bigger applications.



That is one of the bad guys; The Virus.

After discussing in the group meeting on Monday, I thought this would be an easy case. But as I got working on the code, I realized that I was wrong. It took a long time before I really understood the point of doing it this way, and I’m not sure I’ve done it now either. I can see the usage of more classes is valuable in bigger projects, but with a small flash game like this I’m not quite sure.




Here is the second bad guy in the game: The Trojan Horse.

After a while I managed to create the 2 classes; one main-class and one enemy-class. In the enemy-class I set the positions etc, and gave my enemy a very simple AI, that just makes him patrol back and forth. I have not created a function that says what is going to happen if our hero hits him, but I am working on it.

søndag 25. oktober 2009

Case 6 – Making the World


Case 6 - Designing the world by ~SveinE89 on deviantART

In this case we were supposed to design our backgrounds and other characters in the game. The storyline and contents of the game were also to be defined.

I’m going to start my game with a small intro, showing a person working on his PC and then suddenly it gets infected by a monster-virus. His only hope is Nortrom MacFree, the antivirus-man. You will be controlling the hero inside the computer, where he is faced with a lot of dangers. I’m thinking of having two types of enemies; Virus (a green, yucky, annoying creature that will be following our hero around) and Trojan Horses (a more mechanic creature patrolling a given path).

Throughout the level our hero will be collecting energy-orbs. These orbs will be used at the end when he reaches “the mother-virus”. He will use the orbs to charge his virus-demolishing-gun. This sequence I’m going to make as an animation, like the intro.

I created a background that looks like the insides of a computer, well a broken computer that is. This virus infection was so powerful that the computer actually got damaged physically. When I’m going to implement this background into the game, the hero will always be centered and the “camera” will follow him when he moves back and forth, moving the background accordingly. I’ve also designed a couple of platforms/grounds that I’m going to use in the game.

Picture of the entire background below:

mandag 19. oktober 2009

Case 5 - Jump and fall


Case 5 - Jump and ground by ~SveinE89 on deviantART

In this week's case our objective would be to create a jumping motion, and a ground that the character wouldn't fall straight through.

In the previous case I had already created a jumping function, using a guide i found at www.mrsunstudios.com, but now I had to look at it from another point of view. In this case we had to implement gravity to our character. And as most of us know, gravity is a force that pulls us down. In the actionscript-world, that meant that I had to move the character down, along the y-axis, every frame. So when I told the character to move up with my jump-function, the gravity then pulls him down again.

And as in real life, if there weren't any kind of ground below us, we would just keep on falling. In our group meeting on Monday, we were also introduced to the while-loops. I used this in the function that happens every frame, and used the hitTestPoint option to check if the character was hitting the ground I made. So whenever the character hit the ground, it was pushed up. With that while-loop and the gravity working together, the character could move around the ground without falling through.