Elm Space Invaders + two potential packages

A couple of months ago, I decided to have a play with onAnimationFrameDelta and ended up seeing if I could build a ‘clone’ of the old retro Space Invaders game.

After hacking together a single player, single life version over the course of a week, it became a bit of a labour of love. Having never built a game before, I thoroughly enjoyed refactoring and improving the gameplay to get it to where it is today. There’s still more that can be done, but it’s at a point I’m more than happy with and ready to move on to another game.

The repo is here and the game is online here. I’d love to know what you think.

While working on the game, a couple of potential packages evolved. Again, I’d love to know what people think of these, or whether I’m flogging a dead horse.

1. A Games Package

The Shared folder in the repo contains what I think might be a useful package to help people with game development. It deals with things like hit testing between two objects, storing game state between player turns, moving game assets around and so forth.

2. ResponsiveUI

Next to Main.elm is ResponsiveUI.elm, with its companion files in the ResponsiveUI folder. It provides a common way to do ‘responsive’. There is more that can be done with this to flesh it out, it works as intended for the screens in the game, but I would be interested to know whether you think the road I’m heading down is sensible or just plain dumb.

Docs

I have pretty much written up docs for all the files, and they can be viewed with elm-doc-preview.

Thanks to anyone that takes the time to have a look, hope you enjoy it.

2 Likes

Pretty fun, I kinda miss some visual feedback when you hit something :slight_smile:

Anyway, we do have some games packages, maybe those are pretty similar already? For e.g. https://package.elm-lang.org/packages/Orasund/pixelengine/latest/

2 Likes

Ok, thanks.

Hadn’t thought of that - my goto game back in the youth clubs was Defender so might give that a go next - would be easy enough to add in though.

I didn’t look for any existing packages originally because I wanted to see if I could do it all from scratch myself. I’ll try and have a play with the package you mention over the coming weeks.

Thanks for the feedback, appreciate it :slight_smile:

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.