Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Create:
  2. rw=room_width/4;
  3. rh=room_height/4;
  4. for (i=0; i<=rw; i+=1) {
  5. for (n=0; n<=rh; n+=1) {
  6. grid[i,n]=c_white;
  7. }
  8. }
  9. colselect=c_black;
  10. paint=surface_create(room_width,room_height)
  11. Draw:
  12. if (mouse_x<room_width-100) {
  13. if (mouse_check_button_pressed(mb_left)) {
  14. mx=(ceil(mouse_x/4)*4)/4-1;
  15. my=(ceil(mouse_y/4)*4)/4-1;
  16. grid[mx,my]=colselect;
  17. //m=mouse_x;
  18. //p=mouse_y;
  19. }
  20. if (mouse_check_button_released(mb_left)) {
  21. surface_set_target(paint)
  22. for (h=0; h<=rw-1; h+=1) {
  23. for (q=0; q<=rh-1; q+=1) {
  24. draw_set_color(grid[h,q])
  25. draw_rectangle(2+(h*4)-2,2+(q*4)-2,2+(h*4)+2,2+(q*4)+2,false)
  26. }
  27. }
  28. surface_reset_target()
  29. }
  30. }
  31. draw_surface(paint,0,0)
  32. draw_set_color(c_ltgray)
  33. draw_rectangle(room_width-100,0,room_width,room_height,false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement