Bricks, its physics in Hazel

Hazel activities › Physics simulation · source on GitHub · hazeljs on npm

Move the paddle under the ball and keep it in play: drag along the field, or ⬅️ ➡️; tap the field, ⬆️, or Enter to send the ball off; the space bar pauses. Where the ball meets the paddle sets its angle: near an end, off to that side. A brick takes one hit or two (the darker ones); grey posts never break. Break every brick to go on to the next of six levels. The levels, each step of the ball and the robot that plays for you are all Hazel (bricks/rules/Bricks.hz).

⏳ Loading the rules…
⭐ 0

This app needs JavaScript, and a page served over http (python3 -m http.server, then localhost).

The vocabulary the module sees (bricks/rules/preamble.hz). The listings are text, highlighted, until Edit in Hazel opens each in Hazel's own editor; an edit changes the next step (interpreted, so slower).

loading preamble.hz…
Bricks six levels' bricks as data; one step of the game (the paddle, then the ball in four small steps off the walls, the paddle and the bricks; a ball lost, a level cleared); and the robot that plays it
loading Bricks.hz…

hazeljs-examples · versions · Apache 2.0 (code), CC BY 4.0 (words, the icon) · by Matthew Hammer · an example for hazeljs