Snake game that runs on Mac, Windows, and Linux. Built with Ruby and Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library) using Application Scaffolding.
Setup
Assuming you have Ruby installed (standard MRI / CRuby).
Run:
gem install glimmer_snake
Usage
Run:
glimmer_snake
Mac | Windows | Linux |
---|---|---|
The goal of the game is for the green snake to eat the red apple and to survive for as long as possible. The snake always moves forward at a fixed speed. You can change the direction of the snake using arrow keys (Up is North, Right is East, Down is South, Left is West). Every time the snake eats an apple, it grows by 1 block (the size of the apple), and the apple regenerates somewhere else. If the snake hits its own body (especially after enlargement), it dies. Pressing the spacebar pauses/unpauses the game.
The game remembers the highest score by storing in ~/.glimmer-snake
. You can delete that file if you want to reset the highest score.
Development
Clone project:
git clone https://github.com/AndyObtiva/glimmer_snake.git
Change directory:
cd glimmer_snake
Install project gems with Bundler:
bundle
Run application with glimmer
command:
glimmer run
Or run using included binary script:
bin/glimmer_snake
Package as a Ruby gem with glimmer
command:
glimmer "package:gem"
Or package using equivalent direct rake command:
rake build
Generate updated gemspec with glimmer command
:
glimmer "package:gemspec"
Or generate gemspec using equivalent direct rake command:
rake gemspec:generate
Contributing to glimmer_snake
- Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
- Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
- Fork the project.
- Start a feature/bugfix branch.
- Commit and push until you are happy with your contribution.
- Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
- Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
TODO
Change Log
Copyright
Copyright (c) 2023 Andy Maleh. See LICENSE.txt for further details.
--
Built with Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library)
Glimmer Snake icon made by Freepik from www.flaticon.com