local cond_hc_result= not GAMESTATE:IsPlayerEnabled(PLAYER_1)

local cond_ic_result= not GAMESTATE:IsPlayerEnabled(PLAYER_2)

local function optional_actor(cond, actor)
	if cond then return actor end
	return Def.Actor{}
end

return Def.ActorFrame{
  Name= "actor_jc",
  Def.ActorFrame{
    Name= "actor_kc",
    Def.Quad{
      Name= "actor_lc",
      InitCommand= function(self)
		
			--this is where variables go when the simfile starts up
			--function declarations, and things that will never change even
			--if this particular minigame is restarted after being played once before
		
			--for storing if a button is held down
			mawaru_blomby_held = {0,0,0,0,0,0,0,0};
			
			mawaru_blomby_speedo = {}
			mawaru_blomby_scoretext = {}
			
			mawaru_blomby_score = {0,0}
			
			mawaru_blomby_road = {}
			mawaru_blomby_players = {}
			mawaru_blomby_pboosts = {}
			mawaru_blomby_enemy = {}
			mawaru_blomby_eptr = 1
			
			mawaru_blomby_minspeed = 50
			mawaru_blomby_speedscale = 0.01
			
			mawaru_blomby_ang = {0,0}
			mawaru_blomby_spd = {mawaru_blomby_minspeed,mawaru_blomby_minspeed}
			mawaru_blomby_xspd = {0,0}
			mawaru_blomby_xaccel = 0.4
			mawaru_blomby_xdecel = 0.4
			mawaru_blomby_maxxspd = 4
			
			mawaru_blomby_invin = {0,0};
			mawaru_blomby_wasinvin = {false,false};
			
			mawaru_blomby_maxang = 15;
			mawaru_blomby_aaccel = 5;
			mawaru_blomby_adecel = 5;
			
			mawaru_blomby_dist = {0,0}
			
			mawaru_blomby_boostwait = {0,0}
			mawaru_blomby_boostdelay = 0.7;
			
			mawaru_blomby_numspawned = {0,0}
			
			mawaru_blomby_offset = {0,0}
			
			if not mawaru_blomby_rngbs then
				mawaru_blomby_rngbs = {}
				for i=1,200 do
					table.insert(mawaru_blomby_rngbs,math.random(0,1))
				end
			end
			
			mawaru_blomby_curcar = {1,1}
			mawaru_blomby_spawnat = {}
			for i=1,200 do
				table.insert(mawaru_blomby_spawnat,50*i)
			end
			
			function mawaru_blomby_spawn(pn,cur)
				local a = mawaru_blomby_enemy[mawaru_blomby_eptr]
				local dx = 160
				if pn == 2 then dx = 480 end
				if a then
					a:visible(true);
					a:setstate(math.random(2,6));
					a:aux(1);
					local rng = mawaru_blomby_rngbs[cur]
					if rng == 1 then
						a:x(dx + 40)
					else
						a:x(dx - 40)
					end
					a:y(-100);
					a:zoom(.7);
					a:zoomz(mawaru_blomby_minspeed-3);
				end
				
				mawaru_blomby_numspawned[pn] = mawaru_blomby_numspawned[pn]+1;
				
				mawaru_blomby_eptr = mawaru_blomby_eptr+1
				if mawaru_blomby_eptr > table.getn(mawaru_blomby_enemy) then
					mawaru_blomby_eptr = 1;
				end
			end
			
		end,
      KillCommand= function(self)
			--any cleanup, if necessary
		end,
      StartCommand= function(self)
			
			--variables set up when a game is started
			--wait 2 seconds (for the curtain or whatever) before accepting any inputs
			mawaru_blomby_lockinput = {.3,.3};
			
			self:sleep(0.02);
			self:queuecommand('Update');

		end,
      UpdateCommand= function(self)
			
			for i=1,table.getn(mawaru_blomby_enemy) do
				local a = mawaru_blomby_enemy[i]
				if a:getaux() == 1 then
					local pn = 1
					if a:GetX() > 320 then
						pn = 2
					end
					local spd = mawaru_blomby_spd[pn]-a:GetZoomZ()
					local b = mawaru_blomby_players[pn]
					if b:GetY() < a:GetY() and a:GetZ() == 0 then
						a:z(1);
						mawaru_blomby_score[pn] = mawaru_blomby_score[pn]+1;
					end
					if mawaru_hittest(a:GetX(),a:GetY(),48,108,b:GetX(),b:GetY(),38,108) then
						if mawaru_blomby_invin[pn] <= 0 then
							Sound('impact');
							if b:GetY() < a:GetY()-60 then
								mawaru_blomby_spd[pn] = a:GetZoomZ()*1.2
								a:zoomz(a:GetZoomZ()*0.8);
							elseif b:GetY() < a:GetY()+20 then
								if b:GetX() > a:GetX() then
									mawaru_blomby_xspd[pn] = 6
									a:aux(2);
									a:linear(0.8);
									a:rotationz(-720);
									a:addx(-160);
									a:diffusealpha(0);
									a:sleep(0);
									a:aux(0);
								else
									mawaru_blomby_xspd[pn] = -6
									a:aux(2);
									a:linear(0.8);
									a:rotationz(720);
									a:addx(160);
									a:diffusealpha(0);
									a:sleep(0);
									a:aux(0);
								end
								mawaru_blomby_offset[pn] = -10;
							else
								mawaru_blomby_spd[pn] = a:GetZoomZ()*0.7
								--a:zoomz(a:GetZoomZ()*1.1);
								mawaru_blomby_offset[pn] = -15;
							end
							mawaru_blomby_boostwait[pn] = mawaru_blomby_boostdelay
							mawaru_blomby_invin[pn] = 1.5
						else
							mawaru_blomby_invin[pn] = mawaru_blomby_invin[pn]+0.02
						end
					end
					a:addy(spd);
					if a:GetY() > 480+192 then
						a:visible(false);
						a:aux(0);
					end
				end
			end
			
			--game logic
			
			for pn=1,2 do
				if GAMESTATE:IsPlayerEnabled(pn-1) then
				
					
					if mawaru_blomby_spd[pn] < mawaru_blomby_minspeed then
						mawaru_blomby_spd[pn] = mawaru_blomby_spd[pn] + (mawaru_blomby_minspeed - (mawaru_blomby_minspeed*0.7))*0.02
					end
					
					if mawaru_blomby_lockinput[pn]>0 then
						mawaru_blomby_lockinput[pn] = mawaru_blomby_lockinput[pn]-0.02
					end
					
					if mawaru_blomby_invin[pn] > 0 then
						if not mawaru_blomby_wasinvin[pn] then
							mawaru_blomby_wasinvin[pn] = true
							mawaru_blomby_players[pn]:diffuseshift();
							mawaru_blomby_players[pn]:effectperiod(0.4);
							mawaru_blomby_players[pn]:effectcolor1(1,1,1,0.2);
							mawaru_blomby_players[pn]:effectcolor2(1,1,1,0.7);
						end
						mawaru_blomby_invin[pn] = mawaru_blomby_invin[pn]-0.02
					else
						if mawaru_blomby_wasinvin[pn] then
							mawaru_blomby_wasinvin[pn] = false;
							mawaru_blomby_players[pn]:stopeffect()
						end
					end
					
					--Trace('Update p'..pn);
					
					if mawaru_blomby_boostwait[pn] > 0 then
						mawaru_blomby_boostwait[pn] = mawaru_blomby_boostwait[pn]-0.02
					end
					
					mawaru_blomby_road[pn]:texcoordvelocity(0,-mawaru_blomby_spd[pn]/25)
					
					mawaru_blomby_dist[pn] = mawaru_blomby_dist[pn]+mawaru_blomby_spd[pn]*mawaru_blomby_speedscale
					
					local fudge = 10*(mawaru_blomby_spd[pn]-mawaru_blomby_minspeed)
					if mawaru_blomby_dist[pn]+fudge+mawaru_blomby_offset[pn] > mawaru_blomby_spawnat[ mawaru_blomby_curcar[pn] ] then
						mawaru_blomby_spawn(pn, mawaru_blomby_curcar[pn])
						mawaru_blomby_curcar[pn] = mawaru_blomby_curcar[pn]+1;
					end
					
					mawaru_blomby_speedo[pn]:settext(math.floor(mawaru_blomby_spd[pn]*1.5 - mawaru_blomby_minspeed*0.5)..'mph')
					mawaru_blomby_scoretext[pn]:settext(mawaru_blomby_score[pn]..'pts')
					
					local bpn = pn-1;
					----------------------handle button presses-------------------
					if mawaru_blomby_lockinput[pn] <= 0 then
						if mawaru_blomby_boostwait[pn] <= 0 and mawaru_keys[3+(bpn*4)] == 1 and mawaru_blomby_held[3+(bpn*4)] == 0 then
							--YOU GOT BOOST POWER
							mawaru_blomby_spd[pn] = mawaru_blomby_spd[pn]+2
							mawaru_blomby_boostwait[pn] = mawaru_blomby_boostdelay
							Sound('boost');
							MESSAGEMAN:Broadcast('BlombyBoostP'..pn);
							mawaru_blomby_held[3+(bpn*4)] = 1
						end
						
						if mawaru_keys[1+(bpn*4)] == 1 and mawaru_keys[4+(bpn*4)] == 0 then
							if mawaru_blomby_ang[pn] > -mawaru_blomby_maxang then
								mawaru_blomby_ang[pn] = mawaru_blomby_ang[pn]-mawaru_blomby_aaccel
							end
						elseif mawaru_keys[4+(bpn*4)] == 1 and mawaru_keys[1+(bpn*4)] == 0 then
							if mawaru_blomby_ang[pn] < mawaru_blomby_maxang then
								mawaru_blomby_ang[pn] = mawaru_blomby_ang[pn]+mawaru_blomby_aaccel
							end
						else
							if math.abs(mawaru_blomby_ang[pn]) > mawaru_blomby_adecel then
								mawaru_blomby_ang[pn] = mawaru_blomby_ang[pn]-mawaru_blomby_adecel*(mawaru_blomby_ang[pn]/math.abs(mawaru_blomby_ang[pn]))
							else
								mawaru_blomby_ang[pn] = 0;
							end
						end
						
						if mawaru_keys[1+(bpn*4)] == 1 and mawaru_keys[4+(bpn*4)] == 0 then
							if mawaru_blomby_xspd[pn] > -mawaru_blomby_maxxspd then
								mawaru_blomby_xspd[pn] = mawaru_blomby_xspd[pn]-mawaru_blomby_xaccel
							end
						elseif mawaru_keys[4+(bpn*4)] == 1 and mawaru_keys[1+(bpn*4)] == 0 then
							if mawaru_blomby_xspd[pn] < mawaru_blomby_maxxspd then
								mawaru_blomby_xspd[pn] = mawaru_blomby_xspd[pn]+mawaru_blomby_xaccel
							end
						else
							if math.abs(mawaru_blomby_xspd[pn]) > mawaru_blomby_xdecel then
								mawaru_blomby_xspd[pn] = mawaru_blomby_xspd[pn]-mawaru_blomby_xdecel*(mawaru_blomby_xspd[pn]/math.abs(mawaru_blomby_xspd[pn]))
							else
								mawaru_blomby_xspd[pn] = 0;
							end
						end
						
					end
					
					mawaru_blomby_players[pn]:addx(mawaru_blomby_xspd[pn])
					mawaru_blomby_players[pn]:rotationz(mawaru_blomby_ang[pn])
					
					local d = 160
					if pn == 2 then d = 480 end
					if math.abs(mawaru_blomby_players[pn]:GetX()-d) > 56*(384/256) then
						mawaru_blomby_spd[pn] = mawaru_blomby_spd[pn]+(mawaru_blomby_minspeed*0.5 - mawaru_blomby_spd[pn])/40
					end
					
					if mawaru_blomby_players[pn]:GetX() > d+120 then
						mawaru_blomby_players[pn]:x(d+120)
						mawaru_blomby_spd[pn] = mawaru_blomby_spd[pn]+(mawaru_blomby_minspeed*0.3 - mawaru_blomby_spd[pn])/10
						mawaru_blomby_xspd[pn] = -2
						Sound('bonk2');
					end
					if mawaru_blomby_players[pn]:GetX() < d-120 then
						mawaru_blomby_players[pn]:x(d-120)
						mawaru_blomby_spd[pn] = mawaru_blomby_spd[pn]+(mawaru_blomby_minspeed*0.3 - mawaru_blomby_spd[pn])/10
						mawaru_blomby_xspd[pn] = 2
						Sound('bonk2');
					end
					
					mawaru_blomby_pboosts[pn]:x(mawaru_blomby_players[pn]:GetX())
					mawaru_blomby_pboosts[pn]:y(mawaru_blomby_players[pn]:GetY())
					mawaru_blomby_pboosts[pn]:rotationz(mawaru_blomby_ang[pn])
						
					for i=1,4 do
						
						----------------------don't touch this------------------------
						--release all buttons - used for detecting if a button is newly pressed, as opposed to held
						if mawaru_keys[i+(bpn*4)] == 0 then
							mawaru_blomby_held[i+(bpn*4)] = 0
						end
						---------------------end don't touch this----------------------
						
					end
				end
			end
			
			self:sleep(0.02);
			if mawaru_curgame == 6 and mawaru_gamestate == 1 then
				self:queuecommand('Update');
			end
			
		end,
    },
    Def.Quad{
      Name= "actor_mc",
      InitCommand= function(self) mawaru_blomby_controller = self end,
    },
    Def.Sprite{
      Name= "actor_nc",--Unconverted x & y pos. -Kid
      OnCommand= cmd(zoomto,384,768;cropleft,1/12;cropright,1/12;x,160;y,240;customtexturerect,0,0,1,2;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_road,self) end,
      Texture= "road.png",
    },
    Def.Sprite{
      Name= "actor_oc",--Unconverted x & y pos. -Kid
      OnCommand= cmd(zoomto,384,768;cropleft,1/12;cropright,1/12;x,480;y,240;customtexturerect,0,0,1,2;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_road,self) end,
      Texture= "road.png",
    },
    Def.ActorFrame{
      Name= "actor_pc",
      OnCommand= cmd(zoom,.7;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_pboosts,self) end,
      Def.Sprite{
        Name= "actor_qc",
        BlombyBoostP1MessageCommand= cmd(finishtweening;diffusealpha,1;zoomx,0;zoomy,0.5;bounceend,0.1;zoomx,1;linear,0.1;zoomy,0.9;linear,0.7;zoomx,0;zoomy,2),--Unconverted x & y pos. -Kid
        OnCommand= cmd(vertalign,top;
		zoom,0;x,24;y,64;croptop,.1;fadebottom,.3;diffuseshift;effectperiod,0.1;effectcolor1,color('1,0.5,0,.5');effectcolor2,color('1,1,0,.5')),
        Texture= "triangle.png",
      },
      Def.Sprite{
        Name= "actor_rc",
        BlombyBoostP1MessageCommand= cmd(finishtweening;diffusealpha,1;zoomx,0;zoomy,0.5;bounceend,0.1;zoomx,1;linear,0.1;zoomy,0.9;linear,0.7;zoomx,0;zoomy,2),--Unconverted x & y pos. -Kid
        OnCommand= cmd(vertalign,top;
		zoom,0;x,-24;y,64;croptop,.1;fadebottom,.3;diffuseshift;effectperiod,0.3;effectcolor1,color('1,0.5,0,.5');effectcolor2,color('1,1,0,.5')),
        Texture= "triangle.png",
      },
    },
    Def.ActorFrame{
      Name= "actor_sc",
      OnCommand= cmd(zoom,.7;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_pboosts,self) end,
      Def.Sprite{
        Name= "actor_tc",
        BlombyBoostP2MessageCommand= cmd(finishtweening;diffusealpha,1;zoomx,0;zoomy,0.5;bounceend,0.1;zoomx,1;linear,0.1;zoomy,0.9;linear,0.7;zoomx,0;zoomy,2),--Unconverted x & y pos. -Kid
        OnCommand= cmd(vertalign,top;
		zoom,0;x,24;y,64;croptop,.1;fadebottom,.3;diffuseshift;effectperiod,0.1;effectcolor1,color('1,0.5,0,.5');effectcolor2,color('1,1,0,.5')),
        Texture= "triangle.png",
      },
      Def.Sprite{
        Name= "actor_uc",
        BlombyBoostP2MessageCommand= cmd(finishtweening;diffusealpha,1;zoomx,0;zoomy,0.5;bounceend,0.1;zoomx,1;linear,0.1;zoomy,0.9;linear,0.7;zoomx,0;zoomy,2),--Unconverted x & y pos. -Kid
        OnCommand= cmd(vertalign,top;
		zoom,0;x,-24;y,64;croptop,.1;fadebottom,.3;diffuseshift;effectperiod,0.3;effectcolor1,color('1,0.5,0,.5');effectcolor2,color('1,1,0,.5')),
        Texture= "triangle.png",
      },
    },
    Def.Sprite{
      Name= "actor_vc",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_wc",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_xc",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_yc",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_zc",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_Ac",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_Bc",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_Cc",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_Dc",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_Ec",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_Fc",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_ad",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_bd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_cd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_dd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_ed",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_fd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_gd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_hd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_id",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_jd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_kd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_ld",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_md",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_nd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_od",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_pd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_qd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_rd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_sd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_td",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_ud",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_vd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_wd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_xd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_yd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_zd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_Ad",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_Bd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_Cd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_Dd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_Ed",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_Fd",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_ae",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_be",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_ce",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_de",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_ee",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_fe",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_ge",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_he",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_ie",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_je",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_ke",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_le",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_me",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_ne",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_oe",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_pe",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_qe",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_re",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_se",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_te",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_ue",
      OnCommand= cmd(animate,0;visible,false;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_enemy,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_ve",--Unconverted x & y pos. -Kid
      OnCommand= cmd(animate,0;setstate,0;x,160;y,360;zoom,.7;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_players,self) end,
      Texture= "cars 4x2.png",
    },
    Def.Sprite{
      Name= "actor_we",--Unconverted x & y pos. -Kid
      OnCommand= cmd(animate,0;setstate,1;x,480;y,360;zoom,.7;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_players,self) end,
      Texture= "cars 4x2.png",
    },
    Def.BitmapText{
      Name= "actor_xe",
      Font= "_eurostile outline",--Unconverted x & y pos. -Kid
      OnCommand= cmd(horizalign,left;vertalign,top;x,6;y,6;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_scoretext,self) end,
      Text= "",
    },
    Def.BitmapText{
      Name= "actor_ye",
      Font= "_eurostile outline",--Unconverted x & y pos. -Kid
      OnCommand= cmd(horizalign,left;vertalign,top;x,326;y,6;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_scoretext,self) end,
      Text= "",
    },
    Def.BitmapText{
      Name= "actor_ze",
      Font= "_eurostile outline",--Unconverted x & y pos. -Kid
      OnCommand= cmd(horizalign,right;vertalign,bottom;x,314;y,400;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_speedo,self) end,
      Text= "",
    },
    Def.BitmapText{
      Name= "actor_Ae",
      Font= "_eurostile outline",--Unconverted x & y pos. -Kid
      OnCommand= cmd(horizalign,right;vertalign,bottom;x,634;y,400;sleep,0.02;queuecommand,"SetMe"),
      SetMeCommand= function(self) table.insert(mawaru_blomby_speedo,self) end,
      Text= "",
    },
    Def.Quad{
      Name= "actor_Be",--Unconverted x & y pos. -Kid
      OnCommand= cmd(x,320;y,240;zoomto,6,480;diffuse,color('0,0,0,1')),
    },
    optional_actor(cond_hc_result,
    Def.Quad{
      Name= "actor_Ce",--Unconverted x & y pos. -Kid
      OnCommand= cmd(x,640*0.25;zoomto,640/2,480;diffuse,color('0,0,0,1')),
    }),
    optional_actor(cond_ic_result,
    Def.Quad{
      Name= "actor_De",--Unconverted x & y pos. -Kid
      OnCommand= cmd(x,640*0.75;y,240;zoomto,640/2,480;diffuse,color('0,0,0,1')),
    }),
  },
}
