GitXplorerGitXplorer
s

snek2d

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
adc0d6e45f19587bb7044a3affc3ec8a6a8c648d

removed debug banner

ssimpson-peter committed 5 years ago
Unverified
fba9e5d0180e54ecf6e8113e42ebefe36f7478a4

added authorship message to settings menu

ssimpson-peter committed 5 years ago
Unverified
b3aaaf31c285a9adb92c3df5b1233b5f0ca2637f

fixed pubspec to reduce warnings

ssimpson-peter committed 5 years ago
Unverified
56c49279c007fab9acf7476f827c1f1fc0747982

updated README

ssimpson-peter committed 5 years ago
Unverified
4e5fa0415296f06bde3a91dce4a9babccc7c1953

updated privacy features in SnakeGame

ssimpson-peter committed 5 years ago
Unverified
d5e5add8526a8dfdc7fd4818fd773e92e05c227e

fixed barrier dismissal bug

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!