Skip to content

Commit 2a58a08

Browse files
author
pimathbrainiac
committed
Fixed Flip Line Detection
1 parent ed7f952 commit 2a58a08

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

VVVVVV.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ int can_move_x()
4848
int i;
4949
for(i = 0; i < 20; ++i)
5050
{
51-
if(map1_data[(player_point.y + i) / 8][player_point.x / 8] != 20)
51+
if(map1_data[(player_point.y + i) / 8][player_point.x / 8] > 20)
5252
{
5353
return 0;
5454
}
55-
if(map1_data[(player_point.y + i) / 8][(player_point.x + 9) / 8] != 20)
55+
if(map1_data[(player_point.y + i) / 8][(player_point.x + 9) / 8] > 20)
5656
{
5757
return 0;
5858
}
@@ -65,12 +65,12 @@ int can_move_y()
6565
int i;
6666
for(i = 0; i < 10; ++i)
6767
{
68-
if(map1_data[player_point.y / 8][(player_point.x + i) / 8] != 20)
68+
if(map1_data[player_point.y / 8][(player_point.x + i) / 8] > 20)
6969
{
7070
is_in_air = 0;
7171
return 0;
7272
}
73-
if(map1_data[(player_point.y + 19) / 8][(player_point.x + i) / 8] != 20)
73+
if(map1_data[(player_point.y + 19) / 8][(player_point.x + i) / 8] > 20)
7474
{
7575
is_in_air = 0;
7676
return 0;
@@ -113,13 +113,16 @@ int detect_flip()
113113
int i;
114114
for(i = 0; i < 21; ++i)
115115
{
116-
if((map1_data[(player_point.y + i) / 8][player_point.x / 8] == 4) && !(is_in_flip))
116+
if ((i < 17) && (i > 2))
117117
{
118-
return 1;
119-
}
120-
if((map1_data[(player_point.y + i) / 8][(player_point.x + 9) / 8] == 4) && !(is_in_flip))
121-
{
122-
return 1;
118+
if((map1_data[(player_point.y + i) / 8][player_point.x / 8] == 4) && !(is_in_flip))
119+
{
120+
return 1;
121+
}
122+
if((map1_data[(player_point.y + i) / 8][(player_point.x + 9) / 8] == 4) && !(is_in_flip))
123+
{
124+
return 1;
125+
}
123126
}
124127
if(i < 10)
125128
{

0 commit comments

Comments
 (0)