Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

2D game development basics

Tags:

c

2d-games

I would like to write some simple Mario-like game from scratch using language C. But honestly I have no idea how to do so, and I can´t find any good tutorial for this, which is for free.

But to the actuall question, I have only written WinAPI programs so far, so all event handling and user input was handled by OS, with minimum work, But to develope game, with for example menus with non-rectangular buttons, animations, and so, I guess, there is no such thing in WinAPI taht could help me with this more than just some basic routines mouse pointer location and keypresses.

So, is the right way to write your game to write entire draw part of game engine by manipulating objects for player, enemies, and even background yourself, and than just use directdraw for output to screen?

EDIT: I actually want to learn how to write games from scratch, becouse it must be great programming experience, and if you consider games like Commander Keen on DOS, created with no framework or libraries, but still so great.

like image 576
B.Gen.Jack.O.Neill Avatar asked Dec 03 '22 05:12

B.Gen.Jack.O.Neill


1 Answers

A good approach to this would be to have a look at the SDL library. I'm not saying it's necessarily the best library for 2D games, but it's easy to get started with and the web is flooded with tutorials and open source code samples for simple homebrew 2D games written using SDL.

like image 164
kasperjj Avatar answered Dec 24 '22 11:12

kasperjj