Skip to content

Commit

Permalink
make more music
Browse files Browse the repository at this point in the history
  • Loading branch information
Omega Jerry authored and Omega Jerry committed Mar 7, 2025
1 parent 48c407b commit 08e8b68
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions 11_Robots/ghost_tank/src/tank_robot_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ bool TankRobotPlugin::runAutonFromDriver(std::shared_ptr<JoystickDeviceData> joy

void TankRobotPlugin::toggleBagRecorder(std::shared_ptr<JoystickDeviceData> joy_data)
{
return;
if (joy_data->btn_y && joy_data->btn_x && !m_recording_btn_pressed) {
m_recording_btn_pressed = true;
if (!m_recording) {
Expand Down Expand Up @@ -698,9 +699,37 @@ void TankRobotPlugin::updateClamp(std::shared_ptr<JoystickDeviceData> joy_data)
void TankRobotPlugin::updateMusic(double current_time, std::shared_ptr<JoystickDeviceData> joy_data)
{
static double btn_pressed = 0;
if (joy_data->btn_u && btn_pressed < (current_time - 5)){
btn_pressed = current_time;
playMusic(""); // should play random when empty
if (true && btn_pressed < (current_time - 5))
{
static double btn_pressed = 0;
if (btn_pressed < (current_time - 2))
{
if (joy_data->btn_b)
{
btn_pressed = current_time;
playMusic("rand");
}
else if (joy_data->btn_x)
{
btn_pressed = current_time;
playMusic("seinfeld");
}
else if (false)
{
btn_pressed = current_time;
playMusic("awesome");
}
else if (joy_data->btn_u)
{
btn_pressed = current_time;
playMusic("emotional");
}
else if (joy_data->btn_a)
{
btn_pressed = current_time;
playMusic("feminominon");
}
}
}
}

Expand Down

0 comments on commit 08e8b68

Please sign in to comment.