This repository has been archived by the owner on Jan 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
chadD.h
160 lines (131 loc) · 3.29 KB
/
chadD.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#ifndef PLATFORM_H
#define PLATFORM_H
//Chad Danner
//cs335
//HW3
//05-11-15
//=====================================================================
// Platform
//=====================================================================
//How To Use...
//
////Global
// Platform var1; //This Sets Up The Platform Varaible
//
// within init_opengl function // in main.cpp
// add
// var1.insert("./images/"ppm file"", columns, rows);
// var1.init(width, height, x-cord, y-cord);
// var1.setupTile();
//
// within the movement function
// groundCollide(hero, &var1);
//
// within the render function
// var1.drawRow(0,0);
//
#include "Sprite.h"
#include "Object.h"
#include "Enemy.h"
#include "Player.h"
#include <iostream>
class Platform : public Sprite, public Object {
private:
int lineSpaceX;
int lineSpaceY;
public:
Platform();
void setupTile();
void drawRow();
void saveLineSpace();
void drawRow(int x, int y);
};
class Attack: public Object {
private:
Object *target;
int spriteID;
int rowAt;
int columnAt;
int timer;
int frameRate;
int duration;
int once;
int cycle;
int onceOnly;
int direction;
int byo;
int attackSound;
int soundCollide;
bool stop;
bool start;
bool timeBase; //If This Is On | Attack Will Last on its Duration
bool cycleBase;//If This is On | Attack Will Last until the
// end of the sprite sheet
int indexp;
int damage;
int charges;
int pushForce;
int backForce;
bool pulling;
bool infiniteCharges;
bool singleUse;
bool constantEffect;
bool effectEnemy;
bool effectPlayer;
bool pushAway;
bool pushBack;
bool invincible;
bool invisiblity;
bool hurtOnce;
bool stickOn;
bool moveWith;
timeval seqStartA, seqEndA;
timeval timeIn, timeOut;
public:
Attack();
~Attack();
Object *Clone(){ return new Attack(*this); }
void targetAt(Object *target);
void referenceTo(Sprite take, int id);
int checkSpriteID();
void fakeCopy(Attack * other);
void changeRate(int take);
void setDuration(int take);
void checkDuration();
void setTimeBase(bool take);
void setCycleBase(bool take);
void setStickOn(bool take);
void setMoveWith(bool take);
void setPushAway(bool take);
void setPushBack(bool take);
void setForwardForce(int take);
void setBackForce(int take);
void setPulling(bool take);
void setEffectEnemy(bool take);
void setEffectPlayer(bool take);
void setConstantEffect(bool take);
void setCharges(int take);
void setInfiniteCharges(bool take);
void setInvincible(bool take);
void setInvisiblity(bool take);
void setDamage(int take);
void returnVelocity();
bool checkStop();
void setSound(int take);
int getSound();
void setAttackSound(int take);
int getAttackSound();
void setSoundCollide(int take);
int getSoundCollide();
void autoState();
void stickOnHero();
void moveWithHero();
void pushAwayForce(Object *obj);
void pushBackSelf();
void pullingIn(Enemy *enemy);
void causeEffect(Player *hero);
void causeEffect(Enemy *enemy);
void cycleAnimations();
void drawBox(Sprite targetSprite);
};
#endif