Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

dos-like

Engine for making things with a MS-DOS feel, but for modern platforms · By Mattias Gustavsson

Minor changes to the circles example

A topic by Peter Hellberg created Oct 16, 2021 Views: 256 Replies: 1
Viewing posts 1 to 2
(1 edit)

The example shown at https://mattiasgustavsson.itch.io/dos-like doesn’t compile anymore, a few minor changes are needed.

Something like this:

#include <stdlib.h>
#include "dos.h"

int main(int argc, char* argv[])
{
  setvideomode(videomode_320x200);

  while(!shuttingdown())
  {
    waitvbl();

    for(int i = 0; i < 5; ++i)
    {
      setcolor(rand() % 256);
      line(rand() % 320, rand() % 200, rand() % 320, rand() % 200);
      setcolor(rand() % 256);
      fillcircle(rand() % 320, rand() % 200, rand() % 30);
      setcolor(rand() % 256);
      circle(rand() % 320, rand() % 200, rand() % 30);
    }

    if(keystate(KEY_ESCAPE)) break;
  }

  return 0;
}
Developer

Ah, yes, I changed the API to be more aligned with the old Borland BGI from the DOS days, but forgot to update that code. I've updated it now, thanks for reminding me :)