GitXplorerGitXplorer
s

snek2d

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Verified
e9f9f67df5d8a32f82f0b63bf644afc4fb042884

Update README.md

ssimpson-peter committed 4 years ago
Unverified
c7aacf9bf85a70fce5fcff7c71c0a1678cf18177

added license

ssimpson-peter committed 5 years ago
Unverified
8042f91eec0b295ce50533bbe29ddddcd52a2d50

added mini screenshots

ssimpson-peter committed 5 years ago
Unverified
daa2bbcb3f5b641ca64826de948d6dc0041ca8aa

updated README w first img

ssimpson-peter committed 5 years ago
Unverified
b58a611c162007367b6ce1d2bf6defd161b19fa3

resolved package name issues

ssimpson-peter committed 5 years ago
Unverified
246d9ce6aba356fe981c9c392d2b6fd6abc6d183

updated screenshots to reflect production build

ssimpson-peter committed 5 years ago

README

The README file for this repository.

Snek 2D

This is an open-source game for iOS and Android created by Peter Simpson. It is very similar to the classic Snake, but with a few fun extra features.

Snek Screencap 1 Snek Screencap 2

Design

Snek is implemented in Dart and utilizes the Flutter and Flame frameworks. The top-level logic and coordination of the game is handled by the SnekGameShell, which organizes the game itself, as well as the scoreboard and various menus and alerts.

The game itself is handled by the SnekGame class, which uses a typical update/render game loop, the low-level details of which are handled by flame.

The SnekGame class directs the Board class, which controls the visual rendering process, as well as various classes such as Snake which track the state of the game and handle its logic.

Repository Contents

The majority of the files in this repository are generated by the flutter framework to control app production. The files and directories which are unique to this project are:

  • lib/
  • pubspec.yaml
  • screenshots/
  • README.md (You are here)
  • fonts/ (Fonts are thanks to the Press Start 2P Project Authors and Eduardo Tunni (Graduate)

pubspec.yaml lists the project dependencies, which can be loaded through running a pub get command. screenshots/ contains screenshots of the app in use.

lib/ contains the game source code, and is organized as follows:

  • components/
    • board.dart
      • Contains the Board class, which is responsible for translating the square-tile based logic which the game uses to track positions to pixels, and subsequently render the game.
    • snake.dart
      • Tracks the data relating to the snake position, and handles operations such as adding and removing snake positions
    • snek_game.dart
      • Inherits from the Flame Game class, is composed of almost all of the relevant game data through either direct, or super-compositional ownership, and contains functions to handle game behavior
    • tile.dart
      • Implements the Tile class, which is the atomic unit for all non-visual portions of the game program.
  • util/
    • position.dart
      • Class which tracks data relating to both pixel and row/column positon
    • settings.dart
      • Class which tracks data relating to user choices on special gamemodes
  • widgets/
    • Contains implementations of the various Widgets which comprise the non-game visual elements of the app (scoreboard, settings menu, loss dialog).

Known Issues

None as of now, but as always submit issues or pull requests if you find any!