Background Stuff

That’s me done A LOT more to my game framework. I’ve completely redone the Level-Editor (making it a lot easier to use), redone the background’s for Mario-style layer background scrolling, and added audio, both effects and background music.

The Level-Editor has been updates so that objects are placed from the sidebar. This means that the user can simply select the object, and place it. Once selected, an object is placed with the Left-Mouse button and deleted with the Right-Mouse button. The screen can be scrolled left and right. There’s also a maximum and minimum cap on object limits. Blocks have a minimum number of zero and a max of 2000 (more than enough for one level), while the player has a maximum and minimum of one (meaning two players cannot be placed, and the player cannot be deleted). Here’s a picture of the Level-Editor in action!

Untitled

 

Next, I’ve been working on the background. I changed the space-theme to mountains, so I could have a layered scrolling background. The background is actually made up of four layers (including a foreground) – the Sky, clouds, mountains and trees. Each layer moves at a different speed, creating a nice feeling of depth. In addition, with the new background graphics, done by Lauren Martin (view her Tumblr here), the game actually feels a lot more professional.

Untitled

 

For the last part, I’ve added audio into the game. Using SFML, I’ve created a Sound Manager class, which handles all audio within the game. There are two types of audio, Sound Effects and Music. Sound Effects are stored in a Buffer and can be played at any time. I’m going to limit the number of sounds that can be played to around a dozen or so, though I doubt I’ll even have this much! Music is slightly different. Instead, a file location is found, and then streamed from the location while the game’s running. This helps with performance, since loading a huge music file into a Buffer would really affect the performance of my game (something I’ve been working hard to keep at its best so it can run on my low-spec laptop).

As well as this, I’ve also updated my User Input class so it can detect whether a key is pressed or not based on a string. An example would be: if ( UserInput->keyboard( “a” ) == true ) . What I’ve done with this is changed the controls so they’re loaded in from a .txt file. I’ve also added mouse support, so players can choose whether they use keyboard or mouse to move.

At one point, I updated the WinMain() function so that my window was resizable, but the graphics looked horrible scaled to I got rid of this. In the future, I might update this so that the graphics scale properly in the x and y-axis, with a black background around the dead-space, however this isn’t very high on my priorities list.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s