Skip to content

Snake game written in PowerShell which uses any windows console (cmd.exe, powershell.exe, even VSCode) and draws out a custom native code based game. Useful and fun game for aspiring programmers and techies.

License

Notifications You must be signed in to change notification settings

avdaredevil/PowerSneks

Repository files navigation

PowerSneks

Snake game written in PowerShell which uses any windows console (cmd.exe, powershell.exe, even VSCode!) and draws out a custom native code based game. Useful and fun game for aspiring programmers and techies. Features:

  • Robust Game engine:
    • Capable of handling multiple snakes / objects
    • Mod capabilities by extending engine and providing your own Game Hook / Classes (as long as you implement the appropriate interfaces)
    • Saving / Restoring complete state (Snakes, directions, objects, Game Grid, Tick Speed, etc)
  • Level Mechanics:
    • Obstruction creation
    • Laser beams
    • Moving snitches (with random point values)
  • Customization Segment:
    • Allows you to Customize $Script:GameKnobs to adjust everything from Sleep Times, Obstruction sizes, Render sizes, Colors, Symbols, SaveMaps, Laser Logic, etc

Screenshots

Standard Single Player Multiplayer (w/ Debug Console) Scoreboard during gameplay
Standard Single Player Multiplayer (w/ Debug Console) PowerSneks Scoreboard
Gameplay Gif
PowerSneks Gameplay

Usage

.\PowerSneks.ps1 [[-Snakes] <int:1>] [[-Bots] <int:0>] [[-MapFile] <string>] [-LoadDefaultSave] [-ShowPlayerLabels] [-Debug]
  • Will draw a game to match the dimensions of the console window
  • Snake is the number of human players (controls cut off after 2 players), Bots is the number of bots in the game
  • Debug mode is for debugging to see snake positions, object distances, active render, current block, tick
  • LoadDefaultSave loads game from a previous save [File: %appdata%\AP-PowerSneks.Map.Save]
  • MapFile is the save-file path you want to load the game from
  • Note: If you've never run PowerShell Scripts before refer to Setup PowerShell Section Below

Features

  • In house Game Engine, and View overlay + Grid System
  • Color Scheming
  • Level Making
  • MAP Saving and Loading
  • Obstruction Creation
  • Laser Beams To cut through walls
  • Warping of Obstructions and Snake
  • Game-Console with Laser and Score count
  • Debug console like Minecraft for the game Engine
  • CPU cycle and sleep time adjustment as game progresses

Commands

Key Code Usage
q,x,ESC Quit Game
, , , Move Snake (left/right/up/down) (Player 1)
A , D , W , S Move Snake (left/right/up/down) (Player 2)
num4, num6, num8, num5 Move Snake (left/right/up/down) (Player 3)
ctrl,l Laser Beam (Player 1)
space,z Laser Beam (Player 2)
+ Speed Up Game [Increases Tick speed]
- Slow Down Game [Increases Tick speed]
p Pause Game
f12 Full Screen
Tab Save Current Game State
f5 Refresh view [fast]
~ Enable dev console on game (also enable-able via the -debug cmdline flag)
0 Add more food to the game [Cheat Code]

Files

Game Launchers

File Description
PowerSneks.ps1 Main Game launcher, use this to start the game
ToBots.ps1 Use a saved game and convert all players to bots (best use for this file, use -LoadDefaultSave)

Base Files

File Description
PowerSneks_BaseObjects.ps1 Contains enums and base object definitions that the game engine relies on
PowerSneks_GameSettings.ps1 Contains all the tinkerable variables that can be modified before launching the game engine
PowerSneks_Engine.ps1 Class definition for Game, Snake, Player, LiveObject, Snitch, etc
BotClass.ps1 Contains the class definition for SnakeBot (a really dump CPU bot that can kinda play this game)
Sockets.ps1 TODO: Add LAN based multiplayer support for the game

Set Up PowerShell [If you've never run a script in PowerShell]

  • Open PowerShell with Admin Access
  • Run Set-ExecutionPolicy Bypass
  • This allows scripts to be run in PowerShell
  • cd to the Folder where you downloaded/cloned PowerSneks.ps1
  • ./PowerSneks.ps1<arguments>

About

Snake game written in PowerShell which uses any windows console (cmd.exe, powershell.exe, even VSCode) and draws out a custom native code based game. Useful and fun game for aspiring programmers and techies.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published