-
Notifications
You must be signed in to change notification settings - Fork 0
/
Puck.h
61 lines (53 loc) · 1.24 KB
/
Puck.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
60
61
//
// puck.h
// gamefinal
//
// Created by Peter Ju on 3/25/15.
// Copyright (c) 2015 Peter Ju. All rights reserved.
//
#pragma once
#define PUCK_HEIGHT SCREEN_HEIGHT * 0.04
#define PUCK_WIDTH SCREEN_WIDTH * 0.035
#define PUCK_BOUNCE_FACTOR_Y .333
#define PUCK_BOUNCE_FACTOR_X .8
#define PUCK_DECEL_X SCREEN_WIDTH / 5
#define PUCK_ACEL_X SCREEN_WIDTH
#define PUCK_MAXVEL 800
#define OFF_SCREEN -20
#include "Kinematic.h"
#include "Platform.h"
#include "ScoreBoard.h"
#include "Net.h"
#include "vec2.h"
//#include "Player.h"
class Puck :
public Kinematic
{
public:
Puck(vec2);
Puck(SDL_Rect, ScoreBoard*);
Puck(SDL_Rect, bool facing_right);
Puck(vector<SDL_Rect>);
Puck(SDL_Point, vector<SDL_Rect>);
Puck(void);
~Puck(void) {};
vec2 vel;
// int *player;
bool possession;
ScoreBoard *sb;
void drop();
void setVelocity(vec2 velocity);
void update(float deltaTime);
void draw();
bool isPossessed();
void OnCollisionEnter(Platform* p, CollisionFace cf, float deltaTime);
void OnCollisionEnter(Net* n, CollisionFace cf, float deltaTime);
void Up() { }
void Down() {}
void Left() {}
void Right() {}
void UpUnpressed() {}
void DownUnpressed() {}
void LeftUnpressed() {}
void RightUnpressed() {}
};