Game Programming Primer

Learn to program video games with this course covering DarkBASIC Pro. This is a course for beginners.
6 reviews
  • Jonathan Harbour Freelance Writer, Game Developer, Associate Professor

    Jonathan Harbour has been programming video games since the 1980s. He has written on subjects including Visual C++, Visual C#, Visual Basic, Java, XNA, DirectX, Allegro, Python, Lua, DarkBasic, multi-threading, game consoles, and game engines.

    His recent work includes XNA Game Studio 4.0 for Xbox 360 Developers, Multi-Threaded Game Engine Design, Visual C# Game Programming for Teens and More Python Programming for the Absolute Beginner.

    He is currently the lead writer on the Microsoft Technology Associate (MTA) certification exam 98-374, "Gaming Development Fundamentals." He has a Master's degree in Information Systems.

    Visit his forum at, and his Facebook Page at

  • Lifetime access to 36 lectures
  • 16+ hours of high quality content
  • A community of 700+ students learning together!

Game Programming Primer

Learn to program video games with this course covering DarkBASIC Pro. This is a course for beginners.
6 reviews


Discover courses made by experts from around the world.

Take your courses with you and learn anytime, anywhere.

Learn and practice real-world skills and achieve your goals.


Learn Game Programming!

This course teaches a complete beginner how to make a video game using the BASIC programming language with a free compiler called DarkBASIC Pro. A video lecture shows how to get started with this easy-to-use programming tool, while lecture presentations cover more in-depth instruction on the language and features of DarkBASIC Pro. Several simple games are created in the lessons following the video tutorial.

For additional information about this instructor's work, click the instructor name or visit his web site at

    • Basic programming knowledge of at least one language preferred (but not rqeuired).
    • Over 36 lectures and 16.5 hours of content!
    • Understand the basics of programming, including variables, subroutines, and logic.
    • Understand how to load and draw images and perform animation.
    • Understand how to get user input from common input devices.
    • Understand how to load and play audio files to enhance a video game.
    • Anyone who is interested in video game programming who has at least some basic knowledge of programming.


30 day money back guarantee
Lifetime access
Available on Desktop, iOs and Android
Certificate of completion


  • SECTION 1:
  • 1
    Welcome to the Game Programming Primer
    Get Ready! This "primer" course teaches the absolute basics needed to write a video game using the BASIC language. In this course, we will be focusing on DarkBasic Pro . This game programming compiler is FREE to download. As the author of quite a few books on game development, I wanted to share some…
  • 2
    The lessons are online now. Presently, there are 20 lessons from material in the book and a course I taught on this for several years at a university. There are also a half-dozen TUTORIALS in PowerPoint format that cover high-level game programming concepts, such as user input, A.I., collision detec…
  • SECTION 2:
    Dark Basic Pro Video Tutorials
  • 3
    Introduction to DarkBasic Pro
    Welcome to the DarkBasic lessons! You will learn how to make a game using DarkBasic Pro. This program is now available for free from the kind people at The Game Creators. You may download DarkBasic Pro FREE EDITION from . If you need help installing DarkBasic Pro, there is a…
  • 4
    Getting Started with DarkBasic Pro

    The first game programming tool we will learn to use is DarkBasic Pro, by The Game Creators ( You can download DarkBasic Pro for free from their web site and use it for this course.

  • 5
    Writing Your Own Pong Game Using DarkBasic Pro

    This lesson shows step by step how to create your own Pong game using DarkBasic Pro. The language is based on the original BASIC, but with custom statements and functions specifically designed for making games. We will learn to use graphics and input to make a playable Pong game in this single lecture.

  • SECTION 3:
    Dark Basic Pro Game Tutorials
  • 6
    ASSET FILES You will need these game assets for the tutorials featured in this section of the course. Download the ZIP file for each tutorial and extract the files from the ZIP onto your system. Then copy the files into your project folder (where you save the .DBPRO project file). Bouncing Balls Tut…
  • 7
    14 slides

    This very short tutorial shows how to make a demo that loads a background image and several animations, and draws animated balls moving on the screen, colliding with each other, and bounding off the edges of the screen. This is a good and quick introduction to sprite animation in DarkBasic Pro.

    See the Lecture 1 page for a link to the assets required by this tutorial.

    Here is a screen of the finished program that you will create in this tutorial:


  • 8
    44 slides

    This tutorial teaches step by step how to create a complete Breakout-style game (also known as a "ball-and-paddle game"). This is quite a bit more complicated than the Pong or Bouncing Balls tutorials, so fasten your programming seatbelt and get ready to go!

    NOTE: Some of the screens of source code are difficult to read in the default small window. Recommend going fullscreen for this tutorial! See the small box icon at the lower right corner of the lecture window.


  • 9
    71 slides

    This tutorial is a high-concept lesson that teaches how to program the logic and user interface for a Tic-Tac-Toe game from scratch. The game assets are provided for download on the first ASSETS page. Students are encouraged to study the lessons on sprite programming and user input programming before attempting this game tutorial.


  • 10
    60 slides

    This is a complete game tutorial that teaches step by step how to create your own version of the classic arcade game, Space Invaders! Be sure to download the "Assets" for this game project from the Tutorial Assets page.

  • 11
    Advanced Tutorial: Level Editing with Mappy
    65 slides

    This is an advanced tutorial provided as bonus content for the student who is interested in programming scrolling arcade games, such as top-down scrolling shoot-em-ups or side-scrolling platformer games. This lecture/tutorial corresponds with chapter 15: 2D Game Worlds: Level Editing and Tile-Based Scrolling. You may download the resource files for the book at to obtain the projects and assets for this tutorial lesson.

  • SECTION 4:
    Dark Basic Pro Lessons
  • 12
    Course Intro
    50 slides

    This lesson explains what you will learn in the course and a bit about the game development software we're using.

  • 13
    Introduction To Programming
    46 slides

    This lesson explains some of the background behind game development, how programming languages work, and how DarkBasic fits in. It is good background material for a complete beginner to the subject.

  • 14
    70 slides

    This lesson explains the important subject of variables in DarkBasic, including advanced user-defined types and how to use them effectively.

  • 15
    Conditions Functions Looping
    27 slides

    This lesson shows how to write DarkBasic code that can think--that is, make decisions. Functions are an important way to break up a large program into smaller parts. Looping is how we can repeat a task many times very quickly.

  • 16
    32 slides

    This lesson explains how you can create data in a BASIC program and then read it using arrays. This is an important concept in game programming with BASIC, since we can create game levels this way! At the end of this lesson, you will write a graphics demo that draws and moves shapes on the screen.

  • 17
    File input output
    23 slides

    This lesson explains the file input/output commands in DarkBasic. You will learn how to read and write text and numeric data from files, and how to use this new skill to make a script-like settings file that affects how a game starts up (for instance, by defining the screen resolution and program title). This is the first step to understanding script programming and is very useful.

  • 18
    Number Crunching: Math and Relational Commands
    41 slides

    This lesson teaches the math and relational (logic) commands in DarkBasic, introducing some very important new concepts such as linear velocity (causing game objects to move in a specific direction) and random number generation (for rolling RPG character stats, among other things).

  • 19
    Vector Graphics
    19 slides

    This is the first lesson on graphics programming with DarkBasic. Up to this point, you have been learning the important features of the language in order to be able to make games. You need to know the language first, so you can confidently work on game logic. Now, you're on the right track, and we begin digging into graphics! In the next few lessons, you will learn about bitmaps, sprites, and animation. So, you're on the right track, keep at it!

  • 20
    Bitmaps and Images
    26 slides

    This is a quick, short introduction to bitmaps and images--how to load and draw them in DarkBasic. You will use this information in the next few lessons on 2D game programming with sprites.

  • 21
    Input Devices: Keyboard, Mouse, and Joystick
    64 slides

    This lesson explains all of the DarkBasic commands for working with keyboards, mice, and joystick controllers.

  • 22
    Game Loop and Timing
    26 slides

    This lesson covers looping statements in DarkBasic, such as While and Do statements, used to create a real-time game loop. Timing is a related subject, affecting the frame rate of a game.

  • 23
    Sprite Programming
    29 slides

    This is the first lesson on sprite programming, which involves drawing, moving, and animating 2D bitmap-based game objects, the core of 2D games.

  • 24
    Sprite Animation
    29 slides

    This lesson continues our study of sprite programming in DarkBasic Pro by exploring the exciting subject of animation!

  • 25
    Sprite Collision Detection
    16 slides

    The third lesson on sprite programming covers the "gameplay" aspect involving sprite collisions. Detecting when two sprites "hit" each other allows us to make interactive games where objects affect each other, such as a laser beam hitting an alien space ship.

  • 26
    Sound Effects and Music
    47 slides

    This lesson explains the audio features supported by DarkBasic Pro, including the loading and playing of wav and mp3 files for sound effects and music and 3D positional sound commands.

  • 27
    Game State
    24 slides

    This lesson talks about the subject of finite state machine programming, a topic related to artificial intelligence, and how it is used to improve games.

  • 28
    3D Graphics Concepts
    38 slides

    This lesson is an introduction to 3D graphics concepts, the fundamentals of 3D with DarkBasic Pro. You will learn all about vertices, triangles, quads, video cards, GPUs, and rendering, from a high-level perspective.

  • 29
    3D Lights and Cameras
    42 slides

    This lesson explores more of the basic 3D concepts, explaining how light sources and cameras affect the view of a scene. The lights covered are from the older fixed pipeline, not shader-based lighting, so the concepts will be fairly easy to learn.

  • 30
    Loading and Rendering Animated 3D Models
    11 slides

    This rather short lesson goes over the commands used to load, animate, and draw a 3D animated mesh file, with support for the common file formats .X and .3DS. This lesson does not go into too much depth since the subject is quite complex and this is a beginner's course. But this will give you a good head start and enough to start working on your own 3D demos. In the next lesson, you will learn to move and interact with 3D objects, so this lesson is a good precursor for the next one.

  • 31
    3D Transforms
    34 slides

    In this final lesson on 3D graphics, you will learn how to move and rotate 3D objects in the scene and manipulate the camera.

  • SECTION 5:
    Dark Basic Robots
  • 32
    Introduction to DBRobots (Dark Basic Robots)
    Dark Basic Robots is a fun project that simulates a robot battle with 4 different robots at a time, reminiscent of the old CROBOTS simulation. (You can read about CROBOTS here; it is still quite popular today). This is not a LESSON, nor is it a TUTORIAL; this is merely a bonus chapter, purely for fu…
  • 33
    Sample Robot Program
    Here is a sample robot program for DBRobots. The robot code is not long or complicated at all, thanks to the Bot API. function Update1()     SetBotName("FLIP FLOP")     SetBotIntroQuote("I am the best!")     SetBotAttackQuote("Take that!")     SetBotDamageQuote("Ouch!")     BotLoadSprite("tank2.bmp"…
  • 34
    DBRobots Rev 1 Video

    Here is the original first version of DBRobots after just a few days of programming work on it. Compared to the later revisions, you can see how far it improved. However, I do somewhat like the visual radar/scanner in this old version.

  • 35
    DBRobots Rev 2 Video

    This was the 2nd revision to the DBRobots simulation with additional features.

  • 36
    DBRobots Rev 3 Video

    This is the final working version of DBRobots. This video shows one mobile tank against three fixed turrets.


Hours of video content
Course Enrollments


  • 6
  • 0
  • 0
  • 0
  • 0


  • Refik Hatipoğlu

    excellent for begginer programmers thank you soo much

  • Prof Matthew Versaggi
    Excellent intro to DarkBasic and a good primer for the AGK product ... over all an excellent intro product. Highly recommended!

    I've nearly completed a complex game in AGK and have started with DarkBasic. I took this course before as an intro and then again later as a refresher and it's excellent for both, I'd highly recommend it!

  • 30 day money back guarantee!
  • Lifetime Access. No Limits!
  • Mobile Accessibility