Space Invaders was something I wrote in BASIC as a side project while in high school. Then with each new language I needed to learn, I wrote Space Invaders in that language to get me up to speed quickly.
BBC basic, had an acorn electron at home with nearly the same BASIC installed so I could work on it outside of school but getting the timings right for both machines was hard.
Ended up with two versions selected at runtime.
Me and my best pal at school both wrote versions when we weren’t collaborating on tools to hack the Econet system!
Heh - I remember doing this in ascii-art on an Osbourne CP/M machine, first in Basic and later in Z80 assembler. I used the wiring diagram in the owner manual (!!!) to work out how to make a joystick I could plug into the parallel port. I was maybe 13 at the time...
I implemented Space Invaders from scratch, but in a roundabout way... By writing a well documented 8080a emulator that can play dumps of the arcade roms: https://github.com/anoakie/siemu
This brings back some fond memories. I once made a 3D OpenGL clone of space invaders for a graphics course (Windows only). It made a bunch of changes and was actually playable and reasonably challenging...don't know if it even works today
A little bit off topic, but what are the best libraries for drawing simple graphics like this? I've been looking into making a small graphics project and I'm not sure which is the best to use. It only needs to draw basic shapes like ellipses, or rectangles, or just specific pixels. I've been looking into SDL2, as that seems relatively popular and portable, but I'm curious to see if there's any other libraries that are recommended.
While this may seem heretical to many, why not consider SVG or HTML5 canvas? Widely supported, Ultra portable and very readable code unless you are looking for stuff that needs fancy acceleration.
Html Canvas is easy and accessible for anybody, a safe choice. If you look for something native and accelerated, the best thing I found is Tigr https://bitbucket.org/rmitton/tigr/src
I really miss 486 days, when all you needed to paint pixels on screen full speed was 2 ASM instructions and writing to video memory. Full freedom and creativity without any technical barrier.
now that unreadable shader trick might be neat and all, but since GLSL supports if statements why not use this and make it readable? There certainly won't be any performance issues with rendering a single triangle, but I suppose people want to feel clever?
Hi zorkw4rg. Thanks for having a look at the tutorials. What makes the vertex shader not readable in your opinion? If you substitute the different values gl_VertexID can take (0,1,2), it's not hard to calculate the values of gl_Position.
Its certainly not hard to calculate but a if this index then this vertex coordinates, and so on, seems significantly simpler than having to calculate anything at all? It sure what be more verbose though.
No, we use math to model it, but whether our models are "perfect" may be very difficult to ever know. Since we cannot model every atom, we don't know whether the differences between our model and reality are because our models are wrong or if we simply have imperfect inputs (starting positions) in them.
Here's mine (using Xlib): https://www.t3x.org/xt3x/index.html