generated from sigonasr2/CPlusPlusProjectTemplate
Add some more cutscene control stuff, fix picking up crops.
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
3e6810bc0f
commit
e4432895b4
@ -554,6 +554,7 @@ public:
|
||||
}
|
||||
|
||||
void ActionButtonPress() {
|
||||
if (playerCanMove()) {
|
||||
switch (GAME_STATE) {
|
||||
case GAMEWORLD:{
|
||||
if (PLAYER_COORDS[0]>=8&&PLAYER_COORDS[0]<12&&
|
||||
@ -565,6 +566,7 @@ public:
|
||||
}
|
||||
}break;
|
||||
}
|
||||
}
|
||||
switch (BATTLE_STATE) {
|
||||
case battle::PLAYER_SELECTION:{
|
||||
if (BATTLE_CARD_SELECTION->playerOwnCount>0) {
|
||||
@ -738,7 +740,6 @@ public:
|
||||
}
|
||||
for (int i=0;i<8;i++) {
|
||||
CUTSCENE_FLAGS[i]=false;
|
||||
CUTSCENE_OBJS[i]=NULL;
|
||||
}
|
||||
CUTSCENE_TIMER=0;
|
||||
}
|
||||
@ -1097,6 +1098,9 @@ public:
|
||||
CUTSCENE_OBJS[0]->flipped=true;
|
||||
CUTSCENE_OBJS[0]->x-=MOVE_SPD;
|
||||
}
|
||||
if (MoveCameraTowardsPoint(GetMapFileCoords(7,11))) {
|
||||
//Go to next part of cutscene.
|
||||
}
|
||||
}break;
|
||||
}
|
||||
|
||||
@ -1843,6 +1847,38 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
bool MoveCameraTowardsPoint(vf2d pos,float spd=BATTLE_CAMERA_SCROLL_SPD) {
|
||||
bool reachedPosition=true;
|
||||
if (PLAYER_COORDS[0]!=pos.x) {
|
||||
if (PLAYER_COORDS[0]<pos.x) {
|
||||
PLAYER_COORDS[0]+=spd;
|
||||
if (PLAYER_COORDS[0]>pos.x) {
|
||||
PLAYER_COORDS[0]=pos.x;
|
||||
}
|
||||
} else {
|
||||
PLAYER_COORDS[0]-=spd;
|
||||
if (PLAYER_COORDS[0]<pos.x) {
|
||||
PLAYER_COORDS[0]=pos.x;
|
||||
}
|
||||
}
|
||||
reachedPosition=false;
|
||||
}
|
||||
if (PLAYER_COORDS[1]!=pos.y) {
|
||||
if (PLAYER_COORDS[1]<pos.y) {
|
||||
PLAYER_COORDS[1]+=spd;
|
||||
if (PLAYER_COORDS[1]>pos.y) {
|
||||
PLAYER_COORDS[1]=pos.y;
|
||||
}
|
||||
} else {
|
||||
PLAYER_COORDS[1]-=spd;
|
||||
if (PLAYER_COORDS[1]<pos.y) {
|
||||
PLAYER_COORDS[1]=pos.y;
|
||||
}
|
||||
}
|
||||
reachedPosition=false;
|
||||
}
|
||||
return reachedPosition;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user