Fix CP bug
This commit is contained in:
parent
7fb04804e7
commit
4cc592b0f5
4 changed files with 36 additions and 36 deletions
2
TODO.txt
2
TODO.txt
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
=========== BUGS =================
|
=========== BUGS =================
|
||||||
|
|
||||||
- was able to take a CP without it changing color to gray, try to reproduce
|
|
||||||
- drawing dithered transparent objects fills z-buffer in the transparent parts
|
- drawing dithered transparent objects fills z-buffer in the transparent parts
|
||||||
and then the geometry behind it isn't drawn <- PARTIALLY FIXED NOW
|
and then the geometry behind it isn't drawn <- PARTIALLY FIXED NOW
|
||||||
|
|
||||||
|
@ -45,6 +44,7 @@
|
||||||
AND frontend doesn't have to use RGB565 (it can basically choose any mode).
|
AND frontend doesn't have to use RGB565 (it can basically choose any mode).
|
||||||
- drifting: passing some upper threshold on steering force should reduce
|
- drifting: passing some upper threshold on steering force should reduce
|
||||||
steering friction until reaching some some lower threshold again probably
|
steering friction until reaching some some lower threshold again probably
|
||||||
|
- was able to take a CP without it changing color to gray, try to reproduce
|
||||||
- Environments: just different textures for a cube inside which the tarck is,
|
- Environments: just different textures for a cube inside which the tarck is,
|
||||||
the cube won't have the top side, texture can have transparency (sky see
|
the cube won't have the top side, texture can have transparency (sky see
|
||||||
through) <-- NO
|
through) <-- NO
|
||||||
|
|
2
game.h
2
game.h
|
@ -847,8 +847,8 @@ uint8_t LCR_gameStep(uint32_t time)
|
||||||
{
|
{
|
||||||
int carBlock[3];
|
int carBlock[3];
|
||||||
|
|
||||||
LCR_racingGetCarBlockCoords(carBlock);
|
|
||||||
LCR_LOG1("CP taken");
|
LCR_LOG1("CP taken");
|
||||||
|
LCR_racingGetCarBlockCoords(carBlock);
|
||||||
LCR_rendererMarkTakenCP(carBlock[0],carBlock[1],carBlock[2]);
|
LCR_rendererMarkTakenCP(carBlock[0],carBlock[1],carBlock[2]);
|
||||||
LCR_audioPlaySound(LCR_SOUND_CLICK);
|
LCR_audioPlaySound(LCR_SOUND_CLICK);
|
||||||
}
|
}
|
||||||
|
|
66
racing.h
66
racing.h
|
@ -1043,39 +1043,6 @@ uint32_t LCR_racingStep(unsigned int input)
|
||||||
LCR_racing.fanForce = 0;
|
LCR_racing.fanForce = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int carBlock[3];
|
|
||||||
|
|
||||||
LCR_racingGetCarBlockCoords(carBlock);
|
|
||||||
|
|
||||||
carBlock[0] = LCR_mapGetBlockAt(carBlock[0],carBlock[1],carBlock[2]);
|
|
||||||
|
|
||||||
if (carBlock[0] >= 0)
|
|
||||||
{
|
|
||||||
if (LCR_currentMap.blocks[carBlock[0] * LCR_BLOCK_SIZE] ==
|
|
||||||
LCR_BLOCK_CHECKPOINT_0)
|
|
||||||
{
|
|
||||||
LCR_currentMap.blocks[carBlock[0] * LCR_BLOCK_SIZE] =
|
|
||||||
LCR_BLOCK_CHECKPOINT_1;
|
|
||||||
|
|
||||||
result |= LCR_RACING_EVENT_CP_TAKEN;
|
|
||||||
}
|
|
||||||
else if (LCR_currentMap.blocks[carBlock[0] * LCR_BLOCK_SIZE] ==
|
|
||||||
LCR_BLOCK_FINISH)
|
|
||||||
{
|
|
||||||
int valid = 1;
|
|
||||||
|
|
||||||
for (int i = 0; i < LCR_currentMap.blockCount; ++i)
|
|
||||||
if (LCR_currentMap.blocks[i * LCR_BLOCK_SIZE] == LCR_BLOCK_CHECKPOINT_0)
|
|
||||||
{
|
|
||||||
valid = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (valid)
|
|
||||||
result |= LCR_RACING_EVENT_FINISHED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LCR_LOG2("gonna step physics engine");
|
LCR_LOG2("gonna step physics engine");
|
||||||
TPE_worldStep(&(LCR_racing.physicsWorld));
|
TPE_worldStep(&(LCR_racing.physicsWorld));
|
||||||
LCR_LOG2("stepping physics engine done");
|
LCR_LOG2("stepping physics engine done");
|
||||||
|
@ -1202,6 +1169,39 @@ uint32_t LCR_racingStep(unsigned int input)
|
||||||
LCR_racing.carOKPositions[i] = LCR_racing.carBody.joints[i].position;
|
LCR_racing.carOKPositions[i] = LCR_racing.carBody.joints[i].position;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int carBlock[3];
|
||||||
|
|
||||||
|
LCR_racingGetCarBlockCoords(carBlock);
|
||||||
|
|
||||||
|
carBlock[0] = LCR_mapGetBlockAt(carBlock[0],carBlock[1],carBlock[2]);
|
||||||
|
|
||||||
|
if (carBlock[0] >= 0)
|
||||||
|
{
|
||||||
|
if (LCR_currentMap.blocks[carBlock[0] * LCR_BLOCK_SIZE] ==
|
||||||
|
LCR_BLOCK_CHECKPOINT_0)
|
||||||
|
{
|
||||||
|
LCR_currentMap.blocks[carBlock[0] * LCR_BLOCK_SIZE] =
|
||||||
|
LCR_BLOCK_CHECKPOINT_1;
|
||||||
|
|
||||||
|
result |= LCR_RACING_EVENT_CP_TAKEN;
|
||||||
|
}
|
||||||
|
else if (LCR_currentMap.blocks[carBlock[0] * LCR_BLOCK_SIZE] ==
|
||||||
|
LCR_BLOCK_FINISH)
|
||||||
|
{
|
||||||
|
int valid = 1;
|
||||||
|
|
||||||
|
for (int i = 0; i < LCR_currentMap.blockCount; ++i)
|
||||||
|
if (LCR_currentMap.blocks[i * LCR_BLOCK_SIZE] == LCR_BLOCK_CHECKPOINT_0)
|
||||||
|
{
|
||||||
|
valid = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (valid)
|
||||||
|
result |= LCR_RACING_EVENT_FINISHED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LCR_racing.tick++;
|
LCR_racing.tick++;
|
||||||
|
|
||||||
LCR_LOG2("racing step end");
|
LCR_LOG2("racing step end");
|
||||||
|
|
|
@ -184,7 +184,7 @@
|
||||||
|
|
||||||
#ifndef LCR_SETTING_COUNTDOWN_SECONDS
|
#ifndef LCR_SETTING_COUNTDOWN_SECONDS
|
||||||
/** Run start countdown length in seconds. */
|
/** Run start countdown length in seconds. */
|
||||||
#define LCR_SETTING_COUNTDOWN_SECONDS 3
|
#define LCR_SETTING_COUNTDOWN_SECONDS 1 // for release make 3
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|
Loading…
Reference in a new issue