Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. /// Create Event
  2.  
  3. globalvar question, val1, val2, answer;
  4.  
  5. global.val1 = 0;
  6. global.val2 = 0;
  7. global.answer = 0;
  8.  
  9. global.val1 = irandom_range(0,3);
  10. global.val2 = irandom_range(0,3);
  11. global.question = "What is "+ string(global.val1)+ " + "+ string(global.val2) +"?";
  12.  
  13. global.answer = global.val1 + global.val2;
  14.  
  15. draw_set_alpha(1);
  16. draw_set_blend_mode(bm_normal);
  17. draw_set_font(fnt_arial);
  18. draw_set_color(c_white);
  19.  
  20. // Room code
  21. globalvar number, xloc, yloc;
  22.  
  23. for (i=0;i<2;i++) {
  24.  
  25. // A replacement "foreach" statement.
  26. switch(i) {
  27. case 0:
  28. xloc = 128;
  29. yloc = 352;
  30. number = global.val1;
  31. show_message(global.val1);
  32. break;
  33. case 1:
  34. xloc = 640;
  35. yloc = 352;
  36. number = global.val2;
  37. break;
  38. case 2:
  39. xloc = 800;
  40. yloc = 192;
  41. number = global.answer;
  42. break;
  43. default:
  44. xloc = 0;
  45. yloc = 0;
  46. number = 0;
  47. break;
  48. }
  49.  
  50. instance_create(xloc, yloc, obj_number); // Finally generate the object.
  51. }
  52.  
  53.  
  54. instance_create(32, 32, obj_question);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement