{"id":13599194,"url":"https://github.com/StartAutomating/PowerArcade","last_synced_at":"2025-04-10T12:31:35.344Z","repository":{"id":80535910,"uuid":"252143408","full_name":"StartAutomating/PowerArcade","owner":"StartAutomating","description":"A Retro Arcade Game Console in PowerShell","archived":false,"fork":false,"pushed_at":"2020-04-07T02:02:52.000Z","size":526,"stargazers_count":59,"open_issues_count":3,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-10T09:57:56.705Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StartAutomating.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-01T10:29:46.000Z","updated_at":"2024-12-17T06:10:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"679b2459-b86b-40e7-a565-c44ba959d582","html_url":"https://github.com/StartAutomating/PowerArcade","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FPowerArcade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FPowerArcade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FPowerArcade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FPowerArcade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StartAutomating","download_url":"https://codeload.github.com/StartAutomating/PowerArcade/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217130,"owners_count":21066633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T17:01:00.722Z","updated_at":"2025-04-10T12:31:35.315Z","avatar_url":"https://github.com/StartAutomating.png","language":"PowerShell","readme":"﻿# PowerArcade| Retro Gaming in PowerShell\n\n## April 1, 2020: \n\nAt Start-Automating, we believe PowerShell can power anything.  \nPowerShell has helped almost every area of automation, and has been used to build Winforms, WPF, and web applications.  \nCertain members of the PowerShell team made [legendary HTML5 prototypes](https://www.leeholmes.com/blog/2011/04/01/powershell-and-html5/).\n\nThis year, we set out to build a Game Console and Development Kit in PowerShell\n\n\n### Introducing PowerArcade\n\n\n\nPowerArcade is a Game Console for your System Console.\n\nYou can quickly and easily build build cross-platform games and share them on the PowerShell Gallery.\n\n\nCompared to their old Console counterparts, PowerArcade is HD.  Old Console games used a resolution of 80x50.\nPowerArcade can use any resolution your terminal can handle, which nowadays can be almost 200 characters wide!\nPlus we _could_ add a nicer rendering engine to it, if we ever get around to it.\n\nLike all Consoles, PowerArcade ships with a game.\n\nWe decided to do a retro update of the classic Nibbles.bas.  Check it out:\n\n![Nibbles2020](Assets/Nibbles2020.png)\n![Nibbles2020](Assets/Nibbles2020.1.gif)\n![Nibbles2020](Assets/Nibbles2020.2.gif)\n![Nibbles2020](Assets/Nibbles2020.3.gif)\n![Nibbles2020EndlessMode](Assets/Nibbles2020.4.gif)\n\n### Installing and Playing\n\nYou can Install PowerArcade from the PowerShell Gallery:\n\n~~~\nInstall-Module PowerArcade -Scope CurrentUser\n~~~\n\n\nThen you can start playing Nibbles right away with:\n\n\n~~~\nStart-Game Nibbles2020 \n~~~\n\nWant more games?  You can use Find-Game to find them and Install-Game to install them.\n\n~~~\nFind-Game # see what's out there\n~~~\n\nYou can pipe Find-Game to Install-Game, then just Start-Game\n~~~\nFind-Game Blackjack | Install-Game\nStart-Game Blackjack\n~~~\n![Blackjack](Assets/Blackjack.png)\n\n### How does it work?\n\nNibbles.bas is a fitting choice, as Nibbles was a demostration of building games in QBASIC.\nWhile PowerShell is not a direct ancestor of QBASIC, it is a successor to Visual Basic.  \nA few attempted to create games using Visual Basic, but [no developers were known to survive the process](https://youtu.be/WGqD-J_pRvs).\n\nAnyhow, developing games in PowerArcade is considerably less likely to be lethal.\n\nLet's take a look at how Nibbles works.  Here's it's file tree (courtesy of [EZOut](https://github.com/StartAutomating/EZOut)):\n\n~~~\n├──Game\n    ├──Game.ps1\n    ├──Game.psd1\n    ├──OnKey_Down.ps1\n    ├──OnKey_Esc.ps1\n    ├──OnKey_Left.ps1\n    ├──OnKey_P.ps1\n    ├──OnKey_Right.ps1\n    ├──OnKey_Up.ps1\n    ├──Over.ps1\n├──Levels\n    ├──Levels.ps1\n    ├──1\n        ├──1.ps1\n    ├──2\n        ├──2.ps1\n    ├──3\n        ├──3.ps1\n    ├──4\n        ├──4.ps1\n    ├──5\n        ├──5.ps1\n    ├──6\n        ├──6.ps1\n    ├──7\n        ├──7.ps1\n    ├──8\n        ├──8.ps1\n    ├──9\n        ├──9.ps1\n    ├──GameOver\n        ├──GameOver.ps1\n        ├──OnKey_All.ps1\n    ├──Menu\n        ├──Menu.ps1\n        ├──OnKey_All.ps1\n    ├──Pause\n        ├──Pause.ps1\n├──Sprites\n    ├──Number\n        ├──Number.psd1\n    ├──Snake\n        ├──+.ps1\n        ├──+Number.ps1\n        ├──+Wall,Tail,Snake.ps1\n        ├──Dies.ps1\n        ├──OnTick.ps1\n        ├──Snake.psd1\n        ├──SwitchDirection.ps1\n    ├──Wall\n        ├──Wall.psd1\n├──Nibbles2020.psd1\n~~~\n\n\nA game is made of a module and up to three subdirectories:\n\n#### The Game Directory\n\nThe Game directory contains a Game.psd1 which has initial settings for the game.\n\nA Game.ps1 file, if found, will be run when the game starts to initialize the game.\n\nAny other .ps1 files become methods of the Game, which can be accessed with running in a global variable called $game (duh).\n\nAny methods named On* denote an event handler.  OnTick will be called when the game clock ticks.\nFiles named OnKey_KeyName.ps1 will handle specific key presses.\n\n#### The Levels directory\n\nThe Levels directory defines game levels.  Pretty easy to navigate, right?\n\nEach named subdirectory is the name of a level.  A script sharing the directory name will initialize the level.\n\nThese named subdirectories work like the game directory, and can also handle keys.\n\nIf there is Levels.ps1 beneath levels, it will be called before the level initializes.\n\n#### The Sprites directory\n\nSprites are magical game creatures that move about in the imaginary world of the game.\n\nJust like each Levels directory, a Sprite can have an initializer (e.g. Unicorn\\Unicorn.ps1) \nand can also have default properties (e.g. Unicorn\\Unicorn.psd1)\n\nSprites cannot respond to key presses, but they can respond to game ticks.\n\nAdditionally, Sprites can have interaction methods.  These describe what happens with two Sprites meet.\n\nIn Nibbles, Sprites\\Snake\\+Number.ps1 descibes what happens when a snake hits a number, \nand \\Sprites\\Snake\\+Wall,Tail,Snake.ps1 describes what happens when a snake hits a wall, tail, or a snake.\n\nThat's about it.  Inside your methods you can do whatever your game logic needs, \nand you can use Add-Sprite, Find-Sprite, Move-Sprite, and Remove-Sprite to control the sprites on the screen.\n\n\n### Playing around and contributing\n\nThis is mostly in good fun, but feedback, contributions, and game submissions are welcome.\n","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStartAutomating%2FPowerArcade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStartAutomating%2FPowerArcade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStartAutomating%2FPowerArcade/lists"}