Páginas

Arduino Game Pong Oled


Game Tênis de Mesa Oled Bluetooth até 2 Jogadores através do Smartphone Android.

Google Play: https://play.google.com/store/apps/details?id=appinventor.ai_antoniosergiosouzaalmeida.Arduino_Game_Pong_Oled

YouTube: https://www.youtube.com/watch?v=8VzGPmHP4Zk




Nesta versão temos como base do projeto o Ardino Uno R3 então utilizamos um display Oled SSD1306 128X64 como Tela Screen principal do Game Pong;
Utilizamos também 2 Módulos Bluetooth HC-06 para 2 Jogadores conectados via Bluetooth  com  celular Android;
Então através do Aplicativo Arduino Game Pong Oled(JOYSTICK)temos acesso e controle sobre o Game Pong.
Essa modalidade com 2 jogadores WIRELESS BLUETOOTH torna o jogo ainda mais competitivo e interessante.

Esquema de ligações: 



Melodia: Marcha Imperial foi implementada na inicialização do Game e reproduzida através de um buzzer ou pequeno alto falante.
Vários outros tons são produzidos ao decorrer do Game.

Com o Aplicativo você pode utilizar até 2 jogadores via Bluetooth:
Na tela principal do App. temos um Joystick:
Dois controladores UP/DOWN;
Botão SELECT, alternar até 10 telas Background;
Botão START, iniciar o Game Pong com SCORE 0 x 0.

Você pode alterar o grau de dificuldade do Game:
Ajustando os valores destas variáveis você pode mudar a dificuldade do jogo. Você pode definir a velocidade da bola, a velocidade da pá, a altura da pá e a pontuação máxima, a fim de fazer o jogo se ajustar ao seu gosto. É isso aí, envie o código para o Arduino e divirta-se!

Como sempre, você pode encontrar o código do projeto, descrição passo a passo,esquema de ligações, lista de materiais, imagens, vídeos do dispositivo montado funcionando e links para as bibliotecas.

Imagens do APP. Arduino Game Pong Oled - Smatphone Android.

Escolha até 10 Backgrounds:
Comandos:
UP/DOWN: Movimenta os paddles para cima e para baixo.
SELECT: Seleciona até 10 background.
START:Inicializa o Game com score 0 X 0.







Escolha até 2 Módulos Bluetooth para conexão(Dois Jogadores).
Obs.: Os nomes podem ser editáveis para facilitar a identificação dos jogadores.
Neste exemplo utilizei 2 x HC-06 com MAC final ":19"Jogador da Esquerda e ":07" Jogador da Direita, conforme figura abaixo.





Informações retiradas da Wikipédia, a enciclopédia livre:
Pong é um jogo eletrônico de esporte em duas dimensões que simula um tênis de mesa. O jogador controla uma paleta (barra vertical) no jogo movendo-a verticalmente no lado esquerdo da tela, e compete contra o  outro jogador que controla uma segunda raquete no lado oposto. Os jogadores usam suas paletas para acertar a esfera (bola) e mandá-la para o outro lado.
A bola aumenta de velocidade cada vez que é rebatida, reiniciando a velocidade caso algum dos jogadores não acerte a bola. O objetivo é fazer mais pontos que seu oponente, fazendo com que o oponente não consiga retornar a bola para o outro lado.

Pong foi o primeiro jogo desenvolvido pela Atari Inc., fundada em junho de 1972 por Nolan Bushnell e Ted Dabney. Depois de produzir Computer Space, Bushnell decidiu formar a empresa para produzir mais jogos ao licenciar ideias de outras empresas.

Lista de Materiais:

- Arduino Uno R3;
- Display Oled 128X64  - SSD-1306(White/Branco);
- Módulo Bluetooth(JY-MCU ou HC6);
- Buzzer - cápsula piezoelétrica ou mini alto falante(220ohms), se  necessário use um resistor para      não danificar a porta Arduino  máximo 20mA(resistor 220ohms);
- Fios para Jumpers - wire jumpers;
- Mini Protoboard.

Bibliotecas / Downloads / Links:

Código Arduino Game Pong Oled: https://www.dropbox.com/sh/j49o1b98s58qk6l/AACY-3MrWwlhJTft5Hi2HeZUa?dl=0
Adafruit_GFX: https://www.dropbox.com/sh/75vnnvdu7flxolz/AAC0WDntfPOgk8rBgzwkRfWua?dl=0
Adafruit_SSD1306: https://www.dropbox.com/sh/kslz6949ksi2de6/AAD-GulNSMPvydGvEeWH_h4Ca?dl=0
Google Play: https://play.google.com/store/apps/details?id=appinventor.ai_antoniosergiosouzaalmeida.Arduino_Game_Pong_Oled
YouTube: https://www.youtube.com/watch?v=8VzGPmHP4Zk


Código Arduino: Arduino Game Pong Oled.

Link:  https://www.dropbox.com/sh/j49o1b98s58qk6l/AACY-3MrWwlhJTft5Hi2HeZUa?dl=0

//Melodia: Marcha Imperial.
//------Nota musical com sua frequência correspondente.
#define  C0 16.35
#define Db0 17.32
#define D0  18.35
#define Eb0 19.45
#define E0  20.60
#define F0  21.83
#define Gb0 23.12
#define G0  24.50
#define Ab0 25.96
#define LA0 27.50
#define Bb0 29.14
#define B0  30.87
#define C1  32.70
#define Db1 34.65
#define D1  36.71
#define Eb1 38.89
#define E1  41.20
#define F1  43.65
#define Gb1 46.25
#define G1  49.00
#define Ab1 51.91
#define LA1 55.00
#define Bb1 58.27
#define B1  61.74
#define C2  65.41
#define Db2 69.30
#define D2  73.42
#define Eb2 77.78
#define E2  82.41
#define F2  87.31
#define Gb2 92.50
#define G2  98.00
#define Ab2 103.83
#define LA2 110.00
#define Bb2 116.54
#define B2  123.47
#define C3  130.81
#define Db3 138.59
#define D3  146.83
#define Eb3 155.56
#define E3  164.81
#define F3  174.61
#define Gb3 185.00
#define G3  196.00
#define Ab3 207.65
#define LA3 220.00
#define Bb3 233.08
#define B3  246.94
#define C4  261.63
#define Db4 277.18
#define D4  293.66
#define Eb4 311.13
#define E4  329.63
#define F4  349.23
#define Gb4 369.99
#define G4  392.00
#define Ab4 415.30
#define LA4 440.00
#define Bb4 466.16
#define B4  493.88
#define C5  523.25
#define Db5 554.37
#define D5  587.33
#define Eb5 622.25
#define E5  659.26
#define F5  698.46
#define Gb5 739.99
#define G5  783.99
#define Ab5 830.61
#define LA5 880.00
#define Bb5 932.33
#define B5  987.77
#define C6  1046.50
#define Db6 1108.73
#define D6  1174.66
#define Eb6 1244.51
#define E6  1318.51
#define F6  1396.91
#define Gb6 1479.98
#define G6  1567.98
#define Ab6 1661.22
#define LA6 1760.00
#define Bb6 1864.66
#define B6  1975.53
#define C7  2093.00
#define Db7 2217.46
#define D7  2349.32
#define Eb7 2489.02
#define E7  2637.02
#define F7  2793.83
#define Gb7 2959.96
#define G7  3135.96
#define Ab7 3322.44
#define LA7 3520.01
#define Bb7 3729.31
#define B7  3951.07
#define C8  4186.01
#define Db8 4434.92
#define D8  4698.64
#define Eb8 4978.03
// Duração das notas musicais.
#define BPM 120    //  you can change this value changing all the others
#define H 2*Q //half 2/4
#define Q 60000/BPM //quarter 1/4
#define E Q/2   //eighth 1/8
#define S Q/4 // sixteenth 1/16
#define W 4*Q // whole 4/4
//---------------------------
//Definição de Imagens.
const unsigned char pong1 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
0x78, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
0x60, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x1F, 0xF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xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};
//----------------------------------
//Definição das seriais.
// SoftwareSerial portOne(2, 3);//Arduino 2-RX(BT-Pino TX), Arduino 3-TX(BT-Pino RX);
 //SoftwareSerial portTwo(0, 1);//Arduino 0-RX(BT-Pino TX), Arduino 1-TX(BT-Pino RX);
//----------------------------------
//Definição de bibliotecas.
#include <SoftwareSerial.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
//Definição das seriais.
SoftwareSerial portOne(2, 3);//Arduino 2-RX(BT-Pino TX), Arduino 3-TX(BT-Pino RX);
//SoftwareSerial portTwo(0, 1);//Arduino 0-RX(BT-Pino TX), Arduino 1-TX(BT-Pino RX);
//----------------------------------
//Definição dos pinos
#define OLED_RESET 5
#define BEEPER 4
//----------------------------------
//Definição visual lay out do display.
#define FONT_SIZE 2
#define SCREEN_WIDTH 127 //real size minus 1, because coordinate system starts with 0
#define SCREEN_HEIGHT 63 //31 real size minus 1, because coordinate system starts with 0
#define PADDLE_WIDTH 4
#define PADDLE_HEIGHT 10
#define PADDLE_PADDING 10
#define BALL_SIZE 3//3
#define SCORE_PADDING 10
//----------------------------------
//Definição de efeitos.
#define EFFECT_SPEED 0.5//0.5
#define MIN_Y_SPEED 0.5
#define MAX_Y_SPEED 2//2
//----------------------------------
//Definição de variáveis.
Adafruit_SSD1306 display(OLED_RESET);
int paddleLocationA = 0;
int paddleLocationB = 0;
float ballX = SCREEN_WIDTH/2;
float ballY = SCREEN_HEIGHT/2;
float ballSpeedX = 2;
float ballSpeedY = 1;
int lastPaddleLocationA = 0;
int lastPaddleLocationB = 0;
int scoreA = 0;
int scoreB = 0;
int controlA;
int controlB;
//-----------------------------
//Parametros do display.
#if (SSD1306_LCDHEIGHT != 64)//32
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif
//-----------------------------
void setup()
{
digitalWrite(BEEPER, LOW);//Inicializa beep em nível baixo.
Serial.begin(9600);//Inicializa serial.
 while (!Serial) {
  }
 portOne.begin(9600);//Serial de dados do Módulo1 Bluetooth;
 //portTwo.begin(9600);//Serial de dados do Módulo2 Bluetooth;
  //--------------------------
  //Verifique qual é o endereço I2C de seu display.
   display.begin(SSD1306_SWITCHCAPVCC, 0x78>>1);//Inicializa display 128X64 endereço 0x78.
   display.clearDisplay();//Limpa o buffer do display.
   display.display();//Mostrar a imagem no display.
   display.setTextWrap(false);
   //Faz chamada da imagem pong1 posição x=0, y=0, tamanho 128x64 pixels cor branco.
   display.drawBitmap(0, 0, pong1, 128, 64, WHITE);
   display.display();//Mostrar a imagem no display.
   delay(1000);//Tempo de apresentação de 1s.
   display.clearDisplay();//Limpa o buffer do display.
   display.drawBitmap(0, 0, Arduino128X64, 128, 64, WHITE);
   display.display();
   delay(1000);
   display.clearDisplay();
   display.drawBitmap(0, 0, AppStore128X64, 128, 64, WHITE);
   display.display();
   delay(1000);
   display.clearDisplay();
   display.drawBitmap(0, 0, Android128X64, 128, 64, WHITE);
   display.display();
   delay(1000);
   display.clearDisplay();
   //---------------------------
   display.setTextWrap(false);
   splash();
   display.setTextColor(WHITE);//Seleciona cor branco.
   display.setTextSize(FONT_SIZE);//Tamanho da fonte.
   display.clearDisplay();//Limpa o buffer do display.
  //----------------------------;
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  //display.setTextColor(WHITE);
  //display.setTextSize(1);
  display.println("Arduino Uno");
  display.println("Bluetooth");
  display.println("Oled 128X64");
  display.println("Android");
  display.println("Version:1.0.3 - 2017");
  display.setTextSize(0);
  display.println();
  display.println("sergioarduino");    
  display.display();//Envia o texto acima para o display.
  delay(3000);//Tempo de apresentação 3s.
  soundMelody();
  //-------------------------
  display.setTextColor(WHITE);
  display.setTextSize(FONT_SIZE);
  display.clearDisplay();
 }
 //--------------------------

void splash()
 {
  display.clearDisplay();
  display.setTextColor(WHITE);
  centerPrint("PONG",0,3);
  display.fillRect(0,SCREEN_HEIGHT-10,SCREEN_WIDTH,10,WHITE);
  display.setTextColor(BLACK);
  centerPrint("Move paddle to start!",SCREEN_HEIGHT-9,1);
  display.display();
  delay(3000);
 //-------------------------
  soundStart();//Inicializa o som.
  soundStart();//Inicializa o som.
}

void loop()
{

 //Jogador A.
 
 portOne.listen();
 while (portOne.available() >0) {
 delay(3);

 char caracter = portOne.read();//Lendo o caracter da serial portOne.
if(caracter == 'b')
{
 (controlA=controlA+200);
}
if(caracter == 'a')
{
 (controlA=controlA-200);
}
if(caracter == 'S')
{
 controlA == controlA;
}
if(caracter == 's')
{
 scoreA = 0;
 scoreB = 0;
}
Serial.write(caracter);
}

//Jogador B
//portTwo.listen();
 while (Serial.available() >0) {
  delay(3);

char caracterB = Serial.read();//Lendo o caracter da serial.

if(caracterB == 'b')
{
 (controlB=controlB+200);
}
if(caracterB == 'a')
{
 (controlB=controlB-200);
}
if(caracterB == 'S')
{
 controlB == controlB;
}
if(caracterB == 's')
{
 scoreA = 0;
 scoreB = 0;
}
Serial.write(caracterB);
 }
 //-----------------------------
  calculateMovement();
  draw();
}
//-----------------------------
void calculateMovement()
{

 if(controlA>=1023){
controlA=1023;
 }
 if(controlA<=0){
controlA=0;
 }
 if(controlB>=1023){
controlB=1023;
 }
 if(controlB<=0){
controlB=0;
 }
 //------------------------------
  paddleLocationA = map(controlA, 0, 1023, 0, SCREEN_HEIGHT - PADDLE_HEIGHT);
  paddleLocationB = map(controlB, 0, 1023, 0, SCREEN_HEIGHT - PADDLE_HEIGHT);

  int paddleSpeedA = paddleLocationA - lastPaddleLocationA;
  int paddleSpeedB = paddleLocationB - lastPaddleLocationB;

  ballX += ballSpeedX;
  ballY += ballSpeedY;

  if (ballY >= SCREEN_HEIGHT - BALL_SIZE || ballY <= 0) {
    ballSpeedY *= -1;
    soundBounce();
  }

  if (ballX >= PADDLE_PADDING && ballX <= PADDLE_PADDING+BALL_SIZE && ballSpeedX < 0) {
    if (ballY > paddleLocationA - BALL_SIZE && ballY < paddleLocationA + PADDLE_HEIGHT) {
      soundBounce();
      ballSpeedX *= -1;
 
      addEffect(paddleSpeedA);
    }

  }

  if (ballX >= SCREEN_WIDTH-PADDLE_WIDTH-PADDLE_PADDING-BALL_SIZE && ballX <= SCREEN_WIDTH-PADDLE_PADDING-BALL_SIZE && ballSpeedX > 0) {
    if (ballY > paddleLocationB - BALL_SIZE && ballY < paddleLocationB + PADDLE_HEIGHT) {
      soundBounce();
      ballSpeedX *= -1;
 
      addEffect(paddleSpeedB);
    }

  }
  //----------------------------------
  //Calculo da pontuação.
  if (ballX >= SCREEN_WIDTH - BALL_SIZE || ballX <= 0) {
    if (ballSpeedX > 0) {
      scoreA++;
      ballX = SCREEN_WIDTH / 4;
    }
    if (ballSpeedX < 0) {
      scoreB++;
      ballX = SCREEN_WIDTH / 4 * 3;
    }

    soundPoint();//Som.
  }

  //Ajuste da ultima localização dos Paddles.
  lastPaddleLocationA = paddleLocationA;
  lastPaddleLocationB = paddleLocationB;
}

void draw()//Desenhos.
{
  display.clearDisplay();
  //Desenho paddle A.
  display.fillRect(PADDLE_PADDING,paddleLocationA,PADDLE_WIDTH,PADDLE_HEIGHT,WHITE);

  //Desenho paddle B.
  display.fillRect(SCREEN_WIDTH-PADDLE_WIDTH-PADDLE_PADDING,paddleLocationB,PADDLE_WIDTH,PADDLE_HEIGHT,WHITE);

  //Desenhar linha central.
  for (int i=0; i<SCREEN_HEIGHT; i+=4) {
    display.drawFastVLine(SCREEN_WIDTH/2, i, 2, WHITE);
  }

  //Desenhar bola.
  display.fillRect(ballX,ballY,BALL_SIZE,BALL_SIZE,WHITE);

  //Mostrar pontuação.
  int scoreAWidth = 5 * FONT_SIZE;
  if (scoreA > 9) scoreAWidth += 6 * FONT_SIZE;
  if (scoreA > 99) scoreAWidth += 6 * FONT_SIZE;
  if (scoreA > 999) scoreAWidth += 6 * FONT_SIZE;
  if (scoreA > 9999) scoreAWidth += 6 * FONT_SIZE;
  display.setCursor(SCREEN_WIDTH/2 - SCORE_PADDING - scoreAWidth,0);
  display.print(scoreA);
  display.setCursor(SCREEN_WIDTH/2 + SCORE_PADDING+1,0); //+1 because of dotted line.
  display.print(scoreB);
  display.display();
}

void addEffect(int paddleSpeed)//Adicionar efeitos para os Paddles e velocidade da bola.
{
  float oldBallSpeedY = ballSpeedY;
  for (int effect = 0; effect < abs(paddleSpeed); effect++) {
    if (paddleSpeed > 0) {
      ballSpeedY += EFFECT_SPEED;
    } else {
      ballSpeedY -= EFFECT_SPEED;
    }
  }

  //Limitar a velocidade mínima da bola.
  if (ballSpeedY < MIN_Y_SPEED && ballSpeedY > -MIN_Y_SPEED) {
    if (ballSpeedY > 0) ballSpeedY = MIN_Y_SPEED;
    if (ballSpeedY < 0) ballSpeedY = -MIN_Y_SPEED;
    if (ballSpeedY == 0) ballSpeedY = oldBallSpeedY;
  }

  //Limitar a velocidade máxima da bola.
  if (ballSpeedY > MAX_Y_SPEED) ballSpeedY = MAX_Y_SPEED;
  if (ballSpeedY < -MAX_Y_SPEED) ballSpeedY = -MAX_Y_SPEED;
}

void soundStart()//Inicializa o som.
{
  tone(BEEPER, 250);
  delay(100);
  tone(BEEPER, 500);
  delay(100);
  tone(BEEPER, 1000);
  delay(100);
  noTone(BEEPER);
}
//--------------------------
void soundMelody()//Inicializa o som.
{
  //Melodia Marcha Imperial.
  //Tom(pino, nota, duração).
    tone(4,LA3,Q);
    delay(1+Q); //delay duration should always be 1 ms more than the note in order to separate them.
    tone(4,LA3,Q);
    delay(1+Q);
    tone(4,LA3,Q);
    delay(1+Q);
    tone(4,F3,E+S);
    delay(1+E+S);
    tone(4,C4,S);
    delay(1+S);
 
    tone(4,LA3,Q);
    delay(1+Q);
    tone(4,F3,E+S);
    delay(1+E+S);
    tone(4,C4,S);
    delay(1+S);
    tone(4,LA3,H);
    delay(1+H);
 
    tone(4,E4,Q);
    delay(1+Q);
    tone(4,E4,Q);
    delay(1+Q);
    tone(4,E4,Q);
    delay(1+Q);
    tone(4,F4,E+S);
    delay(1+E+S);
    tone(4,C4,S);
    delay(1+S);
 
    tone(4,Ab3,Q);
    delay(1+Q);
    tone(4,F3,E+S);
    delay(1+E+S);
    tone(4,C4,S);
    delay(1+S);
    tone(4,LA3,H);
    delay(1+H);
 
    tone(4,LA4,Q);
    delay(1+Q);
    tone(4,LA3,E+S);
    delay(1+E+S);
    tone(4,LA3,S);
    delay(1+S);
    tone(4,LA4,Q);
    delay(1+Q);
    tone(4,Ab4,E+S);
    delay(1+E+S);
    tone(4,G4,S);
    delay(1+S);
 
    tone(4,Gb4,S);
    delay(1+S);
    tone(4,E4,S);
    delay(1+S);
    tone(4,F4,E);
    delay(1+E);
    delay(1+E);//PAUSE
    tone(4,Bb3,E);
    delay(1+E);
    tone(4,Eb4,Q);
    delay(1+Q);
    tone(4,D4,E+S);
    delay(1+E+S);
    tone(4,Db4,S);
    delay(1+S);
 
    tone(4,C4,S);
    delay(1+S);
    tone(4,B3,S);
    delay(1+S);
    tone(4,C4,E);
    delay(1+E);
    delay(1+E);//PAUSE
    tone(4,F3,E);
    delay(1+E);
    tone(4,Ab3,Q);
    delay(1+Q);
    tone(4,F3,E+S);
    delay(1+E+S);
    tone(4,LA3,S);
    delay(1+S);
 
    tone(4,C4,Q);
    delay(1+Q);
     tone(4,LA3,E+S);
    delay(1+E+S);
    tone(4,C4,S);
    delay(1+S);
    tone(4,E4,H);
    delay(1+H);
 
     tone(4,LA4,Q);
    delay(1+Q);
    tone(4,LA3,E+S);
    delay(1+E+S);
    tone(4,LA3,S);
    delay(1+S);
    tone(4,LA4,Q);
    delay(1+Q);
    tone(4,Ab4,E+S);
    delay(1+E+S);
    tone(4,G4,S);
    delay(1+S);
 
    tone(4,Gb4,S);
    delay(1+S);
    tone(4,E4,S);
    delay(1+S);
    tone(4,F4,E);
    delay(1+E);
    delay(1+E);//PAUSE
    tone(4,Bb3,E);
    delay(1+E);
    tone(4,Eb4,Q);
    delay(1+Q);
    tone(4,D4,E+S);
    delay(1+E+S);
    tone(4,Db4,S);
    delay(1+S);
 
    tone(4,C4,S);
    delay(1+S);
    tone(4,B3,S);
    delay(1+S);
    tone(4,C4,E);
    delay(1+E);
    delay(1+E);//PAUSE
    tone(4,F3,E);
    delay(1+E);
    tone(4,Ab3,Q);
    delay(1+Q);
    tone(4,F3,E+S);
    delay(1+E+S);
    tone(4,C4,S);
    delay(1+S);
 
    tone(4,LA3,Q);
    delay(1+Q);
    tone(4,F3,E+S);
    delay(1+E+S);
    tone(4,C4,S);
    delay(1+S);
    tone(4,LA3,H);
    delay(1+H);
 
    delay(2*H);
 
}
//---------------------------

void soundBounce()//Tons.
{
  tone(BEEPER, 500, 50);
}

void soundPoint()
{
  tone(BEEPER, 150, 150);
}

void centerPrint(char *text, int y, int size)//Funções de texto, tamanho da fonte e display.
{
  display.setTextSize(size);
  display.setCursor(SCREEN_WIDTH/2 - ((strlen(text))*6*size)/2,y);
  display.print(text);

}






Nenhum comentário:

Postar um comentário