-
Notifications
You must be signed in to change notification settings - Fork 1
/
GameControl.h
51 lines (46 loc) · 1.23 KB
/
GameControl.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
#pragma once
#include "TheFlyWin32.h"
#include "ActorStateMachine.h"
#define MOVE_FORWARD 0
#define MOVE_BACK 1
#define MOVE_LEFT 2
#define MOVE_RIGHT 3
typedef int DIRECTION_CODE;
class GameControl
{
//protected:
public:
//ACTORid mainChar;
ActorStateMachine *mainChar;
OBJECTid camera;
float dir[3];
//float actorOldPosition[3];
float cameraTargetPos[3];
public:
GameControl(void);
virtual ~GameControl(void);
GameControl(ActorStateMachine * mainChar, OBJECTid camera);
virtual int DirControl() = 0;
BOOL CharacterMoveForward(DIRECTION_CODE code);
BOOL CharacterNormalAttack();
BOOL CharacterSetIdle();
int TurnToTargetDir(float degree = 30.0f);
BOOL isOnTargetDir();
int GenerateTargetDir(DIRECTION_CODE code); //return the angle from CalcLeftRight()
int Rotate(float theta, float vector[2]);
void CalcLeftRight(DIRECTION_CODE code); //return the angle the object should turn
//void CamFallow();
//void CamBackOff();
void CamPointToActor();
int CamRevolution(DIRECTION_CODE code);
void CamUpdate();
void InitCamTargetPos(float pos[3]);
BOOL AppendAttackCode(ATTACK_CODE code);
void PlayAction(int skip);
void ResetCamView();
protected:
void CamMove(float skip);
private:
int dir_normalize(float pos[3]);
BOOL CamInTop;
};