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
Thalia Suffers From Insomnia
TB Test Near Me - TB Testing in Westminster, CO | Solv
Blorg Body Pillow
DEA closing 2 offices in China even as the agency struggles to stem flow of fentanyl chemicals
Www.metaquest/Device Code
Koordinaten w43/b14 mit Umrechner in alle Koordinatensysteme
Caroline Cps.powerschool.com
Jesse Mckinzie Auctioneer
Orlando Arrest and Public Records | Florida.StateRecords.org
Aces Fmc Charting
今月のSpotify Japanese Hip Hopベスト作品 -2024/08-|K.EG
8 Ways to Make a Friend Feel Special on Valentine's Day
Chicken Coop Havelock Nc
Craigslist Pets Athens Ohio
50 Shades Darker Movie 123Movies
Second Chance Maryland Lottery
2016 Hyundai Sonata Refrigerant Capacity
Who called you from +19192464227 (9192464227): 5 reviews
라이키 유출
Honda cb750 cbx z1 Kawasaki kz900 h2 kz 900 Harley Davidson BMW Indian - wanted - by dealer - sale - craigslist
Band Of Loyalty 5E
Welcome to GradeBook
97226 Zip Code
Busted Newspaper Fauquier County Va
Mc Donald's Bruck - Fast-Food-Restaurant
Noaa Duluth Mn
Jenna Ortega’s Height, Age, Net Worth & Biography
Where to eat: the 50 best restaurants in Freiburg im Breisgau
Craigs List Tallahassee
Gazette Obituary Colorado Springs
Walgreens 8 Mile Dequindre
Move Relearner Infinite Fusion
Craigslist Pasco Kennewick Richland Washington
Section 408 Allegiant Stadium
Delete Verizon Cloud
Darktide Terrifying Barrage
Ravens 24X7 Forum
Gideon Nicole Riddley Read Online Free
Craigslist Com Humboldt
9781644854013
T&Cs | Hollywood Bowl
How to Quickly Detect GI Stasis in Rabbits (and what to do about it) | The Bunny Lady
Arch Aplin Iii Felony
Unit 11 Homework 3 Area Of Composite Figures
Greatpeople.me Login Schedule
A jovem que batizou lei após ser sequestrada por 'amigo virtual'
552 Bus Schedule To Atlantic City
18 Seriously Good Camping Meals (healthy, easy, minimal prep! )
Urban Airship Acquires Accengage, Extending Its Worldwide Leadership With Unmatched Presence Across Europe
Pilot Travel Center Portersville Photos
Prologistix Ein Number
Read Love in Orbit - Chapter 2 - Page 974 | MangaBuddy
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.