Skip to content

Commit

Permalink
v0.94 bugfix turning while paused. Added more personal times, add bui…
Browse files Browse the repository at this point in the history
…ld batch files
  • Loading branch information
tonym128 committed Dec 5, 2023
1 parent a5b0b68 commit 7ac169d
Show file tree
Hide file tree
Showing 9 changed files with 978 additions and 959 deletions.
1,878 changes: 938 additions & 940 deletions Extra/ArduRacerFx.hex

Large diffs are not rendered by default.

Binary file modified Extra/fxdata-data.bin
Binary file not shown.
Binary file modified Extra/fxdata.bin
Binary file not shown.
5 changes: 5 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
echo "Build application"
arduino-cli compile -e --fqbn=arduboy-homemade:avr:arduboy-homemade:based_on=leonardo,boot=cathy3k,core=arduino-core ArduRacerFx.ino

echo "Copy build to final folder"
copy .\build\arduboy-homemade.avr.arduboy-homemade\ArduRacerFx.ino.hex .\Extra\ArduRacerFx.hex
11 changes: 11 additions & 0 deletions build_data.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
echo "Build Data File"
cd fxdata
python .\fxdata-build.py .\fxdata.txt
cd ..

echo "Build application"
arduino-cli compile -e --fqbn=arduboy-homemade:avr:arduboy-homemade:based_on=leonardo,boot=cathy3k,core=arduino-core ArduRacerFx.ino

echo "Copy builds to final folder"
copy .\build\arduboy-homemade.avr.arduboy-homemade\ArduRacerFx.ino.hex .\Extra\ArduRacerFx.hex
copy .\fxdata\fxdat*.bin .\Extra
Binary file modified fxdata/fxdata-data.bin
Binary file not shown.
Binary file modified fxdata/fxdata.bin
Binary file not shown.
16 changes: 8 additions & 8 deletions fxdata/fxdata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -459,19 +459,19 @@ uint16_t FX_LEVEL_TIMES[] = {
1144,1364,1950, // 5
2323,2515,3000, // 6
696,1001,1800, // 7
1852,2072,2600, // 8
1852,2065,2600, // 8
1678,1811,2200, // 9
2529,2737,3000, //10
1753,1912,2400, //11
2689,3033,4200, //12
3355,3900,4500, //13
2466,3000,3400, //14
2409,2529,3000, //10
1753,1912,2600, //11
2689,3033,3600, //12
3355,3900,4600, //13
2466,3000,3600, //14
1862,2400,3100, //15
2350,3000,3600, //16
4841,5400,6100, //17
5206,5900,6600, //18
9444,9102,9999, //19
8367,7546,9999, //20
9102,9444,9900, //19
7546,8367,9999, //20
};

// Font
Expand Down
27 changes: 16 additions & 11 deletions racer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,20 +211,24 @@ void processCarTune() {
}

void processGameMode() {
// Paused game processing
if (gameState.paused)
{
if (cross_input_down())
{
gameState.mode = 4;
}
}

if (cross_input_a() || cross_input_b())
{
if (gameState.paused && !doTimeout())
gameState.paused = false;
if (cross_input_a() || cross_input_b())
{
if (gameState.paused && !doTimeout())
gameState.paused = false;
}
// Shortcut exit, we don't do anything else
return;
}

// Game play input
if (cross_input_up())
{
gameState.paused = true;
Expand All @@ -243,24 +247,25 @@ void processGameMode() {
gameState.player1.rotation += gameState.max_turn_speed * tFrameMs;
}

// Process Player Rotation
if (gameState.player1.rotation < 0)
gameState.player1.rotation = PI * 2;
if (gameState.player1.rotation > PI * 2)
gameState.player1.rotation = 0;

if (gameState.laptimer && !gameState.paused)
if (cross_input_a() || cross_input_b())
{
gameState.player1.acceleration.force += gameState.acceleration * tFrameMs;
}

if (gameState.laptimer)
{
gameState.laptimes[(gameState.curlap)] += tFrameMs;
if (gameState.laptimes[(gameState.curlap)] > 99990)
{
gameState.laptimes[(gameState.curlap)] = 99990;
}
}

if (cross_input_a() || cross_input_b())
{
gameState.player1.acceleration.force += gameState.acceleration * tFrameMs;
}
}


Expand Down

0 comments on commit 7ac169d

Please sign in to comment.