Giter Club home page Giter Club logo

arduban's Introduction

Arduban

A Sokoban clone for the Arduboy. The game currently has 330 Levels. Because there are so many levels, none of the levels are locked.

Warning - This game saves your best score for every level. Because of this, it uses most of the EEPROM memory. This means it will likely overwrite data stored by any other game. If you switch games often and don't want to lose your saved progress, back up your EEPROM.

Intro Screen

Intro Screen

Screenshot

Screenshot

Playing

The objective of the game is to move the man, pushing all of the boxes onto the goal squares. You can only push the boxes, you cannot pull them and you can only push one box at a time. The game keeps track of the number of moves you've made and saves your best scores (lowest number of moves) for each level.

Controls

Intro Screen

A Opens the currently selected level
B Opens the settings screen
UP Selects the previous level
DOWN Selects the next level
LEFT Selects the previous unsolved level
RIGHT Selects the next unsolved level

Game Screen

A Undo one move. Hold for 5 sec to reset level
B Returns to the Intro screen
UP Moves the player up
DOWN Moves the player down
LEFT Moves the player left
RIGHT Moves the player right

Level Solved Screen

A Opens the next level
B Returns to the Intro screen

Settings Screen

A Selects the current setting
B Returns to the Intro screen
UP Moves to the previous setting
DOWN Moves to the next setting

Images

Player

Our trusty player, ready and willing to push boxes around for a living!

Player

Box

These are the objective, push these onto the goals.

Box

Goal

This is where you want to push the boxes to.

Goal

Box on Goal

This is the objective of the game, move boxes onto the goals in the least moves possible.

Box on Goal

Wall

You can't move here...

Wall

ParseLevels

This .NET Core program takes levels in a simple TXT format and converts them to C code to add into the levels.h file. The level files are in the Assets\Levels directory.

This program looks at each level and skips levels that are bigger than 16x8 squares. If a level is taller than it is wide, it rotates the level to fit better on the Arduboy screen. It then centers the level if it is smaller than 16x8.

Lastly, it compresses the levels using a simple run length encoding (RLE) format inspired by the the Sokoban XSB format, but modified to take fewer bytes of memory on the Arduboy. As of this writing, I've managed to load 295 levels and use 89% of memory. I will probably want to reduce that to around 255 levels to make room for more bitmaps.

You must have .NET Core 2.1 installed. The utility is run with a command like the following;

dotnet run -- 'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Microban.txt' 'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Microban II.txt'  'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Microban III.txt' 'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Microban IV.txt' 'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Sasquatch.txt'  'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Sasquatch II.txt'  'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Sasquatch III.txt'  'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Sasquatch IV.txt'  'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Sasquatch V.txt'  'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Sasquatch VI.txt'  'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Sasquatch VII.txt'  'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Sasquatch VIII.txt'  'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Sasquatch IX.txt'  'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Sasquatch X.txt'  'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\Sasquatch XI.txt'  'C:\src\Arduino\Arduboy\Arduban\Assets\Levels\YoshioMurase.txt' > C:\src\Arduino\Arduboy\Arduban\Arduban\levels.h

To make this easier, running the batch file GenerateLevels.cmd will regenerate the levels.

Credits

The game uses levels created by David W. Skinner and Yoshio Murase. This game makes use of the 4x6 Font by Filmote which is under the BSD-3 license. This game is under the MIT License.

Thanks to @Pharap and @Mr.Blinky from the Arduboy Community for memory reduction ideas and help.

arduban's People

Contributors

pharap avatar rprouse avatar

Watchers

 avatar  avatar  avatar

arduban's Issues

Settings screen

  • Turn sound on/off
  • Reset all scores
  • View incomplete levels
  • ???

Next/Previous unsolved

On the intro screen, use the left and right buttons to go to the next/prev unsolved level

Mark levels as complete or not

Depending on the amount of EEPROM memory record the number of moves that the level was completed in? There is 1K of EEPROM, so with a max of 255 levels, that leaves more than 2 bytes for each level which allows for > 65K moves per level. Unfortunately, 1 byte is only 255 moves per level which is too low.

Encourage

Positive words on level completion

Stupendous
Magnificent
Clever
Genius
Smarty Pants
Outstanding
Brilliant
Amazing
Astounding
Astonishing
Extraordinary
Remarkable
Staggering
Splendid
Spectacular
Impressive
Superb
Marvellous
Exceptional
Masterful

Game over screen

Need a game over screen for when you solve all levels? Does this make sense if all levels continue to be open for play?

Undo gets out of sync

Seems to work most of the time then gets out of sync. I don't think it is a problem with wrapping around the undo buffer. Possibly an incorrect direction getting added?

Reset level

If I implement #2, I will need a different level reset. I'm thinking holding the A button will start a timer, after 3 or 4 sec the level will reset. Use the LED and a sprite animation to indicate what is happening.

Allow undo

Create an undo buffer of N moves and allow the user to step back. Since we only have the A and B keys, maybe a single click of the A goes back but a long hold resets the level?

Start screen

Need to design a start screen for the game with room for level selection.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.