pilkaj / snake Goto Github PK
View Code? Open in Web Editor NEWSimple snake project with graphical and console user interface
Simple snake project with graphical and console user interface
Resolve issue with getting input from player. multiple consequent inputs must be remembered. Let's say 3.
Use enumerator class 'Directions' for enumerating inputs.
Do cleanup. remove unused functions as:
Create own file for every class, as are joint, snake, snakegame
Ensure all TODO marks are implemented
Create snake self function to enlarge its body.
New joint should be placed at the tail.
Validate whether the snake eat a fruit.
Create function in class Snakegame with input params snake and fruits.
Return True or False value.
Create game menu. Basic implementation will contain two screens. We are OK with it for now.
Main menu - displayed, when app is started:
<Play game button>
Game finish menu - displayed when game has finished:
<score label>
<total_time label>
<OK button>
Check input validity - whether new direction does not collide with snake body.
Update snake self variable direction.
Do basic snake movement based on the snake direction and current position.
Update snake self joints positions.
Use queue system FIFO, when tail becomes head with new coordinates.
Restrict fruit randomizer in generating fruits on positions, where there are already some objects as snake, wall, or other fruit.
For player input: keyboard
https://stackoverflow.com/questions/24072790/detect-key-press-in-python
For queue: queue
https://www.guru99.com/python-queue-example.html
Situations to be tested:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.