I have to write Tower Defense game in ANSI C using SDL library, but the deeper I go into LazyFoo's tutorial, the more I got this feeling that's impossible to write it in pure C due to limitations. So my questions is - am I in big trouble or I'm just panicking. It has to be a simple tower defense game, nothing fancy, but is it possible to do it using only C?
Asked
Active
Viewed 812 times
-4
-
What are these limitations you speak of? – Mark Dec 25 '12 at 15:12
-
1If in doubt, you can embed assembly code in C. So any compiled code written in any language can be embedded as assembly code into C code. Granted, that's probably not practical... – Daniel Dec 25 '12 at 15:13
-
The original Rollercoaster Tycoon was written in 99% assembly language! (Count yourself lucky!) – Mapsy Jul 21 '16 at 03:28
1 Answers
8
C is a Turing-complete language so anything you can do in some other language can be done in C, too. And SDL provides you with a graphics API which is commonly used for (usually small/indie) games.
Of course it might be more pleasant to write it e.g. in C++ or a higher-level language such as C# or Python - but it's possible in C nonetheless.
TL;DR: Yes, it is totally possible.

ThiefMaster
- 310,957
- 84
- 592
- 636
-
I know using C++ or C# would be so much easier, but unfortunately I have to do it in C and only C. Anyhow, I'd better get to it. – Deith Dec 25 '12 at 15:16
-
Nope. That's why I added the sentence about having a graphics API available later. – ThiefMaster Dec 25 '12 at 15:18
-
-
@H2CO3 good luck with that. I'd be the first to congratulate you if I'm wrong :) – Oren Dec 25 '12 at 15:35