Tetris (continued) v1.01 in the C Console

Source: Internet
Author: User
Tags random seed

Bug fixes
1. The biggest bug is that when the square falls, it will fill up the hollow lattice and modify it.
2. When "square" is rotated, it should not have any effect. The previous version will change the position.
3. The previous version of the long bar is difficult to rotate. This time it looks a little better.
4. modified the display problem of Life and Speed.

 

New Feature
1. Added background music and sound effects.
2. A Random Seed has been added for comments from netizens. Each time a random seed is opened, a different start will be made.

 

Background Music is the background music of a scene in the smart crown single-host game <tianlong Babu>.
We miss our childhood standalone game era.


Thanks to the comments from many netizens, your support is our greatest motivation.


One of the following methods is to add background music to the game and share the following information. If sndPlaySound is used directly, it cannot achieve sound mixing. You can use the following method to play background music, then, you can use sndPlaySound to play the audio effect.


Void BeginMusic (){
CoInitialize (NULL );
}

Class mp3Player {

IGraphBuilder * pGBuilder;
IMediaControl * pMControl;
IMediaPosition * pMPos;

Public:
Void load (char * filename );
Void play ();

};

Void mp3Player: load (char * filename ){
CoCreateInstance (CLSID_FilterGraph, NULL, CLSCTX_INPROC, IID_IGraphBuilder, (void **) & pGBuilder );
PGBuilder-> QueryInterface (IID_IMediaControl, (void **) & pMControl );
PGBuilder-> QueryInterface (IID_IMediaPosition, (void **) & pMPos );

Char strSoundPath [MAX_PATH];
WCHAR wstrSoundPath [MAX_PATH];

GetCurrentDirectory (MAX_PATH, strSoundPath );
Strcat (strSoundPath ,"\");
Strcat (strSoundPath, filename );
MultiByteToWideChar (CP_ACP, 0, strSoundPath,-1, wstrSoundPath, MAX_PATH );

PGBuilder-> RenderFile (wstrSoundPath, NULL );
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.