-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLogLane.h
59 lines (48 loc) · 1.22 KB
/
LogLane.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
55
56
57
58
59
//
// Created by Alexis Rodriguez on 12/4/20.
//
#ifndef FROGGER_LOGLANE_H
#define FROGGER_LOGLANE_H
#include <iostream>
#include <SFML/Graphics.hpp>
#include <cmath>
#include "Log.h"
#include "Direction.h"
#include "Speed.h"
#include "Collision.h"
#include "Frog.h"
#include <list>
#include "LinkedList.h"
enum LANE_NUMBERS{
ONE,
TWO,
THREE,
FOUR,
FIVE
};
class LogLane : public sf::Drawable{
public:
LogLane(int laneNumber = LANE_NUMBERS::ONE, int direction = DIRECTION::LEFT, int speed = SPEEDS::MID);
void move();
void setSpeed(int speed);
void addEvents(sf::RenderTarget& window, Frog& frog);
void draw(sf::RenderTarget& window,sf::RenderStates states) const;
static const int START_Y_POS = 99;
static const int NUM_OF_RAND_LANES = 3;
static const int LANE_Y_OFFSET = 16;
static const int X_POS = 241;
static const int LEFT_X_BOUNDS = 240;
static const int RIGHT_X_BOUNDS = 22;
static const int SPEED = 1; // Full Speed = 1
private:
std::list<Log> logLane;
int laneNumber = 0;
int direction = 0;
float y_pos;
void moveLeft();
void moveRight();
Speed logSpeed;
int count = 0;
int speedOffset = 0;
};
#endif //FROGGER_LOGLANE_H