src/firealrm.c
author Tampax86
Thu, 17 Jul 2025 22:03:19 -0400
changeset 0 b2e3aa63e96c
permissions -rw-r--r--
First commit

#include "firealrm.h"

int counter = 0;

Uint32 ALRM_soundFireAlarm(Uint32 interval)
{
    if(!fireAlarmSystemActivated)
    {
        Mix_PlayChannel(-1, alarmSound, 0);
        fireAlarmSystemActivated = 1;
        counter += 1;
        return 100;
    }

    else
    {
        fireAlarmSystemActivated = 0;
        if(counter > 2)
        {
            counter = 0;
            return 1800;
        }
        return 1000;
    }
}