I added some more functions, and something went wrong (as always).

I'm hoping more sets of eyes will help. It compiles, but it freezes when I run it. Here's the code.
Code: // Program Name:
// Author(s):
// Description:
/* Keep these headers */
#include <tice.h>
/* Standard headers - it's recommended to leave them included */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* Other available headers */
// including stdarg.h, setjmp.h, assert.h, ctype.h, float.h, iso646.h, limits.h, errno.h
#include <sprites.h>
#include <xlibcsprites.h>
/* Available libraries */
// including lib/ce/graphc.h, lib/ce/fileioc.h, and lib/ce/keypadc.h
// Sample: #include <lib/ce/graphc.h>
#include <lib/ce/graphx.h>
#include <lib/ce/keypadc.h>
/* Put your function prototypes here */
void zombie_dead(void);
bool shoot_gun(void);
void update(void);
void CheckRange(void);
void AddBloodSplatter(void);
/* Put all your globals here. */
typedef struct zombie{
int distance;
int health;
int x;
bool WithinScreen;
bool WithinGun;
bool GunRedraw;
int ShowBloodSplatter[2];
} zombie;
typedef struct player{
int ammo;
int health;
}player;
/* Put all your code here */
player Player;
zombie Zombie;
void main() {
// Main program code goes here
int kTurn=0, kShoot=0;
int ShowFiring=0, CanShoot=0, x;
Player.ammo=10;
Player.health=10;
Zombie.x=0;
Zombie.health=100;
Zombie.ShowBloodSplatter[0]=0;
Zombie.ShowBloodSplatter[1]=0;
gfx_Begin(gfx_8bpp);
gfx_SetDrawBuffer();
gfx_SetColor(255);
gfx_FillScreen(255);
gfx_SetPalette(sprites_pal,sizeof(sprites_pal),0);
CheckRange();
gfx_TransparentSprite(EnemySprite,Zombie.x,30);
for(x=0;x<2;--x){
if (Zombie.ShowBloodSplatter[x]){
gfx_TransparentSprite(BloodSplatter,Zombie.ShowBloodSplatter[x]+Zombie.x,100);
}
}
gfx_SetPalette(xlibcsprites_pal,sizeof(xlibcsprites_pal),0);
gfx_TransparentSprite(SilencedPistol,131,174);
update();
gfx_BlitBuffer();
while(kb_ScanGroup(kb_group_6) != kb_Clear){
if (kTurn & kb_Left){
CheckRange();
if (ShowFiring)
--ShowFiring;
if (CanShoot)
--CanShoot;
if (Zombie.WithinScreen){
gfx_FillRectangle(Zombie.x,30,225,210);
}
if (Zombie.x>=750){
Zombie.x=-625;
}else{
Zombie.x+=8;
}
if (Zombie.WithinScreen){
gfx_TransparentSprite(EnemySprite,Zombie.x,30);
if (Zombie.WithinGun){
if (ShowFiring){
gfx_TransparentSprite(SilencedPistolFiring,131,154);
}else{
gfx_TransparentSprite(SilencedPistol,131,174);
}
}
for(x=0;x<2;--x){
if (Zombie.ShowBloodSplatter[x]){
gfx_TransparentSprite(BloodSplatter,Zombie.ShowBloodSplatter[x]+Zombie.x,100);
}
}
gfx_BlitBuffer();
}
update();
}
if (kTurn & kb_Right){
CheckRange();
if (ShowFiring)
--ShowFiring;
if (CanShoot)
--CanShoot;
if (Zombie.WithinScreen){
gfx_FillRectangle(Zombie.x,30,225,210);
}
if (Zombie.x<=-625){
Zombie.x=750;
}else{
Zombie.x-=8;
}
if (Zombie.WithinScreen){
gfx_TransparentSprite(EnemySprite,Zombie.x,30);
if (Zombie.WithinGun){
if (ShowFiring){
gfx_TransparentSprite(SilencedPistolFiring,131,154);
}else{
gfx_TransparentSprite(SilencedPistol,131,174);
}
}
for(x=0;x<2;--x){
if (Zombie.ShowBloodSplatter[x]){
gfx_TransparentSprite(BloodSplatter,Zombie.ShowBloodSplatter[x]+Zombie.x,100);
}
}
gfx_BlitBuffer();
}
update();
}
if ((kShoot & kb_2nd) && (!ShowFiring && !CanShoot)){
ShowFiring=10;
if (shoot_gun()){
AddBloodSplatter();
Zombie.health-=50;
if (!Zombie.health)
zombie_dead();
}
update();
}
if (ShowFiring){
gfx_TransparentSprite(SilencedPistolFiring,131,154);
gfx_BlitBuffer();
--ShowFiring;
if (!ShowFiring){
if (Zombie.WithinGun){
gfx_TransparentSprite(EnemySprite,Zombie.x,30);
}else{
for(x=0;x<50;x++)
gfx_FillRectangle(131,154,57,86);
}
gfx_TransparentSprite(SilencedPistol,131,172);
gfx_BlitBuffer();
if (Zombie.WithinGun){
gfx_TransparentSprite(EnemySprite,Zombie.x,30);
}else{
for(x=0;x<50;x++)
gfx_FillRectangle(131,172,57,70);
}
gfx_TransparentSprite(SilencedPistol,131,174);
gfx_BlitBuffer();
CanShoot=10;
}
}
if (CanShoot){
--CanShoot;
}
CheckRange();
kShoot=kb_ScanGroup(kb_group_1);
kTurn=kb_ScanGroup(kb_group_7);
}
gfx_End();
pgrm_CleanUp();
}
/* Other functions */
bool shoot_gun(void){
bool hit;
int x;
if(Player.ammo){
--Player.ammo;
//gun moving upward
if (Zombie.WithinGun){
gfx_TransparentSprite(EnemySprite,Zombie.x,30);
}else{
for(x=0;x<50;x++)
gfx_FillRectangle(131,174,57,70);
}
gfx_TransparentSprite(SilencedPistol,131,172);
gfx_BlitBuffer();
if (Zombie.WithinGun){
gfx_TransparentSprite(EnemySprite,Zombie.x,30);
}else{
for(x=0;x<50;x++)
gfx_FillRectangle(131,172,57,70);
}
gfx_TransparentSprite(SilencedPistolFiring,131,154);
gfx_BlitBuffer();
if(Zombie.x+50<=158 && Zombie.x+175>=162){
hit=true;
}else{
hit=false;
}
return hit;
}else{
hit=false;
return hit;
}
}
void zombie_dead(void){
gfx_PrintStringXY("Kill!",150,0);
gfx_FillRectangle(Zombie.x,30,225,210);
gfx_BlitBuffer();
}
void update(void){
gfx_FillRectangle(0,0,30,20);
gfx_SetTextXY(0,0);
gfx_PrintInt(Zombie.x,3);
gfx_SetTextXY(0,9);
gfx_PrintInt(Player.ammo,2);
}
void CheckRange(void){
if (Zombie.x+225>=0 && Zombie.x<=360){
Zombie.WithinScreen=true;
}else{
Zombie.WithinScreen=false;
}
if (Zombie.x+225>=188 && Zombie.x<=131){
Zombie.WithinGun=true;
}else{
Zombie.WithinGun=false;
}
}
void AddBloodSplatter(void){
if (!Zombie.ShowBloodSplatter[0]){
Zombie.ShowBloodSplatter[0]=160-Zombie.x+50;
}else{
Zombie.ShowBloodSplatter[1]=160-Zombie.x+50;
}
}