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

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

2006-08-04 06:22:21, Category: Programming & Design
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.

Answers

  1. india_kakinada

    On 2006-08-04 07:17:26


    Example: ≡ File Edit Search Run Compile Debug Project Options Window Help ╔═[■]════════════════════════════════ Help ══════════════════════════════3═[↕]═╗ ║ /* loop through the available colors */ ▲ ║ for (color=1; color<=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; ▒ ║ } ▒ ║ ▒ ║ ▼