@@ -800,9 +800,18 @@ void Fighter::act() {
800
800
fall ();
801
801
}
802
802
else if (Pad.Newpress .Right && direction == RIGHT) {
803
- y = y+hangy-bottomside;
804
803
myledge = -1 ;
805
- x = x + 64 - hangx - leftside;
804
+ x = x + 80 - hangx - leftside;
805
+ vector<Floor> floors = stage->getFloors ();
806
+ for (uint8 n = 0 ; n < floors.size (); n++) {
807
+ Floor currfloor = floors[n];
808
+ double centerx = x + rightside/2.0 ;
809
+ double slope = currfloor.rise *1.0 /currfloor.length ;
810
+ double rise = (centerx-currfloor.x )*slope;
811
+ if (centerx > currfloor.x && centerx < currfloor.x + currfloor.length ) {
812
+ y = currfloor.y - bottomside - rise;
813
+ }
814
+ }
806
815
idle ();
807
816
}
808
817
else if (Pad.Newpress .Right && direction == LEFT) {
@@ -1142,23 +1151,45 @@ void Fighter::tech() {
1142
1151
void Fighter::rollUp () {
1143
1152
if (action == HANG) {
1144
1153
myledge = -1 ;
1145
- y = y + hangy - bottomside;
1146
1154
if (direction == LEFT) {
1147
1155
x = x + hangx - rightside;
1156
+ }
1157
+ else {
1158
+ x = x + 80 - hangx - leftside;
1159
+ }
1160
+ vector<Floor> floors = stage->getFloors ();
1161
+ for (uint8 n = 0 ; n < floors.size (); n++) {
1162
+ Floor currfloor = floors[n];
1163
+ double centerx = x + rightside/2.0 ;
1164
+ double slope = currfloor.rise *1.0 /currfloor.length ;
1165
+ double rise = (centerx-currfloor.x )*slope;
1166
+ if (centerx > currfloor.x && centerx < currfloor.x + currfloor.length ) {
1167
+ y = currfloor.y - bottomside - rise;
1168
+ }
1169
+ }
1170
+ if (direction == LEFT) {
1148
1171
roll (LEFT);
1149
1172
}
1150
1173
else {
1151
- x = x + 64 - hangx - leftside;
1152
1174
roll (RIGHT);
1153
1175
}
1154
1176
}
1155
1177
}
1156
1178
void Fighter::attackUp () {
1157
1179
if (action == HANG) {
1158
1180
myledge = -1 ;
1159
- y = y + hangy - bottomside;
1160
1181
if (direction == LEFT) x = x + hangx - rightside;
1161
- else x = x + 64 - hangx - leftside;
1182
+ else x = x + 80 - hangx - leftside;
1183
+ vector<Floor> floors = stage->getFloors ();
1184
+ for (uint8 n = 0 ; n < floors.size (); n++) {
1185
+ Floor currfloor = floors[n];
1186
+ double centerx = x + rightside/2.0 ;
1187
+ double slope = currfloor.rise *1.0 /currfloor.length ;
1188
+ double rise = (centerx-currfloor.x )*slope;
1189
+ if (centerx > currfloor.x && centerx < currfloor.x + currfloor.length ) {
1190
+ y = currfloor.y - bottomside - rise;
1191
+ }
1192
+ }
1162
1193
ftilt ();
1163
1194
}
1164
1195
}
0 commit comments