[{"element_type":"text","content":"\n  \n        \u003cp\u003eLast January I spied an Arstechnica article,\u0026nbsp;\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003ca href=\"https://arstechnica.com/gaming/2024/01/1d-pac-man-is-the-best-game-ive-played-in-2024-so-far/\"\u003e\"1D Pac-Man is the best game I’ve played in 2024 (so far)\"\u003c/a\u003e, and it got me thinking. I've done more than a few little arcade games with my Pybadge - but I wondered if I could do something on the CircuitPlayground.... Hmmmm.....\u003c/p\u003e\n\u003cp\u003eSo I came up with StarFighter Patrol. Basic premise: Hyperspace lanes are plagued by navigational hazards - asteroids - that you need to blast to clear for safe passage. A \"lane\" is a 100 element array in the program - on the CPX you see ten elements - your ship at pixel 4 or 5 (depending on which direction you are heading). The stars and asteroids move clockwise initially - the lane is a circle, if you wait long enough the same elements will come toward you.\u003c/p\u003e\n\u003cp\u003ePressing B reverses direction, A fires your lasers. You need to clear the purple asteroids that are a hazard to hyperspace navigation. You can move to a new region by hitting A4. Or if you choose restart the game with A3. When you've been hit 5 times your score (number of asteroids cleared) will show before the game restarts. (the score is digit-by-digit, so 13 would show one pixel, then three pixels. Zero is all green pixels). In the CircuitPython version you restart when you hit A or B. The Makecode/Javascript version will restart after a pause.\u003c/p\u003e\n\u003cp\u003eThe Circuit Playground display shows your spaceship as a green dot, and the stars and asteroids heading toward you in a 10 pixel-wide display - this is a portion of the 100 pixel wide hyperspace lane you patrol (think of the \"lane\" as a circle - you move left or right in in and will wrap all the way around if you play long enough). Your ship fires toward oncoming objects - so when you reverse course the laser blasts (yellow dots) move towards the oncoming objects.\u003c/p\u003e\n\u003cp\u003eBonus: You can see MORE pixels if you attach\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003ca href=\"https://www.adafruit.com/product/3811\"\u003ehttps://www.adafruit.com/product/3811\u003c/a\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003e- the 30 pixel Adafruit neopixel strip using A1 as the control - then you'll get a 30 pixel wide one-dimensional display!\u003c/p\u003e\n      \n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/096/original/image1_%282%29.jpeg?1723404857","metadata":{"caption":"Expanded game display with Adafruit NeoPixel strip"}},{"element_type":"text","content":"\n  \n  \n  \n  \n        \u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eI'm happier with the way the CircuitPython version turned out - but both versions (Makecode/Javascript or CircuitPython) pretty much work the same.\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cpre class=\"notranslate\"\u003e\u003ccode\u003eSwitch to the right to turn off sound.\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eFiles in the github \u003ca title=\"StarFighter Patrol github archive\" href=\"https://github.com/mrklingon/StarfighterPatrol\" target=\"_blank\"\u003earchive\u003c/a\u003e:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003ebach.py - provides musical tones - copy to Circuit Playground for starfighter.py\u003c/li\u003e\n\u003cli\u003estarfighter.py - 1D starfighter patrol game. Destroy asteroid threats. copy to code.py on your Circuit Playground\u003c/li\u003e\n\u003cli\u003estarfighter.js - Javascript version Makecode link:\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003ca href=\"https://makecode.com/_RocF4AHbY19R\"\u003ehttps://makecode.com/_RocF4AHbY19R\u003c/a\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cpre class=\"notranslate\"\u003eGame controls:\u003cbr\u003e\u003cbr\u003e\u003ccode\u003e  A - fire laser\n  B - reverse direction\n  A4 - hyperspace\n  A3 - restart game\n  A7 - show last score\u003c/code\u003e\u003c/pre\u003e\n      \n\n\n\n","metadata":{}},{"element_type":"text","content":"\n        \u003cp\u003eNow, go clear those hyperspace lanes!!!\u003c/p\u003e\n      ","metadata":{}}]