-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathPlayer.h
54 lines (47 loc) · 1.48 KB
/
Player.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* 1D Pong - Pong-like game run on an Arduino MCU
* Copyright (C) 2018 Stephan Riedel - [email protected]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Player.h
#ifndef PLAYER_H
#define PLAYER_H
#if defined(ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif
#include <FastLED.h>
#include "Button.h"
class Player {
public:
Player();
Player(uint8_t lifes, uint8_t hitbox_min, uint8_t hitbox_max, uint8_t input_pin, uint16_t lock_time, CRGB lifes_color, CRGB lost_lifes_color);
uint8_t lifes;
uint8_t initial_lifes;
uint8_t hitbox_min;
uint8_t hitbox_max;
Button button;
bool serve;
CRGB lifes_color;
CRGB lost_lifes_color;
unsigned long time = 0;
unsigned long serve_time = 3000;
uint8_t lose_life();
void reset_lifes();
uint8_t get_off_position();
uint8_t get_autoserve_position();
};
#endif