Project ITV

Project ITV

Thursday, October 18, 2012

Week 6 of Introvert

18 October 2012

I have been working on a few things recently. Some of the new features I have added into the game are really exciting!

Decorations
Decorations seemed like a really fun thing to do at first. I created a file with all my separate, individual decorations. And then I open another file with screenshots of my levels, and slowly copy and paste the decorations there.

Now, it seems like a simple job, but then it actually needs quite some work. I need to use adjust and place each decoration of a level properly - to make sure they aren't floating above the ground, and to make sure they are attached properly. I have two layers of decorations - a foreground layer that covers the player, and a background layer that purely decorates the level.

Decorations was a matter of slowly placing the right things properly, at the right place. But other than that, I realised that I had to draw rocks too. Apart from placing decorations on platforms, there are LOTS of empty spaces INSIDE the platforms. The tiles themselves are pretty plain. I had to draw the rocks inside them to make sure the tiles looked good as well. I couldn't really get any inspiration for rocks, so I had to make do with what I could do.

I did this for a few levels, and very soon, I realised I needed more than a few days to finish up the decorations. Why? Because I had lots of levels. And I would have to decorate each level...one, by one, with each level containing three layers of decorations - the foreground deco, the background deco, and the rocks.

Oh man...this is the time when I seriously really want to ask some people for help.

I managed to decorate 20 levels in two days, including redrawing plenty of new decorations that really add value to the visuals on the levels. I really like the decorations.

Also, the tiles have been touched up slightly to remove unsightly areas.

New Feature: Speech Bubbles!
This is something I added today. I had been thinking about the logic behind this before I did it, so it was pretty simple and straightforward to do. The speechbubble looks like a single image, but it actually is made up of four sprites. I could use a single sprite, but I would not be able to change the length of my bubble smoothly. I can stretch it, but that would distort the edges, and it would look ugly. That was the first problem I had to tackle.

The speech bubble can have varying width. Thanks to Flixel's scale.x which I used for the center sprite, I can change the length of the speech bubble to anything I want. I just needed to calculate the coordinates of the origin of the speech bubble, and base the other sprites' coordinates off the origin.

The bottom sprite was quite tricky to do, because if the player were to go to the sides of the screen, the speech bubble has to stay within the screen, and the speech bubble has to look sensible. I made the fourth sprite detached from the speech bubble and made sure it was kept at a minimum of 2 pixels' length away from the player's head in either direction. If it got too close, it would flip and the coordinates would be recalculated to be on the other side.

After doing that, I found it really fun to play with the speech bubble and watching the triangle slide from left to right.

I also created a very simple function to make my life easier. In my design, I needed the speech bubbles to simulate a conversation. If I specified the speech bubble to hold more than one text, text on the bubble would change after a period of time, in the correct sequence I want it to be, and would disappear when the last text is shown. I also want to be able to control the duration of each text shown. I don't know if there is a better way to code it since I'm still quite new to this, but this was how I did it. I have a function called "addText".


public function addText(_text: String, _duration: int): void
{
textGroup.push(_text);
durationGroup.push(_duration);
}


In my speech bubble class, I had two arrays:


public var textGroup: Array;
public var durationGroup: Array;

They keep track of the text and their respective duration on which they stay in the speech bubble. Once the text is shown long enough, I access the next index and this goes on until all the text is shown, after which I close the speech bubble.


In my update, I put:

                         if (timer.finished)
{
if (textGroup[i] != null && durationGroup[i] != null)
{
text.text = textGroup[i];  //the text to display
timer.start(durationGroup[i]);  //the duration the text is displayed
i++;
}
else
{
disappear();
}
}


I tested the speech bubbles and it works perfectly! I'm really glad I managed to get this feature done pretty quickly (within one day for a working speech bubble with customizable length is very satisfactory to me). I had some really scary thoughts of problems with this feature, but it went smoother than I expected.

UI Additions
I added two new buttons to the UI.
1 button toggles special lighting - simulate sun going behind clouds and darkens level at intervals
1 button restarts the level, as an alternative to pressing "R" on the keyboard.

New Maps
I created three new maps which I called bonus levels, which are actually extensions of the level selection lobby branching out. I love the decorations on one of the bonus levels. I spent many MANY hours doing the decorations for that level, which is actually just a level which players walk past. Not exactly the best thing to spend time on, but at least I had fun drawing.

Level Design
I took a look at one of my levels that was flawed by player feedback. The levels that introduce the new Door mechanism to players was vague.

I also dug through my papers and level sketches and started to plan the sequence of levels. I also created drew out the sketches of new level ideas I had when I was in my bed. I can't wait to implement them once I am done fixing all current issues in my never-ending to-do list.

Sound Effects
I also started sourcing for sound effects needed for the game. I found sounds for jumping, collecting friend, door opening and closing, button presses, enemy growling and achievement unlocking sounds.

I only managed to implement a few sounds in the game, and I realise some sounds don't really fit, so I have to do some editing or find other sounds.

What a busy holiday!



No comments:

Post a Comment