This is an old revision of the document!


Snake Game

Introducere

The motivation for this project came from my love of video games, and because I believe that video games are essential in one's life. This sounds out of the ordinary, however, scientists believe that video games do greatly enhance the motor and intuitive skills of humans. And not to mention that studies have shown more significant levels of creativity in children that play video games.

Overview

The device can be packaged up and be used as a handheld gaming console, for now, it can only run the classic snake game, and only on an 8×8 led matrix screen. The snake can be moved using a potentiometer (Joystick) connected to the Arduino that manipulates the led matrix' display as if it was a snake game.

Block Diagram and hardware design

Component Amount
8×8 led matrix 1
Arduino Uno 1
Breadboard 1
Wires 11
Potentiometer 1

Software Design

The IDE used was the Arduino IDE, with the Led Control library, no external libraries nor game engines were used. However, it was initially tested online on TinkerCAD before finalizing the purchase of the parts and code.

The signals sent by the potentiometer tell the Arduino the current direction of the joystick, depending on that, the snake changes direction accordingly, and the apple on screen is displayed using two random integers for x and y coordinates.

The snake location is determined by a 2D array, with each subarray containing coordinates of the light's position, each time the snake eats an apple, the size is incremented by one.

The game is lost when the snake hits itself (any part of its body), the borders of the screen do not end your game ( I made it that way due to screen size limitations )

Rezultate Obţinute

Concluzii

Download

Jurnal

Puteți avea și o secțiune de jurnal în care să poată urmări asistentul de proiect progresul proiectului.

Bibliografie/Resurse

pm/prj2022/agmocanu/snake_game.1653675261.txt.gz · Last modified: 2022/05/27 21:14 by ahmad.shaker
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0