"scroll in map"-ception

Started by Grew, April 05, 2016, 09:58:55 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Grew

Hi there !


I'm trying to draw a scroll on a process' map, then put this process in another scroll (which is the main scroll). But when I set my process ctype as c_scroll, the process is no longer displayed.
Here is a sample with the described bug (no resource needed, you can just copy/past the code) :


import "mod_video"
import "mod_key"
import "mod_text"
import "mod_sound"
import "mod_wm"
import "mod_map"
import "mod_draw"
import "mod_say"
import "mod_file"
import "mod_text"
import "mod_multi"
import "mod_mouse"
import "mod_proc"
import "mod_screen"
import "mod_rand"
import "mod_grproc"
import "mod_math"
import "mod_scroll"
import "mod_timers"
import "mod_mem"


process int main()
begin


    set_mode(500, 500, 32);
    set_fps(60, 0);

    scroll_main(); 
    scroll_proc();


    loop


        if(key(_esc))
            exit();
        end


        frame;
    end
end


process scroll_main()
private
    int scroll_angle;
begin
   
    graph = map_new(400, 400, 32, 0);
    scroll_start(0, 0, create_blue_texture(), 0, 0, 15, 0, graph);
x = 250;       
y = 250;

    loop

// Scroll 0 moves
        scroll[0].x0 = get_distx(scroll_angle, 50);
        scroll[0].y0 = get_disty(scroll_angle, 50);
        scroll_angle += 1000;     


        frame;
    end
end


process scroll_proc()
private
    int background_graph;
begin


    graph = map_new(100, 100, 32, 0);
    map_clear(0, graph, rgb(0,0,255));

    scroll_start(1, 0, create_red_texture(), 0, 0, 15, 0, graph);

// If you comment this line, you can see that the graphic is well displayed in c_screen type
    ctype = c_scroll;   

    x = 200;
    y = 200;
z = -50;

    loop
size = get_distx(angle, 25) + 75;
        angle += 1000; 
        scroll[1].x0++;
        frame;
    end
end


function create_blue_texture()
begin
x = map_new(10, 10, 32);
    map_clear(0, x, rgb(0, 0, 150));
    drawing_map(0, x);
    drawing_color(rgb(0, 0, 200));
    draw_box(0, 0, 4, 4);
    draw_box(5, 5, 10, 10);
return x;
end


function create_red_texture()
begin
x = map_new(10, 10, 32);
    map_clear(0, x, rgb(150, 0, 0));
    drawing_map(0, x);
    drawing_color(rgb(200, 0, 0));
    draw_box(0, 0, 4, 4);
    draw_box(5, 5, 10, 10);
return x;
end



What's wrong with my code ? I'm going crazy ^^ !!
My game developer instagram :
https://www.instagram.com/ben_dev_game/

l1nk3rn3l

ADD

FRAME; 

into  process scroll_proc()


here code:



import "mod_video"
import "mod_key"
import "mod_text"
import "mod_sound"
import "mod_wm"
import "mod_map"
import "mod_draw"
import "mod_say"
import "mod_file"
import "mod_text"
import "mod_multi"
import "mod_mouse"
import "mod_proc"
import "mod_screen"
import "mod_rand"
import "mod_grproc"
import "mod_math"
import "mod_scroll"
import "mod_timers"
import "mod_mem"


process int main()
begin


    set_mode(800, 600, 32);
    set_fps(60, 0);

    scroll_main(); 
    scroll_proc();


    loop


        if(key(_esc))
            exit();
        end


        frame;
    end
end


process scroll_main()
private
    int scroll_angle;
begin
   
    graph = map_new(400, 400, 32, 0);
    scroll_start(0, 0, create_blue_texture(), 0, 0, 15, 0, graph);
x = 250;       
y = 250;
 

    loop

// Scroll 0 moves
        scroll[0].x0 = get_distx(scroll_angle, 50);
        scroll[0].y0 = get_disty(scroll_angle, 50);
        scroll_angle += 1000;     


        frame;
    end
end




process scroll_proc()
private
    int background_graph;
begin


    graph = map_new(100, 100, 32, 0);
    map_clear(0, graph, rgb(0,0,255));

frame;
    scroll_start(1, 0, create_red_texture(), 0, 0, 15, 0, graph);
//    frame;

// If you comment this line, you can see that the graphic is well displayed in c_screen type
    ctype = c_scroll;   

    x = 200;
    y = 200;
z = -50;
// frame;


    loop
size = get_distx(angle, 25) + 75;
        angle += 1000; 
        scroll[1].x0++;
        frame;
    end
end


function create_blue_texture()
begin
x = map_new(10, 10, 32);
    map_clear(0, x, rgb(0, 0, 150));
    drawing_map(0, x);
    drawing_color(rgb(0, 0, 200));
    draw_box(0, 0, 4, 4);
    draw_box(5, 5, 10, 10);
return x;
end


function create_red_texture()
begin
x = map_new(10, 10, 32);
    map_clear(0, x, rgb(150, 0, 0));
    drawing_map(0, x);
    drawing_color(rgb(200, 0, 0));
    draw_box(0, 0, 4, 4);
    draw_box(5, 5, 10, 10);
return x;
end


Grew

My game developer instagram :
https://www.instagram.com/ben_dev_game/