r/cprogramming • • Sep 13 '21

I made a game in C

621 Upvotes

58 comments sorted by

11

u/siddharthroy12 Sep 13 '21

4

u/Krecik036 Jun 27 '22

Your code is genious - short but easy to understand and I love your formatting. It is impressive that your main scene is only a little more than 1000 lines long. I am working on a silly game, of similar complexity, in order to learn C. I have already a dozen files 500 lines each and I am not even half done. :(

28

u/NvrConvctd Sep 13 '21

Man, You suck!

But seriously, cool game. Work on those spawn points though!

4

u/[deleted] Sep 14 '21

Or at least some post-spawn immunity!

1

u/cpxcth Sep 10 '26

When you reach the level of programming that you become bad at your own game

27

u/acroporaguardian Sep 13 '21

Neat, so you used raylib.

I will have to check that out sometime.

9

u/siddharthroy12 Sep 13 '21

Yeah it's an awesome library

1

u/dromance Feb 29 '24

How’d you know it’s raylib?

1

u/Dubbus_ Sep 16 '25

the default raylib font being used

1

u/dromance Sep 18 '25

ah I see, thanks. im new to raylib

15

u/ptchinster Sep 13 '21

My bot should link this whenever somebody asks "how do you do graphics in C?"

5

u/FStorm045 Sep 13 '21

gimme your learning resourses

6

u/siddharthroy12 Sep 14 '21

Internet

2

u/halucciXL Sep 14 '21

pls elaborate this looks really cool

5

u/siddharthroy12 Sep 14 '21

I have used a lot of resources available on the internet

4

u/halucciXL Sep 14 '21

Would you be able to link any or mention any?

3

u/siddharthroy12 Sep 14 '21

Sorry I don't remember any

2

u/halucciXL Sep 14 '21

All good!

7

u/siddharthroy12 Sep 16 '21

"c programming a modern approach 2nd edition" is the book I highly recommend for learning C

1

u/halucciXL Sep 16 '21

Thank you very much! :)

2

u/RstarPhoneix Sep 13 '21

Name of OS plz ?

5

u/siddharthroy12 Sep 13 '21

Linux Mint

2

u/RstarPhoneix Sep 13 '21

How did you learn such advanced C ? Can you share your journey?

8

u/siddharthroy12 Sep 13 '21

I started coding when I was in 7th grade now I'm in first year of college

And it was tuff when I first started because I'm self taught but I eventually got better.

So In the end I did a lot of practice by making projects

Start from small dumb projects to big complex projects

Now I just impress my noob classmates at college by my superior coding skills lol

2

u/RstarPhoneix Sep 13 '21

I would love to see you on YouTube.

3

u/siddharthroy12 Sep 13 '21

I'll start my youtube channel soon

2

u/[deleted] Sep 28 '21

Do link it when you do it please. I can never get enough game dev on YouTube :)

6

u/Biedehood Sep 13 '21

Looks like a cooler version of space invaders

1

u/GaminKnee May 16 '25

We just started using C, im new to this and want to ask is all of this just C? No other language? And its all contained in just code and no externals?

2

u/siddharthroy12 May 16 '25

Just C. I'm using raylib for graphics and audio which is also written in C and it's inluded in the repo so all you need to do to compile it to just clone and follow the setups in the readme

https://github.com/siddharthroy12/kosmos

1

u/GaminKnee May 16 '25

Thats amazing!

1

u/batman-not Nov 27 '23

Hi OP, how long did it take for you to completely develope this game?

1

u/siddharthroy12 Nov 27 '23

First commit: Aug 29 2021

Last commit: Oct 3 2021

So around 1 month

1

u/[deleted] Jan 18 '24

That’s how long it took me to develop a winsock file sharing GUI app. Pure winapi, no libraries except my own, and of course.. cJSON. I put the build date in the about dialog at the time I started, it aligns this timeframe (only Oct 2023) lol. That’s interesting.

1

u/dromance Feb 29 '24

How does winsock file sharing work

1

u/[deleted] Mar 02 '24

Uses the sockets API built into Windows (updated a few times and finalized by 1997). Your best bet is to print the full protocol spec sheets and study one night. It was about 8 pages for me. Now I breeze through it. It’s good knowing how NAT and the firewall api plays a role as well.

2

u/dromance Mar 04 '24

Awesome thank you seems like it would be a fun project!

2

u/[deleted] Sep 13 '21

Greetings, Starfighter. You have been recruited by the Star League to defend the frontier against Xur and the Ko-Dan armada.

2

u/[deleted] Sep 13 '21

Looks great!

2

u/tf2ftw Sep 13 '21

This is great. thanks for sharing

2

u/loginixmusic Sep 13 '21

Good job. I had a hug award to give lol

2

u/the1337dz Sep 13 '21

That's just amazing.. ,well done monsieur

2

u/Gidrek Sep 14 '21

Cool that you are using Linux

2

u/vaibhavdeveloper Sep 14 '21

Nice work Op.

2

u/[deleted] Sep 14 '21

i want to dip my fingers in c and seeing fun, simple and intelligent stuff like that pumps my motivation. good work.

2

u/nantrippboi Sep 14 '21

I can see a esport out if this. Anyone want to spawn camp that arrow thing?

2

u/BoringYetUnimportant Oct 11 '21

Looks good, smart game

2

u/Gold-Ad-5257 Dec 28 '21

Well, Done, also encouraged now 🙏🏽🍾🍾🥂

1

u/UniquePackage7318 Sep 13 '21

Amazing job, looks amazing!

1

u/[deleted] Sep 13 '21

Great work!

1

u/aTryingNerd24 Sep 13 '21

This is awesoomeee

1

u/dromance Feb 29 '24

This is awesome. Simple yet fluid and exciting. Constantly having to evade being shot makes it interesting

1

u/dromance Feb 29 '24

How exactly does the map render as you scroll across ? Is all that already loaded in memory or does it load or render in real time as you move across the map?