Creating a NPC in programming Part 2

Hi ,

today i want to talk about how i had implemented our second character , the president, in our game ,planet suburbia.First off i am going to give you some information about him without spoiling our story for you.Skärmklipp.JPG

Ronald Bronson Gump Jr.

President of Earth

The president will appear in the end of the game, to

give the player his/her final scoring.

That is our main function for our President right now.

Just i like i had to do it last week , i have to do it this week again. I have to implement the character and this time i knew exactly how i could do it. But instead for creating a new class for the president i created the President in the Victory State. The president is going to fade in as soon as the player wins the game. There we will have like a chatbar where the president will comment you’re game play and you will see if you made it to the High score or not. As soon you have written you name inside of the High Score, he will then fade out and the player will be back in the Main Menu.

So this time i used again lerp which stands for Linear interpolation. What is it doing ? This function  is used for alpha blending . Alpha blending is the process of combining a translucent foreground color with a background color, thereby producing a new blended color. The degree of the foreground color’s translucency may range from completely transparent to completely opaque. If the foreground color is completely transparent, the blended color will be the background color. Conversely, if it is completely opaque, the blended color will be the foreground color. Of course, the translucency can range between these extremes, in which case the blended color is computed as a weighted average of the foreground and background colors. That means i use that for moving an object in front of our back round so it can fade in and fade out without a problem.

And yes our President is also going to have a voice we are planing to make give him and all characters a voice in the game. We are getting closer to our beta phase but i think we will make it time. As i used to say before we are working on an narrative driven game which will be also fun to play.Have a nice evening,

Gabriel Stoffel

About Gabriel Stoffel

2015 Programming