Flappy Bird in 1000 lines of C
github.com
Flappy Bird in 1000 lines of C
1–10 of 59 posts
Re: Flappy Bird in 1000 lines of C
#2Re: Flappy Bird in 1000 lines of C
#3I was a bit disappointed though to see that this code used SDL for sprites and more stuff though. That’s not 1000 lines anymore imo. Still the code was an interesting read.
Thank you OP
Re: Flappy Bird in 1000 lines of C
#4It uses SDL. Not saying that's good or bad, but it's the first thing I wondered about.
Re: Flappy Bird in 1000 lines of C
#5I like these challenges, where people rebuild stuff low level and “line efficient” (not saying this is a good idea in general). This makes me curious and I can learn a lot from these examples. I was a bit disappointed though to see that this code used SDL for sprites and more stuff though. That’s not 1000 lines anymore imo. Still the code was an interesting read. Thank you OP
The only way arguably you could do it in pure C (with undefined behavior) is in enviroments that let you write straight to graphics framebuffers without any abstraction layer and even when you can't do keyboard or mouse input in C without library and/or kernel support.
Re: Flappy Bird in 1000 lines of C
#6It uses SDL. Not saying that's good or bad, but it's the first thing I wondered about.
Yeah, it still seems like a reasonable choice if you're going to write a simple game in C.
Re: Flappy Bird in 1000 lines of C
#7I like these challenges, where people rebuild stuff low level and “line efficient” (not saying this is a good idea in general). This makes me curious and I can learn a lot from these examples. I was a bit disappointed though to see that this code used SDL for sprites and more stuff though. That’s not 1000 lines anymore imo. Still the code was an interesting read. Thank you OP
It's impossible to do graphics in pure C, so what are the alternatives? Whatever you do at whatever level of abstraction/portability (SDL, OpenGL, Metal, Vulkan, Unity, ...), you're leveraging zillions of lines of other people's code. The only way arguably you could do it in pure C (with undefined behavior) is in enviroments that let you write straight to graphics framebuffers without any abstraction layer and even w…
Re: Flappy Bird in 1000 lines of C
#8I like these challenges, where people rebuild stuff low level and “line efficient” (not saying this is a good idea in general). This makes me curious and I can learn a lot from these examples. I was a bit disappointed though to see that this code used SDL for sprites and more stuff though. That’s not 1000 lines anymore imo. Still the code was an interesting read. Thank you OP
Discussed lately on HN: https://news.ycombinator.com/item?id=42010136
Re: Flappy Bird in 1000 lines of C
#9I like these challenges, where people rebuild stuff low level and “line efficient” (not saying this is a good idea in general). This makes me curious and I can learn a lot from these examples. I was a bit disappointed though to see that this code used SDL for sprites and more stuff though. That’s not 1000 lines anymore imo. Still the code was an interesting read. Thank you OP
It's impossible to do graphics in pure C, so what are the alternatives? Whatever you do at whatever level of abstraction/portability (SDL, OpenGL, Metal, Vulkan, Unity, ...), you're leveraging zillions of lines of other people's code. The only way arguably you could do it in pure C (with undefined behavior) is in enviroments that let you write straight to graphics framebuffers without any abstraction layer and even w…
Back in the days of DOS I used to do this all the time :)