Andromeda Invaders: A retro-style game written in HTML5, Canvas, and Web Audio
susam.net
susam.net
It is a standalone HTML page, so you can view source to see the entire source code. Also, see https://github.com/susam/invaders for source code.
The levels appear to get very hard very quickly but my friends who initially played this game were able to reach up to level 5 with some practice and then level 10 or so after some attempts. I could reach level 11 after a week of playing (https://i.imgur.com/c0twMr4.png). I have found that in the later levels, it is best to play each level in two phases: First focus only on avoiding the falling boulders. Try to find regions where there are less invaders hovering and try to be there. After some of the invaders vanish by fluke hits and the level becomes easier, play normally.
I was on L4 and hit Enter accidentally and it reset my game. :-(
I'm using Firefox, not sure whether it's easier (slower) on Firefox?
P.S. surprisingly fun game. Now it needs a leader board to go viral ;)
You also seem to be interested in Lisp - maybe do a version in ClojureScript.
I've been reading about Canvas, it seems to get a lot of stick for not being accessible. Certainly a lot of criticism for flutter web using it. When is it good and not good to use? I'm assuming games it's good for.
Complete novice so looking forward to being educated. Thanks.
The reason it's faster is because it is designed for that sort of thing, whereas web pages are meant to be mostly static, which is a good thing. Different use cases
The browser can’t really do much with those shapes in terms of accessibility. Perhaps zooming or increasing contrast? The cases where it makes sense are few. Also, svg support has gotten better, and is easier to use, if you need simple animations embedded within a regular, otherwise accessible page.
Hope that helps.
General advice: treat it like an image. If an image is good for the job, a canvas will be as well. Otherwise, if it is essential for navigation or getting the gist of that page, you may consider complementary elements or an all together different approach. However, if there is no sense in an alternative representation (like in the case of an arcade-style game), this type of content should be still allowed.
That immediately destroys the retro feeling for me.
I think in that scenario though you ought to create your own "off-screen canvas" to render your sprites/drawing/text to. Then when you have completed the render/loop, draw from your offscreen canvas's context to the browser canvas's context.
As another replied, you can probably change the scaling attribute (turn off imageSmoothingQuality) to get what you want.
I received a pull request that adds pixelated rendering to the game canvas: https://github.com/susam/invaders/pull/4
I have merged it now. Thank you, everyone, for the discussion regarding retro-style rendering on this thread.
https://www.ticalc.org/archives/files/fileinfo/148/14876.htm...
However, a limitless reward for shooting boulders is a very problematic design decision because it incentivizes an intrinsically boring task.
Also, the amount of randomness is remarkably high for a genre defined by the relentless yet predictable march of the enemy ships.
Maybe this is meant to be part of the challenge?
I should figure out how to add sound. It's always inspiring to see the great work of others :)
It looks simple (and it is) but it's been done well.