Giter VIP home page Giter VIP logo

tetris's Introduction

Tetris

On va avoir:

char FIELD[ROW][COLL] = {0};

image

O

{0, 0, 0, 0}

{0, 0, 0, 0}

{1, 1, 0, 0}

{1, 1, 0, 0}

I

{1, 0, 0, 0}

{1, 0, 0, 0}

{1, 0, 0, 0}

{1, 0, 0, 0}

L

{0, 0, 0, 0}

{1, 0, 0, 0}

{1, 0, 0, 0}

{1, 1, 0, 0}

S

{0, 0, 0, 0}

{0, 0, 0, 0}

{0, 0, 1, 1}

{0, 1, 1, 0}

Z

{0, 0, 0, 0}

{0, 0, 0, 0}

{1, 1, 0, 0}

{0, 1, 1, 0}

J

{0, 0, 0, 0}

{0, 1, 0, 0}

{0, 1, 0, 0}

{1, 1, 0, 0}

T

{0, 0, 0, 0}

{0, 0, 0, 0}

{1, 1, 1, 0}

{0, 1, 0, 0}

Nous avons nos pieces, nous allons les prendre aleatoirement et on va le mettre dans une structure (current piece)

current piece
  x = 0
  y = (coll/2-1)
  peice = piece aletoire

Nous allons avoir une fonction qui va turner notre matrice en utilisant une algorythme de rotate en 90°

Mais tout d'abbord nous allons construire une champe de jeux

|__________|

|__________|

|__________|

+++++++++

Pour prendre des touches de joueurs nous allons chenger le mode de terminal en non-canonical mode. Nous alons lire input charracter par charracter et si nous avons une de touches suivants:

← espace → ↓ ou q

Nous allons faire qqch.

Nos pieces vont étre déplacés chque "tick" (chaque 1 sec)

Si current_piece a touché le sol ou une autre pice - nous allons le lesé sur ce place. Nous allons mettre une autre piece dans current piece at nous allons anuller x et y

Install

Install make

Then write it near makefile: make claen make Lance le jeu ./tetris

tetris's People

Contributors

mur4ik18 avatar

Stargazers

 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.