-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbullet.hpp
More file actions
74 lines (49 loc) · 1.21 KB
/
Copy pathbullet.hpp
File metadata and controls
74 lines (49 loc) · 1.21 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
//
// bullet.hpp
// revenge
//
// Created by Asim on 11/14/16.
// Copyright © 2016 Waleed Al-Haddad. All rights reserved.
//
#ifndef bullet_hpp
#define bullet_hpp
#include <stdio.h>
#include "LTexture.hpp"
#include <stdio.h>
#include <string>
#include <vector>
/*
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
*/
class Bullet
{
public:
//The dimensions of the Bullet
static const int Bullet_WIDTH = 10;
static const int Bullet_HEIGHT = 20;
//Maximum axis velocity of the Bullet
static const int Bullet_VEL = 10;
//Initializes the variables
Bullet( int , int);
Bullet( );
//Takes key presses and adjusts the Bullet's velocity
void handleEvent( SDL_Event& e );
//Moves the Bullet and checks collision
void move( );
//Shows the Bullet on the screen
void render();
//load bullet png
bool loadMedia();
// bullet status
bool isActive;
void close();
//private:
//The X and Y offsets of the Bullet
int mPosX, mPosY;
//The velocity of the Bullet
int mVelX, mVelY;
//Bullet's collision box
SDL_Rect mCollider;
};
#endif /* bullet_hpp */