Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// Create Event
- globalvar question, val1, val2, answer;
- global.val1 = 0;
- global.val2 = 0;
- global.answer = 0;
- global.val1 = irandom_range(0,3);
- global.val2 = irandom_range(0,3);
- global.question = "What is "+ string(global.val1)+ " + "+ string(global.val2) +"?";
- global.answer = global.val1 + global.val2;
- draw_set_alpha(1);
- draw_set_blend_mode(bm_normal);
- draw_set_font(fnt_arial);
- draw_set_color(c_white);
- // Room code
- globalvar number, xloc, yloc;
- for (i=0;i<2;i++) {
- // A replacement "foreach" statement.
- switch(i) {
- case 0:
- xloc = 128;
- yloc = 352;
- number = global.val1;
- show_message(global.val1);
- break;
- case 1:
- xloc = 640;
- yloc = 352;
- number = global.val2;
- break;
- case 2:
- xloc = 800;
- yloc = 192;
- number = global.answer;
- break;
- default:
- xloc = 0;
- yloc = 0;
- number = 0;
- break;
- }
- instance_create(xloc, yloc, obj_number); // Finally generate the object.
- }
- instance_create(32, 32, obj_question);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement