function OnSceneLoad(screen)
    LoadData(screen)
    
    g_screen = screen
    g_timer = screen:GetTimer()
    
    Objects = {}
    Positions = {}
    RightN = {2, 1, 2, 1, 2, 1, 2, 1, 1, 2}
    RightM = {3, 1, 1, 4, 2, 5, 5, 2, 3, 4}
    OBJECTS_AMOUNT = 10
    PrevPlate = nil
    Stage = 0
    local_button = nil
    reset_now = false
    ignore_level = 0
    
    for n = 1, 2 do
        Positions[n] = {}
        for m = 1, 5 do
            Positions[n][m] = {}
        end
    end
    
    for i = 1, OBJECTS_AMOUNT do
        Objects[i] = {}
        Objects[i].Entity = g_screen:GetObject("Plate_"..i)
        
        Objects[i].Back = g_screen:GetObject("PlateB_"..i)
        Objects[i].Back:AttachTo(Objects[i].Entity)
        Objects[i].Back:SetXY(0, 0)
        Objects[i].Back:SetZ(-2)
        Objects[i].Back:Hide()
        
        Objects[i].Anim = g_screen:GetObject("Anim_"..i)
        Objects[i].Anim:AttachTo(Objects[i].Entity)
        Objects[i].Anim:SetXY(-2, 20)
        Objects[i].Anim:SetZ(-1)
        Objects[i].Anim:GetAnimation():SetMode(HGEANIM_FWD + HGEANIM_NOLOOP)
        --Objects[i].Anim:Stop()
        Objects[i].Anim:Hide()
        
        Objects[i].AnimRev = g_screen:GetObject("Anim_rev_"..i)
        Objects[i].AnimRev:AttachTo(Objects[i].Entity)
        Objects[i].AnimRev:SetXY(-12, 14)
        Objects[i].AnimRev:SetZ(-3)
        Objects[i].AnimRev:GetAnimation():SetMode(HGEANIM_FWD + HGEANIM_NOLOOP)
        --Objects[i].AnimRev:Stop()
        Objects[i].AnimRev:Hide()
        
        Objects[i].Index = i
        Objects[i].N = math.ceil(i / 5)
        Objects[i].M = i%5
        if Objects[i].M == 0 then
            Objects[i].M = 5
        end
        
        Objects[i].Type = math.ceil(i / 2)
        Objects[i].State = 0                                -- 0 - нормальное состояния, 1 - перевёрнуто, 2 - угадано
        
        local x, y = Objects[i].Entity:GetX(), Objects[i].Entity:GetY()
        Positions[Objects[i].N][Objects[i].M].x, Positions[Objects[i].N][Objects[i].M].y = x, y
    end
    
    g_screen:GetObject("Paper"):SetOpacity(0.0)
    CreateButtonLocal()
    
    SetStage()
end

function CreateButtonLocal()
    local up = CreateAnimation('data/Texture/Minigames/23_statues_tooth/button.png',0,0,177,66,1,0)
	up:SetHotSpot(88,33);
    local over = CreateAnimation('data/Texture/Minigames/23_statues_tooth/button.png',0,66,177,66,1,0)
    over:SetHotSpot(88,33);
    local down = CreateAnimation('data/Texture/Minigames/23_statues_tooth/button.png',0,132,177,66,1,0)
    down:SetHotSpot(88,33);
	local_button = CreateButton(up, over, down, 'ResetButton', g_screen)
	local_button:AttachTo(g_screen)
	local_button:SetX(937)
	local_button:SetY(738)
	local_button:SetZ(120)
	local_button:SetOpacity(0.0)
end

function Reset()
    if reset_now then
        return
    end
    
    IgnoreAll(true)
    reset_now = true
    PlaySound("36_mg_rotate")
    for i = 1, OBJECTS_AMOUNT do
        RotateRev(i)
        TimerDo(g_timer, 4/9, ChangeNM, i)
        TimerDo(g_timer, 5/9, RotateFrw, i)       
    end
    TimerDo(g_timer, 5/9, PlaySound, "36_mg_rotate")
    TimerDo(g_timer, 1.0, IgnoreAll, false)
    TimerDoString('reset_now = false', 1.0, g_timer)
end

function ChangeNM(index)
    local indexes = {9, 6, 8, 4, 7, 3, 5, 1, 2, 10}
    local obj = Objects[index]
    
    local n, m  = math.ceil(indexes[index] / 5), indexes[index]%5
    if m == 0 then
        m = 5
    end
    obj.N, obj.M = n, m
    obj.Entity:SetXY(Positions[n][m].x, Positions[n][m].y)
end

function OnSceneFree()
    FreeData()
end

function OnScreenShown()
end

function OnHiddenComics()
end

function OnUpdate(dt)
    DefaultOnUpdate(dt)
end

function OnLose()
end

function OnExit()
end

function OnObjectMouseEnter(object)
    DefaultOnObjectMouseEnter(object)
end

function OnObjectMouseLeave(object)
    DefaultOnObjectMouseLeave(object)
end

function SetStage()
    local change = false
    if Stage == 0 then
        --
        local indexes = {}
        for i = 1, OBJECTS_AMOUNT do
            indexes[i] = i
        end
        RandomTableSort(indexes)
        for i = 1, OBJECTS_AMOUNT do
            local n, m  = math.ceil(indexes[i] / 5), indexes[i]%5
            if m == 0 then
                m = 5
            end
            Objects[i].N, Objects[i].M = n, m
            Objects[i].Entity:SetXY(Positions[n][m].x, Positions[n][m].y)
        end
        --
        change = true
        Stage = 1    
    end
    if Stage == 1 then
        local ret = true
        for i = 1, OBJECTS_AMOUNT do
            if Objects[i].State ~= 2 then
                ret = false
                break
            end
        end
        if ret == true then
            TimerDo(g_timer, 6/9, CreateDialogMiniGameHelp, 'MINI_GAME_HELP_PLATES_2')
            TimerDo(g_timer, 7/9, Reset)
        
            do
                local af = CreateAnimationEffector()
                af:AttachTo(g_screen:GetObject('Paper'))
                af:SetKey(_TRACK_O, 6/9 + 0.01, 0)
                af:SetKey(_TRACK_O, 6/9 + 1.3, 1)
                af:Play()
            end
            
            do
                local af = CreateAnimationEffector()
                af:AttachTo(local_button)
                af:SetKey(_TRACK_O, 6/9 + 0.01, 0)
                af:SetKey(_TRACK_O, 6/9 + 1.3, 1)
                af:Play()
            end
            
            for i = 1, OBJECTS_AMOUNT do
                TimerDo(g_timer, 6/9 + 0.01, SetPlateColor, i, '0xFFFFFFFF')
            end
            
            change = true
            Stage = 2
        end
    end
    if Stage == 2 then
        local ret = true
        for i = 1, OBJECTS_AMOUNT do
            if Objects[i].N ~= RightN[i] or Objects[i].M ~= RightM[i] then
                ret = false
                break
            end
        end
        -- Complete
        if ret == true then
            IgnoreAll(true)
            
            for i = 1, OBJECTS_AMOUNT do
                TimerDo(g_timer, 0.55, RotateRev, i)
                TimerDo(g_timer, 0.55 + 5/9, RotateFrw, i)
            end
            
            reset_now = true
            do
                local af = CreateAnimationEffector()
                af:AttachTo(local_button)
                af:SetKey(_TRACK_O, 1.8, 1)
                af:SetKey(_TRACK_O, 1.8 + 1.5, 0)
                af:Play()
            end
            
            MiniGameCompleted(1.8)
            change = true
        end
    end
    
    return change
end

function OnObjectMouseDown(object)
    obj_name = object:GetName()
    local is_wrong_click = true
    
    local obj = GetObjectByName(obj_name)
    
    if Stage == 1 then
        if obj and obj.State == 0 then
            IgnoreAll(true)
            RotateFrw(obj.Index)
            PlaySound("36_mg_rotate")
            obj.State = 1
        
            -- Если уже есть перевёрнутая табличка
            if PrevPlate then
                -- Правильно перевернули
                if PrevPlate.Type == obj.Type then
                    PrevPlate.State = 2
                    obj.State = 2
                    
                    TimerDo(g_timer, 5/9, IgnoreAll, false)
                    TimerDo(g_timer, 5/9, SetPlateColor, PrevPlate.Index, '0xFFC0C0C0')
                    TimerDo(g_timer, 5/9, SetPlateColor, obj.Index, '0xFFC0C0C0')
                    
                    SetStage()
                    PrevPlate = nil
                -- Неправильно
                else
                    PrevPlate.State = 0
                    obj.State = 0
                    TimerDo(g_timer, 0.75, RotateRev, PrevPlate.Index)
                    TimerDo(g_timer, 0.75, RotateRev, obj.Index)
                    TimerDo(g_timer, 0.8, PlaySound, "36_mg_rotate_wrong")
                    TimerDo(g_timer, 0.75 + 5/9, MovePlates, PrevPlate.Index, obj.Index)
                    TimerDo(g_timer, 0.8 + 5/9, PlaySound, "36_mg_move")
                    TimerDo(g_timer, 0.75 + 5/9 + 0.5, IgnoreAll, false)
                    PrevPlate = nil
                end
            -- Просто перевернуть табличку
            else
                PrevPlate = obj
                IgnoreAll(false)
            end
        end
    elseif Stage == 2 then
        if obj then
            IgnoreAll(true)
            
            if PrevPlate then
                -- Двигаем плиты
                if PrevPlate ~= obj then
                    SetPlateColor(obj.Index, '0xFFC0C0C0')
                    MovePlates(PrevPlate.Index, obj.Index)
                    PlaySound("36_mg_move")
                    TimerDo(g_timer, 0.5, SetPlateColor, PrevPlate.Index, '0xFFFFFFFF')
                    TimerDo(g_timer, 0.5, SetPlateColor, obj.Index, '0xFFFFFFFF')
                    TimerDo(g_timer, 0.5, IgnoreAll, false)
                    PrevPlate = nil
                    
                    SetStage()
                 -- Убрали выделение (повторный выбор плиты)
                 else
                    SetPlateColor(obj.Index, '0xFFFFFFFF')
                    IgnoreAll(false)
                    PrevPlate = nil
                 end
            -- Выбрали плиту
            else
                PrevPlate = obj
                SetPlateColor(PrevPlate.Index, '0xFFC0C0C0')
                IgnoreAll(false)
            end
        end
    end
    
    return is_wrong_click
end

function RotateFrw(index)
    TimerDo(g_timer, 1/9, function()
                            Objects[index].Entity:SetVisible(false)
                            Objects[index].Anim:Show()
                            --Objects[index].Anim:Go()
                            Objects[index].Anim:GetAnimation():Play()
                          end)
    TimerDo(g_timer, 4/9, function()
                            --Objects[index].Anim:Stop()
                            Objects[index].Anim:Hide()
                            Objects[index].Back:Show()
                          end)
end

function RotateRev(index)
    TimerDo(g_timer, 1/9, function()
                            Objects[index].Entity:SetVisible(false)
                            Objects[index].Back:Hide()
                            Objects[index].AnimRev:GetAnimation():Play()
                            --Objects[index].AnimRev:Go()
                            Objects[index].AnimRev:Show()
                          end)                          
    TimerDo(g_timer, 4/9, function()
                            --Objects[index].AnimRev:Stop()
                            Objects[index].AnimRev:Hide()
                            Objects[index].Entity:SetVisible(true)
                          end)
end

function MovePlates(index_1, index_2)
    local rect = {}
    table.insert(rect, Objects[index_1])
    table.insert(rect, Objects[index_2])

    -- find max/min    
    local max_n, max_m = rect[1].N, rect[1].M
    local min_n, min_m = rect[2].N, rect[2].M
    if max_n < rect[2].N then
        max_n = rect[2].N
        min_n = rect[1].N
    end
    if max_m < rect[2].M then
        max_m = rect[2].M
        min_m = rect[1].M
    end
    
    -- specific moments (hardcode)
    if max_n == min_n then
        min_n = 1
        max_n = 2
    elseif max_m == min_m then
        if min_m == 1 then
            min_m = 1
            max_m = 2
        elseif min_m == 2 then
            min_m = 2
            max_m = 3        
        elseif min_m == 3 then
            min_m = 2
            max_m = 4        
        elseif min_m == 4 then
            min_m = 3
            max_m = 4        
        elseif min_m == 5 then
            min_m = 4
            max_m = 5        
        end
    end
    
    -- move plates
    for i = 1, OBJECTS_AMOUNT do
        local n, m = Objects[i].N, Objects[i].M
        if n >= min_n and n <= max_n and m >= min_m and m <= max_m then
            if n == 1 then
                m = m + 1
                if m == max_m + 1 then
                    n = 2
                    m = max_m
                end
            elseif n == 2 then
                m = m - 1
                if m == min_m - 1 then
                    n = 1
                    m = min_m
                end
            end
            --
            Objects[i].Entity:MoveTo(Positions[n][m].x, Positions[n][m].y, 0.5)
            Objects[i].N, Objects[i].M = n, m
        end
    end
end

function SetPlateColor(index, color)
    Objects[index].Back:GetAnimation():SetColor(color)
end

function IgnoreAll(ignore)
    ignore = ignore or false    
    if ignore == true then
        ignore_level = ignore_level + 1
        if ignore_level > 0 then
            g_screen:GetObject('Block'):SetZ(150.0)
        end
    else
        ignore_level = ignore_level - 1
        if ignore_level <= 0 then
            g_screen:GetObject('Block'):SetZ(90.0)
        end
    end
end

function GetObjectByName(name)
    for i = 1, OBJECTS_AMOUNT do
        if Objects[i].Entity:GetName() == name then
            return Objects[i]
        end
    end
    return nil
end

function OnObjectMouseUp(object)
end

function OnObjectRightMouseDown(object)
end

function OnObjectRightMouseUp(object)
end

function OnObjectFound(object)
    DefaultOnObjectFound()
end

function OnToolFound(tool)
end

function OnToolApply(tool, object)
    DefaultOnToolApply(tool, object)
end

function OnSkipMiniGame()
	if game_state.minigame_complete then
        return
    end
    
    IgnoreAll(true)
    MiniGameCompleted(1.0)
end

function OnButtonPress(title)
    if title == 'ResetButton' and not game_state.minigame_complete then
        Reset()
    end
    
    DefaultMinigameOnButtonPress(title)
    
end

function OnMouseMove(previous_pos, current_pos)
end

function OnSetTool(tool)
end

function OnMinigameCompleted()
end

function OnLostFocus()
	DefaultMinigameOnLostFocus()
end

function OnGainFocus()
	DefaultMinigameOnGainFocus()
end

function ShowMiniGameHelp()
    if Stage == 2 then
        CreateDialogMiniGameHelp('MINI_GAME_HELP_PLATES_2')
    else
        CreateDialogMiniGameHelp('MINI_GAME_HELP_PLATES_1')
    end
end

-- CLEAR_ON_SAVE_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function LoadData(screen)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Background.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Background',anim,512,384,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate_1_1.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('PlateB_1',anim,198,286,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate_1_2.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('PlateB_2',anim,198,475,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate_2_1.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('PlateB_3',anim,359,286,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate_2_2.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('PlateB_4',anim,360,474,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate_3_1.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('PlateB_5',anim,516,285,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate_3_2.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('PlateB_6',anim,514,480,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate_4_1.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('PlateB_7',anim,672,286,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate_4_2.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('PlateB_8',anim,669,473,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate_5_1.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('PlateB_9',anim,833,287,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate_5_2.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('PlateB_10',anim,831,474,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Paper.png',0,0,292,154,1,0)
	anim:SetHotSpot(146,77)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Paper',anim,159,85,101,-9,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_plate.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_1',anim,198,308,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_plate.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_2',anim,198,501,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_plate.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_3',anim,358,308,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_plate.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_4',anim,359,486,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_plate.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_5',anim,515,306,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_plate.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_6',anim,516,499,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_plate.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_7',anim,671,309,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_plate.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_8',anim,669,489,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_plate.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_9',anim,832,308,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_plate.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_10',anim,831,495,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Plate_1',anim,200,285,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Plate_2',anim,360,285,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Plate_3',anim,515,285,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Plate_4',anim,673,285,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Plate_5',anim,833,285,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Plate_6',anim,200,472,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Plate_7',anim,360,472,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Plate_8',anim,515,472,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Plate_9',anim,673,472,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Plate.png',0,0,146,156,1,0)
	anim:SetHotSpot(73,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Plate_10',anim,833,472,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('Block',anim,516,384,90,0,100,50)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_rev.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_rev_1',anim,186,303,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_rev.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_rev_2',anim,345,303,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_rev.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_rev_3',anim,502,303,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_rev.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_rev_4',anim,660,301,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_rev.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_rev_5',anim,820,301,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_rev.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_rev_6',anim,187,490,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_rev.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_rev_7',anim,349,475,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_rev.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_rev_8',anim,507,483,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_rev.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_rev_9',anim,658,489,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/36_Plates/Anim_rev.png',0,0,170,198,3,9)
	anim:SetHotSpot(85,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Anim_rev_10',anim,818,509,103,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
