Tuesday, July 14, 2009

How to add colour and sound effects for c++ win32 console program?

I'm a beginner to c++ programmer and am doind a samaal assignment. I need to add effects to the program e.g. colour font and different coloured backgrounds. Any help or advice given would be very appreciated.

How to add colour and sound effects for c++ win32 console program?
Example:





≡ File Edit Search Run Compile Debug Project Options Window Help


╔═[■]════════════════════════════════ Help ══════════════════════════════3═[↕]═╗


║ /* loop through the available colors */ ▲


║ for (color=1; color%26lt;=maxcolor; color++) ▒


║ { ▒


║ /* clear the screen */ ▒


║ cleardevice(); ▒


║ ▒


║ /* select a new background color */ ▒


║ setcolor(color); ▒


║ ▒


║ /* output a messsage */ ▒


║ sprintf(msg, "Color: %d", color); ▒


║ outtextxy(x, y, msg); ▒


║ getch(); ▒


║ } ■


║ ▒


║ /* clean up */ ▒


║ closegraph(); ▒


║ return 0; ▒


║ } ▒


║ ▒


║ ▼


No comments:

Post a Comment