Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Create:
- rw=room_width/4;
- rh=room_height/4;
- for (i=0; i<=rw; i+=1) {
- for (n=0; n<=rh; n+=1) {
- grid[i,n]=c_white;
- }
- }
- colselect=c_black;
- paint=surface_create(room_width,room_height)
- Draw:
- if (mouse_x<room_width-100) {
- if (mouse_check_button_pressed(mb_left)) {
- mx=(ceil(mouse_x/4)*4)/4-1;
- my=(ceil(mouse_y/4)*4)/4-1;
- grid[mx,my]=colselect;
- //m=mouse_x;
- //p=mouse_y;
- }
- if (mouse_check_button_released(mb_left)) {
- surface_set_target(paint)
- for (h=0; h<=rw-1; h+=1) {
- for (q=0; q<=rh-1; q+=1) {
- draw_set_color(grid[h,q])
- draw_rectangle(2+(h*4)-2,2+(q*4)-2,2+(h*4)+2,2+(q*4)+2,false)
- }
- }
- surface_reset_target()
- }
- }
- draw_surface(paint,0,0)
- draw_set_color(c_ltgray)
- draw_rectangle(room_width-100,0,room_width,room_height,false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement