-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStandardSO.cpp
More file actions
52 lines (42 loc) · 1.16 KB
/
Copy pathStandardSO.cpp
File metadata and controls
52 lines (42 loc) · 1.16 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
#include "../koporso/StandardSO.h"
#include <iostream>
#include "ScreenRoot.h"
void StandardSO::drawThis()
{
switch (AnimationState)
{
case lie:
if (set_lie()) // if not in the screen, dont draw
return;
break;
case intr:
set_intro();
break;
case stand:
set_stand();
break;
case outr:
set_outro();
break;
}
ScreenRoot::access().window->draw(*sprite);
}
bool StandardSO::set_lie()
{
if ((xInView(leftTriggerPoint()) && rightTriggerPoint() > getViewLeftBorder())
|| (xInView(rightTriggerPoint()) && leftTriggerPoint() < getViewRightBorder()))
{
in_out_start = gameClock.getElapsedTime(); // start the animation timer for intro
AnimationState = intr; // start the intro
return 0; //not lying anymore
}
return 1; //still lying*/
}
void StandardSO::set_stand()
{
if(rightTriggerPoint() < getViewLeftBorder() || leftTriggerPoint() > getViewRightBorder())
{
in_out_start = gameClock.getElapsedTime(); // start the animation timer for outro
AnimationState = outr; // start the outro
}
}