Announcement

Collapse
No announcement yet.

[Source] Sprite Plugin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Source] Sprite Plugin

    This is the source code from my Sprite Plugin Demo, this is uncompleted but I was planing to do more to it, it works for the basic sprite movement this.

    PHP Code:
    Sprite = {};

    function 
    Sprite.Int()
        
    wait false;
        
    debug true;
        
    Up 0;
        
    Down 0;
        
    Left 0;
        
    Right 0;
        
    _WinHandle Application.GetWndHandle();
    end

    function Sprite.Easy(s_imaget_imagesn_widthn_heightn_speedm_lm_um_rm_d)
        --
    Application.SetPageScript("Page1""On Show""Sprite.Int();");
        
    OnKeyScript =[[-- Genareated by Easy function
    if 
    e_Key == _Left or e_Key == _UP or e_Key == _Right or e_Key == _Down then
        Sprite
    .Move(]]..tostring(s_image)..[[, e_Key, ]]..n_width..[[, ]]..n_height..[[, ]]..n_speed..[[, ]]..m_l..[[, ]]..m_u..[[, ]]..m_r..[[, ]]..m_d..[[);
        
    Sprite.Switch(]]..tostring(s_image)..[[, e_Key, ]]..t_images..[[);
    end]];
        --
    Application.SetPageScript("Page1""On Key"OnKeyScript);
        
    Dialog.Message(""OnKeyScript);
    end

    function Sprite.Move(s_imagem_drcn_widthn_heightn_speedm_lm_um_rm_d)
        
    WindSize Window.GetSize(Application.GetWndHandle());
        
    G_B = {00n_widthn_height};
        
    PCU_B = {Image.GetPos(s_image).Y,Image.GetPos(s_image).XImage.GetSize(s_image).WidthH=Image.GetSize(s_image).Height};
        
        if 
    n_speed == nil or n_speed == '' then
            n_speed 
    1;
        
    end
        
    if m_l == nil or m_l == '' then
            m_l 
    0;
        
    end
        
        
    if m_u == nil or m_u == '' then
            m_u 
    0;
        
    end
        
        
    if m_r == nil or m_r == '' then
            m_r 
    0;
        
    end
        
        
    if m_d == nil or m_d == '' then
            m_d 
    0;    
        
    end

        
    if m_drc == _UP then
            ImCon 
    PCU_B.m_u;
            if 
    ImCon <= G_B.Y then
                Y_Action 
    PCU_B.Y;
                
    X_Action PCU_B.X;
            else
                
    Y_Action PCU_B.Y-n_speed;
                
    X_Action PCU_B.X;
            
    end
        end
        
    if m_drc == _Down then
            ImCon 
    PCU_B.PCU_B.m_d;
            if 
    ImCon >= n_height then
                Y_Action 
    PCU_B.Y;
                
    X_Action PCU_B.X;
            else
                
    Y_Action PCU_B.Y+n_speed;
                
    X_Action PCU_B.X;
            
    end
        end
        
    if m_drc == _Left then
            ImCon 
    m_l;
            if 
    PCU_B.<= ImCon then
                Y_Action 
    PCU_B.Y;
                
    X_Action PCU_B.X;    
            else        
                
    Y_Action PCU_B.Y;
                
    X_Action PCU_B.X-n_speed;
            
    end
        end
        
    if m_drc == _Right then
            ImCon 
    PCU_B.PCU_B.m_r;
            if 
    ImCon >= n_width then
                Y_Action 
    PCU_B.Y;
                
    X_Action PCU_B.X;
            else
                
    Y_Action PCU_B.Y;
                
    X_Action PCU_B.X+n_speed;    
            
    end
        end
        
    if wait ~= true then
            Image
    .SetPos(s_imageX_ActionY_Action);
        
    end
    end

    function Sprite.Switch(s_imagem_drct_images)
        if 
    type(t_images) ~= 'table' then
            Dialog
    .Message('Eror''Argument 3 must be of a table type.');
            return 
    'Argument 3 must be of a table type.';
        else
            if 
    m_drc == _UP then
                Down 
    0;
                
    Left 0;
                
    Right 0;
                if 
    Up == or Up == 6 then
                    Image
    .Load(s_imaget_images.UP.One);
                    
    Up Up+1;
                elseif 
    Up == or Up == or Up == or Up == or Up == or Up == or Up == 10 or Up == 11 then
                    Up 
    Up+1;
                elseif 
    Up == 3 then
                    Image
    .Load(s_imaget_images.UP.Two);
                    
    Up Up+1;
                elseif 
    Up == 9 then
                    Image
    .Load(s_imaget_images.UP.Three);
                    
    Up Up+1;
                elseif 
    Up == 12 then
                    Up 
    0;
                
    end
            end
            
    if m_drc == _Down then
                Up 
    0;
                
    Left 0;
                
    Right 0;
                if 
    Down == or Down == 6 then
                    Image
    .Load(s_imaget_images.Down.One);
                    
    Down Down+1;
                elseif 
    Down == or Down == or Down == or Down == or Down == or Down == or Down == 10 or Down == 11 then
                    Down 
    Down+1;
                elseif 
    Down == 3 then
                    Image
    .Load(s_imaget_images.Down.Two);
                    
    Down Down+1;
                elseif 
    Down == 9 then
                    Image
    .Load(s_imaget_images.Down.Three);
                    
    Down Down+1;
                elseif 
    Down == 12 then
                    Down 
    0;
                
    end
            end
            
    if m_drc == _Left then
                Up 
    0;
                
    Down 0;
                
    Right 0;
                if 
    Left == or Left == 6 then
                    Image
    .Load(s_imaget_images.Left.One);
                    
    Left Left+1;
                elseif 
    Left == or Left == or Left == or Left == or Left == or Left == or Left == 10 or Left == 11 then
                    Left 
    Left+1;
                elseif 
    Left == 3 then
                    Image
    .Load(s_imaget_images.Left.Two);
                    
    Left Left+1;
                elseif 
    Left == 9 then
                    Image
    .Load(s_imaget_images.Left.Three);
                    
    Left Left+1;
                elseif 
    Left == 12 then
                    Left 
    0;
                
    end
            end
            
    if m_drc == _Right then
                Up 
    0;
                
    Down 0;
                
    Left 0;
                if 
    Right == or Right == 6 then
                    Image
    .Load(s_imaget_images.Right.One);
                    
    Right Right+1;
                elseif 
    Right == or Right == or Right == or Right == or Right == or Right == or Right == 10 or Right == 11 then
                    Right 
    Right+1;
                elseif 
    Right == 3 then
                    Image
    .Load(s_imaget_images.Right.Two);
                    
    Right Right+1;
                elseif 
    Right == 9 then
                    Image
    .Load(s_imaget_images.Right.Three);
                    
    Right Right+1;
                elseif 
    Right == 12 then
                    Right 
    0;
                
    end
            end
        end
    end 
    PasteBin

    Demo ********* Download

    Please remember to make sure your AV is up to date and enabled before downloading any files off the internet, I have checked this file with Avast but you should always check files before running them.
    Plugins or Sources MokoX
    BunnyHop 2021 Here
Working...
X