c tutorials | Learn C Games Programming Blog (2024)

Tutorials

These are various game related tutorials in C, C++ and C#.

C Programming Tutorials

(Originally published on the now defunct on cplus.About.com)

This is a very rough guide to a learning C syllabus. It’s tailored to be practical and details steps, many of which correspond to C tutorials. I’ve also linked to the relevant tutorials and this provides a guide. If you are going to follow this you should work your way through the tutorials in order. As more tutorials are added, I’ll add the links in to the relevant bits which are shown in bold as place holders.

  • A quick overview. A look at computers, machine code, assembly language, editing, compilers, compiling and debugging.
  • How to install VS Code and Clang on Ubuntu and Raspberry Pi. Note you can also install VS Code on Windows. Many examples use the ideoone.com website. This is an online C compiler so you can use that to run code instead of compiling it.
  • Introduction to Hello World. The shortest easiest program of them all. Explains the different parts of a C program.
  • Introduction to variables. Explains how to hold data in memory. Mostly numbers but can also include text strings. It also explains how to declare variables. The different data types (int, float, char).
  • A look at enum variables. These are int variables where each value 0,1, etc represents something say like a colour.
  • A look at array variables. This is a collection of variables of the same type that are accessed by an index.
  • A look at struct variables. How to group different types of variables together. Variables can be different types but can also include arrays. You can have struct which includes arrays of structs as well as other types up to the limits of the compiler.
  • A look at functions. Functions are blocks of code that can be called. You can pass values in and get values back. They are an important part of C.
  • Simple control flow. (Not due till 23rd Dec) Use {} to build blocks of code and if or switch statements to control what happens.
  • Looping in C. C offers four ways to loops in this order of importance: For loops, while loops, do-while loops and the Goto statement,
  • All about operators in C. You can manipulate data in C using a variety of operators and control program flow.

At this point you have the simple fundamentals of C programming but still have to learn pointers, text strings and of course SDL.

  • A look at pointers. This is actually a simple concept once you get it. A pointer variable just holds the address of something. The complexity is understanding that the compiler needs to know how big that something is. People who have done assembly language programming usually have an easier time of it.
  • Pointers and c-strings. A string in C is actually a pointer to a block of characters terminated by a 0. There are a few gotchas though.
  • Pointers and linked lists. Other programming languages tend to have a bunch of advanced data structures like Queues and stacks. In C you often have to roll your own using pointers. A linked list is a structure made using pointers and usually structs.
  • Working with strings. Although I looked at them in the pointers and c-strings tutorial, this is a more in-depth look at working with them.
  • Allocating memory dynamically. Use of malloc/free.
  • What are function pointers? As well as pointers to data, you can have pointers to code, in particular pointers to functions. But the syntax is probably the most horrible part of C.
  • What are C compiler directives? Like #define and #include as well as others. Learn all about them.
  • How do I structure my C program? While you can have your program in one file, it often makes sense and shorter compile times to split it into multiple files. This needs careful attention as some bits can be included while others need to be declared as extern.

That’s mostly the C bit done but now comes the SDL library code. This is a media library that lets you use graphics and audio files in your program as well as exotic devices like joysticks and game pads. Most importantly it lets you write programs that can run at 60 frames per second or higher which is perfect for games.

  • How do I install SDL on Linux? It’s different between Windows and other platforms.
  • How to install SDL2 in Visual Studio.This of course is on Windows.
  • Getting started with SDL. Here’s a typical Hello World but in graphics. It explains some simple concepts like double buffering which is how your graphics are kept flicker free and smooth looking.
  • All about blitting. So you have a nice set of graphics? How do you get them in to your program and “blit” them quickly onto the screen.
  • How I play sound with SDL? How do you load audio files in and what are the different formats it can play?
  • How do I read keys or handle mouse moves in SDL? It’s not that difficult.

The last bit is about games development.

How do I structure a game in C with SDL? This explains the concept of a game loop and making things to do to make a game that runs smoothly at 60 frames per second.

Simple Game Tutorials

Atoms

c tutorials | Learn C Games Programming Blog (1)

  • Atoms aka Chain Reaction. A simple console game to introduce you to C programming.
  • Atoms. Tutorial one. Displaying the board, accepting player input.
  • Atoms Tutorial two. Doing computer moves
  • Atoms Tutorials three. Finishing off.

Onslaught (aka Slay for Linux) Tutorials

  • Tutorial one. How to implement Slay for Linux. Aka Onslaught.
  • Tutorial two. How to draw Map hexagons. Plus code to draw a bunch of hexagons on Linux.
  • Tutorial Three. Devise and code up a map generator.
  • Tutorial Four, Adding forts, trees and wild hexes.

c tutorials | Learn C Games Programming Blog (2)

(Visited 10,806 times, 1 visits today)

c tutorials | Learn C Games Programming Blog (2024)
Top Articles
Little Daisy Leaks
Fabelmans Movie Times
Qdoba Calorie Calc
Erste Schritte für deine Flipboard Magazine — Ein Blogger-Guide -
Phun.celeb
Chris Wragge Illness
Phil Maloof Net Worth
Palos Health My Chart
Kitchen Song Singer Violet Crossword
Childersburg Busted Mugshots
Erika Henriquez-Quallo
Comcast Business Sign In
How to track your Amazon order on your phone or desktop
Milwaukee Nickname Crossword Clue
My Fico Forums
Spirited Showtimes Near Gqt Kalamazoo 10
Animal Eye Clinic Huntersville Nc
Orlando Magic Account Manager
Fandango Movies And Shows
Review: 'Letters From Iwo Jima' a masterpiece - CNN.com
Starlight River Multiplayer
Uscis Fort Myers 3850 Colonial Blvd
25+ Irresistible PowerXL Air Fryer Recipes for Every Occasion! – ChefsBliss
8005607994
Ethos West Mifflin
Susan Dey Today: A Look At The Iconic Actress And Her Legacy
South Park Old Fashioned Gif
Small Party Hall Near Me
David Mayries
Phun.celeb
Nationsotc.com/Bcbsri
Deshaun Watson Stats, News and Video - QB | NFL.com
Dpsmypepsico
Www Spherionnetwork.com
Planet Zoo Obstructed
Sa 0 Spn 2659 Fmi 18
Madden 23 Browns Theme Team
Josh Bailey Lpsg
Www Texaslottery Com
Santa Cruz Craigslist Cars And Trucks - By Owner
Victor Predictions Today
How to paint a brick fireplace (the right way)
Www.craiglist.com San Antonio
How Old Is Ted Williams Fox News Contributor
Tamu Registration Worksheet
Craigslist Lasalle County Il
Bella Poarch Husband: A Deep Dive Into Her Relationship And Personal Life
Nike.kronos/Wfm/Login
Joy Ride 2023 Showtimes Near Mjr Chesterfield
ᐅ Autoverhuur Rotterdam | Topaanbiedingen
Wiley Rein Vault
Cpc 1190 Pill
Latest Posts
Article information

Author: Nathanael Baumbach

Last Updated:

Views: 5709

Rating: 4.4 / 5 (75 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Nathanael Baumbach

Birthday: 1998-12-02

Address: Apt. 829 751 Glover View, West Orlando, IN 22436

Phone: +901025288581

Job: Internal IT Coordinator

Hobby: Gunsmithing, Motor sports, Flying, Skiing, Hooping, Lego building, Ice skating

Introduction: My name is Nathanael Baumbach, I am a fantastic, nice, victorious, brave, healthy, cute, glorious person who loves writing and wants to share my knowledge and understanding with you.