local deltaxa = 1.5*(math.random(0,1) > .5 and 1 or -1);
local deltaya = 1.5*(math.random(0,1) > .5 and 1 or -1);
local rotationa= math.random(2,5) * (math.random(0,1) > .5 and 1 or -1) / 10;

return Def.ActorFrame{
    -- keep-alive Actor
    -- this will allow the file to persist for 999 seconds
    -- (or, until the end of the stepchart)
    Def.Actor{ OnCommand=function(self) self:sleep(999) end },
 -- Thanks DBK2 for da help
    -- the Sprite Actor 
    Def.Sprite{
        --Texture="download.jpg",
        Texture="face.png",
       --REAL WORKNG OnCommand= cmd(zoom,1.2*(SCREEN_HEIGHT/480);x,math.random(0,SCREEN_WIDTH);y,math.random(0,SCREEN_HEIGHT);zoom,0.8*(SCREEN_HEIGHT/480);spin;),
		OnCommand= cmd(playcommand,"move"),
		InitCommand= function(self)
			self:x(math.random(0,SCREEN_WIDTH));
			self:y(math.random(0,SCREEN_HEIGHT));
			self:zoom(1.2*(SCREEN_HEIGHT/480));
			--self:rotationz(rotationa);

			
			-- xa = SCREEN_CENTER_X;
			-- ya = SCREEN_CENTER_Y;
		end,
		-- moveCommand= function(self)

		-- end,
	--	Texture= "face.png",
		moveCommand= function(self)
			self:x(self:GetX() + deltaxa);
			self:y(self:GetY() + deltaya);
			-- xa = xa + deltaxa*(SCREEN_WIDTH/640);
			-- ya = ya + deltaya*(SCREEN_HEIGHT/480);
			--rotationa = rotationa - 1.5;
			self:addrotationz(rotationa);
			
			if self:GetX() <= SCREEN_LEFT or self:GetX() >= SCREEN_RIGHT then
				deltaxa = -deltaxa;
			end
			if self:GetY() <= SCREEN_TOP or self:GetY() >= SCREEN_BOTTOM then
				deltaya = -deltaya;
			end
			self:sleep(.007)
			self:queuecommand('move');
		end,
    },

    [[Def.Sprite{
      Name= "actor_by",
      OnCommand= cmd(playcommand,"Start";playcommand,"a"),
      StartCommand= function(self)
			self:x(SCREEN_CENTER_X);--Converted x position. -Kid
			self:y(SCREEN_CENTER_Y);--Scaled y position. -Kid
			self:zoom(over_height_ratio)--Added zoom. -Kid
			self:diffusealpha(0);
			rotationa = 0;

			deltaxa = 3;
			deltaya = -1.5;
			xa = SCREEN_CENTER_X;--Converted x position. -Kid
			ya = SCREEN_CENTER_Y;

		end,
      Texture= "face.png",
      aCommand= function(self)

			if GAMESTATE:GetSongBeat()>= 192 then
				self:diffusealpha(1);
				self:addx(deltaxa*over_width_ratio);
				self:addy(deltaya*over_height_ratio);
				xa = xa + deltaxa*over_width_ratio;
				ya = ya + deltaya*over_height_ratio;
				rotationa = rotationa - 1.5;
				self:rotationz(rotationa);
				--Redid bounds. -Kid
				if xa <= SCREEN_LEFT or xa >= SCREEN_RIGHT then
					deltaxa = -deltaxa;
				end
				if ya <= SCREEN_TOP or ya >= SCREEN_BOTTOM then
					deltaya = -deltaya;
				end

			end

			if GAMESTATE:GetSongBeat()>= 223.5 then
				self:diffusealpha(0);
			end

			self:sleep(0.007);
			self:queuecommand('a');

		end,
	},]]
}