Giter Club home page Giter Club logo

make-snake's Introduction

Make-Snake

Make-Snake is a fun introduction to the Linux shell, with a command line game that lets you change sizes and themes. It’s a great teaching tool for beginners, easy to contribute to, and a fun activity for anyone who wants to create their own version of the classic game.

Visit the project's wiki to get the full description: https://github.com/KanoComputing/make-snake/wiki

Collaborate!

make-snake's People

Contributors

alexaverill avatar alexnklein avatar convolu avatar ealdwulf avatar hyperknot avatar japonophile avatar pazdera avatar radujipa avatar skarbat avatar tombettany avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

make-snake's Issues

infinite lives bug

Snake dies once, after that it has 0 lives and lives infinitely.

Trigger the bug: type this in playground mode:
python snake -b s (probably it's in any other non-tutorial mode as well)

Kano DevBox

Would it be possible to get the passwords for the root user on the Kano DevBox, it would be nice to have access in order to install other tools, and change permissions in order to make development easier.

Number of lives as parameter

We can add a new parameter which is the number of lives. By default it will be 1, with a maximum of 5.

Things to do:

  • Add the parameter -l to the list
  • Read number of lives from the parameter here
  • Add a new step in the tutorial

Adding this to Development Wiki Page?

I wrote up a method in which to install make-snake onto a debian install and allow it to run and be recompiled. I was wondering if it was reasonable to add it to the Development Wiki page?

Guide:

How to setup the make-snake dev enviroment on a Debian Based system.
To start make sure that you have pip and python installed.
python --version
pip --version

If you do not have pip installed you can install it via
sudo apt-get install python-pip
or By following the instructions here:
http://pip.readthedocs.org/en/latest/installing.html

Once you have those installed you then will need to install kano-debber. Found here: https://github.com/KanoComputing/kano-debber

You can follow the instructions there to download or you can run:
git clone https://github.com/KanoComputing/kano-debber.git

Next cd into kano-debber:
cd kano-debber

Then you will need to run the two scripts to prepare your system.
First:
sudo ./prepare-system.sh
(This will setup the dependancies and needed programs)
sudo ./prepare-deb.py
(This will setup the nessisary deb packages that you will need to run make-snake, as well as pull down the repos)

Once those have been run it is time to get the repos that are available:

sudo ./kano-debber.py -g all -dbi (this command will pull down all the repos available at the moment.)

Now you have all of the code you need to run make-snake, however we have to setup the enviroment for your user in order for it to run at all.
First create a kanousers group:
sudo groupadd kanousers

Add your user to that group:
sudo usermod -a -G kanousers [USERNAME]

The Final step is to create a profile.json for kano apps to look for.
Create a .kanoprofile directory in your home directory
cd ~/
mkdir .kanoprofile
cd .kanoprofile

Make a proile directory
mkdir profile; cd profile;

Now create a profile.json
vim profile.json or nano profile.json

Now in your profile.json you will need the following (Most of this comes from KanoDevBox profile):
{
"last_save_date": "2014-04-08T03:59:43.002988",
"mac_addr": "[MAC ADDRESS]",
"username_linux": "[USERNAME]",
"device_id":"1234"
}

In the [MAC ADDRESS] put your computers mac address, which if you need to fine it just run:
ifconfig |grep HWaddr

In [USERNAME] put your username.

device_id was added into the profile as a way to override the issues with some of kano's python not being able to find a serial number or a device id.

Once this is saved you should be good to run make-snake.

If you decided to play with the make-snake code to recomile and install just run:
sudo ./kano-debber.py -n snake -bi -v

Bug(s) on fresh installs of make-snake

I have been fooling around with the recent commit, and have found this on my normal system, after doing a ./kano-debber.py -g all -dbi this happens:
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/share/make-snake/main.py", line 9, in
import graphics
File "/usr/share/make-snake/graphics.py", line 8, in
import game
File "/usr/share/make-snake/game.py", line 13, in
import gamestate as gs
File "/usr/share/make-snake/gamestate.py", line 9, in
from kano.profile.apps import load_app_state, get_gamestate_variables
ImportError: No module named apps

I am assuming that this is due to the changing it to not require a profile, and that you guys already know about it, and are working on the needed modules to fix the issues, and it would be fixed without me being annoying and submitting a bug, however I was hoping that you could check that I am understanding the structure of the code correctly?
My steps were as following:
I started by updating and noticing that it was breaking, so my next step was to check and make sure the update worked correctly, as well as it not being something that I created when I was fiddling with code, so I re ran the kano-debber.py. After still recieving the errors I saw the error log, and noticed that the lines in question was the import line of:
from kano.profile.apps import load_app_state, get_gamestate_variables
and the fact that the apps module didn't exist

So from what I can tell the error then led to /usr/lib/python2.7/dist-packages/kano/profile.py which is missing a get_gamestate_variables as well as a submodule of apps and badges?

So the solution would be to create the submodules for apps as well as badges in order to fix the import problem, then create the needed functionality for get_gamestate_variables under the apps submodule?

I apologize greatly in advance if this is annoying or not wanted, I was hopping to clarify my understanding of the code, and make sure I was at least on the right track in terms of what the problem is and what the solution would be, even though I do not have enough knowledge of the snake game to create a working solution. I wanted to make sure I was on the right track in terms of the code structure.

Thank you,
Alex

Theme editor doesn't instantly show character changes

There is an issue when creating a theme for Snake, when you change symbol/character for various things such as borders, snake body etc. The change doesn't show immediately, but only once you go in to another setting. I have taken a quick screencap to explain what I mean a little better (view in fullscreen HD) :)

http://youtu.be/K4dndyQ2qG0

Steps to reproduce this issue
Preconditions: You must have completed all of the Make Snake levels or be on the editor challenge. These steps only apply if you are not on the editor challenge.

1.Open Make Snake
2.Type in python snake -e and press enter
3. Goto "New Theme" and press enter
4. Enter in a board name then press enter
5.Goto Board then press enter
6.Goto Background then press enter
7.Goto Background colour then press enter
8.Select Black then press enter
9. Goto Background symbol and press enter
10. Type in a non white space character and press enter
11. The board preview has not been updated
12. While on background symbol enter in another character then press enter
13. Goto Symbol colour then press enter
14. The character that you entered is no longer displayed on the board

[Bug] Backslash (\) not escaped

If the inputted commands contain a backslash () character, then the line is not immediately parsed and a new, blank line is shown. This can be confusing as it makes the user think that the program has crashed or they need to input more when actually they have already got the command wrong.

python snake \

Won't run the command

Complex board shapes

Implement the ability to add obstacles, mazes or change the shape of the board itself! This will mean a change of the collision detection, the editor and the way we declare a theme (shape will need to be included as part of the theme).

Snake badly glitches when minimised

If the user selects the Snake app from Apps > Games and the window is minimised it can be noticed that an improper behaviour is revealed. The screen starts to flicker and the game can't be seen or played.

Steps to reproduce this issue
1.Run Kano OS
2.Select "Apps" from desktop
3.Select Games tab
4.Choose Snake
5.Minimize the window
6.Notice the outcome

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.