170 karma · joined September 4, 2020
This tutorial is both a JavaScript Game Tutorial and an introduction to the HTML Canvas elements. First, we learn how to draw on a Canvas element with JavaScript. How to draw the background, the buildings, the gorillas, and the bomb.
Then we add interaction. We add event handlers, we cover how to aim, how to animate the bomb across the sky, and how to detect if the bomb hit the enemy or a building.
In the end, we also add AI logic for the enemy gorilla, so you can play against the computer.
I'm not sure where you see horizontal scrollbars though. Are you on Windows?
For instance, does anyone know why the thumbnail preview does not work on Twitter? It works with the sub-pages.
I know there is text anchor: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/t...
And someone suggested the foreignObject tag that might be useful here: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/for...
As for foreignObject, I also didn't knew about it. That's awesome
One of the examples in this tutorial is also a data-driven diagram generated from React. You can do pretty cool things by combining the two.