home *** CD-ROM | disk | FTP | other *** search
- function determine_whips()
- {
- if(whips_limit >= whips_used)
- {
- if(start_whip)
- {
- whipping = true;
- start_whip = false;
- whip_count = 0;
- whips_used++;
- }
- if(whipping)
- {
- whip_count++;
- whip_factor = 1;
- if(whip_cycles < whip_count)
- {
- whipping = false;
- whip_factor = 0;
- }
- }
- }
- else
- {
- whip_factor = 0;
- }
- whips_left = whips_limit - whips_used;
- if(whips_left < 0)
- {
- whips_left = 0;
- }
- }
- i = 1;
- while(4 >= i)
- {
- horse_v[i] = horse_u[i] + horse_a[i] * horse_t[i];
- if(horse_maxv[i] < horse_v[i])
- {
- horse_v[i] = horse_maxv[i];
- }
- eval("horse" + i)._x += horse_v[i];
- horse_t[i] += 0.02;
- nosep = eval("horse" + i)._x + nose[i];
- if(fence10._x < nosep and finish[i] == -999)
- {
- finish[i] = counter * 1000 + (600 - nosep);
- fence10.flash.gotoandplay("flash");
- }
- i++;
- }
- determine_whips();
- horse1._x += whip_factor;
- railbg._x -= speed;
- railbg1._x -= speed;
- railfg._x -= speed;
- railfg1._x -= speed;
- chk_fen = eval("fence" + my_next_fence);
- if(my_next_fence < 10 and -10 < chk_fen._x - horse1._x and chk_fen._x - horse1._x < 10 and not_jumping and first_inh)
- {
- first_inh = false;
- trace("not jumped");
- horse_u[1] = 0;
- horse_t[1] = 0;
- horse1._x -= 20;
- }
- if(my_next_fence < 10 and chk_fen._x + 150 < horse1._x)
- {
- my_next_fence++;
- }
- if(not_jumping)
- {
- first_check = true;
- }
- else if(first_check)
- {
- if(dtf != -999)
- {
- first_check = false;
- trace("DTF !" + dtf);
- accuracy = 100 - Math.abs(dtf) * 2;
- if(accuracy < 0)
- {
- accuracy = 0;
- }
- horse_u[1] = horse_v[1] * accuracy / 100;
- horse_t[1] = 0;
- horse1._x -= (100 - accuracy) / fence_factor;
- score += int(accuracy / 2);
- }
- }
- counter++;
- i = first_active;
- while(10 >= i)
- {
- if(f_state[i] == "hidden")
- {
- if(f_pos[i] < counter)
- {
- f_state[i] = "active";
- }
- }
- if(f_state[i] == "active")
- {
- chk_fen = eval("fence" + i);
- if(chk_fen._x - horse4._x < 100 and notj4[i] and i < 10)
- {
- notj4[i] = false;
- horse4.gotoandplay("jump");
- pc = random(100);
- horse_u[4] = horse_v[4] * pc / 100;
- horse_t[4] = 0;
- horse4._x -= (100 - pc) / 10;
- }
- if(chk_fen._x - horse3._x < 100 and notj3[i] and i < 10)
- {
- notj3[i] = false;
- horse3.gotoandplay("jump");
- pc = random(100);
- horse_u[3] = horse_v[3] * pc / 100;
- horse_t[3] = 0;
- horse3._x -= (100 - pc) / 10;
- }
- if(chk_fen._x - horse2._x < 100 and notj2[i] and i < 10)
- {
- notj2[i] = false;
- horse2.gotoandplay("jump");
- pc = random(100);
- horse_u[2] = horse_v[2] * pc / 100;
- horse_t[2] = 0;
- horse2._x -= (100 - pc) / 10;
- }
- chk_fen._x -= speed;
- if(chk_fen._x < -80)
- {
- f_state[i] = "done";
- speed += increment;
- first_active++;
- first_inh = true;
- }
- if(i == 10 and chk_fen._x < 100)
- {
- f_state[i] = "done";
- race_running = false;
- }
- }
- i++;
- }
-