Giter Site home page Giter Site logo

greedy-snake's Introduction

Greedy snake

💡Requirement Analysis

To design a game of Gluttony by setting the coordinates of the snake and changing the food coordinates, using C++ and calling the acllib library to implement the game graphically.

💡Key step-by-step instructions:

1、 Use the RGB function to set the colour of the snake, which can get more and more beautiful colours.

  1. the use of arrays to initialise the length of the snake, and then arrays to achieve the change in length, using the random function srand to determine where the food appears.

  2. The over function determines the death of two snakes, with appropriate explanations.

  3. the keys were designed to be essentially ASCII to hexadecimal conversions.

  4. Both the food and the snake morphology changes have calls to functions in the acllib library.

💡Test results Run the program and when the violet coloured snake wins, it will display VIOLET WIN.

image

Turquoise WIN will be displayed when the lake green snake wins.

image

When the two are of equal strength, it will show EQUAL!

image

💡Recommendations

1、This experiment is graphical, colours and shapes have been improved, and arrays and random numbers have been used to assign coordinates of snakes and food to move, which is a great gain for me.

2、The scoring system and the hierarchy can be added to make the game a better experience.

3、Graphic interface can be more beautiful, draw your own food pattern, and snake shape, so that the game is more realistic.

4、If you can design bombs, walls and other obstacles to increase the difficulty of the game, the playability will be improved.

greedy-snake's People

Contributors

frannie1020 avatar

Watchers

 avatar

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.