Original Post
Does anyone know any good tutorials about making ascii games? I want to make an ascii game with color and all that stuff. I'm using C++. Thanks.

Quote:
Original post by Extrarius
You don't even need to do 'dirty rectangles' to prevent flickering, just store a single buffer in memory and use WriteConsoleOutput when you're done updating the buffer (aka basic double buffering).
Quote:I've been programming in C++ for a while now and have been learning DirectX. I just wanted to go back and learn how to make ascii games.
Original post by Theveninbtw... why are you using C++ as your beginner language? Your chances of succeeding are now virtually nil.
Quote:This flickers in windowed mode. In full-screen, it's flicker free though.
Original post by Extrarius
You don't even need to do 'dirty rectangles' to prevent flickering, just store a single buffer in memory and use WriteConsoleOutput when you're done updating the buffer (aka basic double buffering).
Quote:
Original post by capn_midnight
Actually, most people from the contest did not emulate the console window in a graphics API, most of them used the Win32 console API. Benryves provides a tutorial on using the Win32 console API on his website, to which there is a link in the pages of the contest thread. If you implement a custom double buffering system that only changes dirty characters, then you can elliminate the flickering, even with the .NET 2.0 console API (which is not exactly as complete as the Win32 API).
After that, the only problem then with the .NET 2.0 console API is the slow framerate. This isn't really a concern, though, as most ASCII games don't run that fast anyway.

using System;using System.Collections.Generic;using System.Text;using System.Media;using System.Drawing;using System.Windows.Forms;public partial class cMain{ public ConsoleColor MyLastColor; int x = 0; /* No touch. */ static void Main(string[] args) { cMain TheGame = new cMain(); TheGame.sLoad(); } /* Load procedure; also main game loop. */ public void sLoad() { /* Configure the console window. */ Console.WindowWidth = 80; Console.WindowHeight = 50; Console.Title = "Performance Testing.Net Console Class (Thevenin) [C#]"; /* Game loop. */ int TheCurrentTickCount = Environment.TickCount; int TheLastTickCount; int TheLoop = 0; while(TheLoop != 30) { for (int TheX = 0; TheX < 80; TheX++) for (int TheY = 0; TheY < 50; TheY++) { sRandomColor(); Console.BackgroundColor = MyLastColor; Console.Write(" "); } Console.SetCursorPosition(0, 0); TheLoop++; } TheLastTickCount = Environment.TickCount; Console.Title += "(Avg Period: " + (TheLastTickCount - TheCurrentTickCount)/30 + "ms )"; Console.ReadLine(); } public void sRandomColor() { switch (x) { case 0: MyLastColor = ConsoleColor.Blue; break; case 1: MyLastColor = ConsoleColor.Red; break; case 2: MyLastColor = ConsoleColor.Green; break; case 3: MyLastColor = ConsoleColor.DarkBlue; break; case 4: MyLastColor = ConsoleColor.DarkGray; break; case 5: x = -1; break; } x++; }}Quote:Not for me. Things blur together since my implementation never got far enough to be time-based, but there was no flicker.
Original post by benryves Quote:This flickers in windowed mode. In full-screen, it's flicker free though.
Original post by Extrarius
You don't even need to do 'dirty rectangles' to prevent flickering, just store a single buffer in memory and use WriteConsoleOutput when you're done updating the buffer (aka basic double buffering).
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more