Advertisement
TJSJ

T3 Test Code

Apr 6th, 2018
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.08 KB | None | 0 0
  1. Information about object: surveyButton
  2. Sprite: sprite0
  3. Solid: false
  4. Visible: true
  5. Depth: -1000
  6. Persistent: false
  7. Parent:
  8. Children:
  9. Mask:
  10.  
  11. No Physics Object
  12. Create Event:
  13.  
  14. execute code:
  15.  
  16. c_n3 = c_white
  17. c_n2 = c_white
  18. c_n1 = c_white
  19. c_0 = c_white
  20. c_1 = c_white
  21. c_2 = c_white
  22. c_3 = c_white
  23. questionSide = 0
  24. myscale = 1
  25. isHovering = false
  26. finish = false
  27.  
  28. Step Event:
  29.  
  30. execute code:
  31.  
  32. if global.disableBubble = 1
  33. {
  34. visible = false
  35. exit
  36. }
  37.  
  38. if distance_to_point(mouse_x,mouse_y) <= 0
  39. {
  40. image_xscale = myscale+2.2
  41. image_yscale = myscale+2.2
  42. isHovering = true
  43. }
  44. else
  45. {
  46. image_xscale = myscale+1
  47. image_yscale = myscale+1
  48. isHovering = false
  49. }
  50.  
  51. switch(questionSide)
  52. {
  53. case -3: myscale = 1.6; image_blend = c_n3; break;
  54. case -2: myscale = 1.4; image_blend = c_n2; break;
  55. case -1: myscale = 1.2; image_blend = c_n1; break;
  56. case 0: myscale = 1; image_blend = c_0; break;
  57. case 1: myscale = 1.2; image_blend = c_1; break;
  58. case 2: myscale = 1.4; image_blend = c_2; break;
  59. case 3: myscale = 1.6; image_blend = c_3; break;
  60. }
  61.  
  62. var leftclick = mouse_check_button_pressed(mb_left);
  63.  
  64. if leftclick && isHovering = true
  65. {
  66. global.qDV[global.q] = questionSide
  67. }
  68.  
  69. switch(global.qDV[global.q])
  70. {
  71. case -3:
  72. c_n3 = c_yellow; c_n2 = c_white; c_n1 = c_white; c_0 = c_white; c_1 = c_white; c_2 = c_white; c_3 = c_white; break;
  73. case -2:
  74. c_n3 = c_white; c_n2 = c_yellow; c_n1 = c_white; c_0 = c_white; c_1 = c_white; c_2 = c_white; c_3 = c_white; break;
  75. case -1:
  76. c_n3 = c_white; c_n2 = c_white; c_n1 = c_yellow; c_0 = c_white; c_1 = c_white; c_2 = c_white; c_3 = c_white; break;
  77. case 0:
  78. c_n3 = c_white; c_n2 = c_white; c_n1 = c_white; c_0 = c_yellow; c_1 = c_white; c_2 = c_white; c_3 = c_white; break;
  79. case 1:
  80. c_n3 = c_white; c_n2 = c_white; c_n1 = c_white; c_0 = c_white; c_1 = c_yellow; c_2 = c_white; c_3 = c_white; break;
  81. case 2:
  82. c_n3 = c_white; c_n2 = c_white; c_n1 = c_white; c_0 = c_white; c_1 = c_white; c_2 = c_yellow; c_3 = c_white; break;
  83. case 3:
  84. c_n3 = c_white; c_n2 = c_white; c_n1 = c_white; c_0 = c_white; c_1 = c_white; c_2 = c_white; c_3 = c_yellow; break;
  85. }
  86.  
  87.  
  88. Draw Event:
  89.  
  90. execute code:
  91.  
  92. draw_self()
  93. draw_set_font(font0)
  94.  
  95. var sd = "Strongly Disagree"
  96. var md = "Mostly Disagree"
  97. var d = "Somewhat Disagree"
  98. var na = "Neither Agree or Disagree"
  99. var a = "Somewhat Agree"
  100. var ma = "Mostly Agree"
  101. var sa = "Strongly Agree"
  102.  
  103. if global.disableBubble = 1 {exit}
  104.  
  105. draw_set_font(font4)
  106.  
  107. if isHovering = true
  108. {
  109. switch(questionSide)
  110. {
  111. case -3: text_draw(x-(string_width(sd)/2),y+50*1.55,string(sd),c_n3); break;
  112. case -2: text_draw(x-(string_width(md)/2),y+50*1.45,string(md),c_n2); break;
  113. case -1: text_draw(x-(string_width(d)/2),y+50*1.35,string(d),c_n1); break;
  114. case 0: text_draw(x-(string_width(na)/2),y+50*1.25,string(na),c_0); break;
  115. case 1: text_draw(x-(string_width(a)/2),y+50*1.35,string(a),c_1); break;
  116. case 2: text_draw(x-(string_width(ma)/2),y+50*1.45,string(ma),c_2); break;
  117. case 3: text_draw(x-(string_width(sa)/2),y+50*1.55,string(sa),c_3); break;
  118. }
  119. }
  120.  
  121. ______________________________________________________
  122.  
  123. Information about object: debug
  124. Sprite:
  125. Solid: false
  126. Visible: true
  127. Depth: 0
  128. Persistent: false
  129. Parent:
  130. Children:
  131. Mask:
  132.  
  133. No Physics Object
  134. Create Event:
  135.  
  136. execute code:
  137.  
  138. debugger = false
  139.  
  140. Draw Event:
  141.  
  142. execute code:
  143.  
  144. debugkey = keyboard_check(ord('D'))
  145.  
  146. if (debugkey) {
  147. switch(debugger) {
  148. case false: debugger = true;
  149. case true: debugger = false;
  150. }
  151. }
  152.  
  153. if debugger = true {
  154. text_draw(view_xview+64,view_yview+128,"",c_white)
  155. }
  156.  
  157.  
  158. ______________________________________________________
  159.  
  160. Information about object: surveyDummy
  161. Sprite:
  162. Solid: false
  163. Visible: true
  164. Depth: 0
  165. Persistent: false
  166. Parent:
  167. Children:
  168. Mask:
  169.  
  170. No Physics Object
  171. Create Event:
  172.  
  173. execute code:
  174.  
  175. ///CUSTOM PERSONALITY TEST
  176.  
  177. global.q = 1 // What question are you on?
  178. global.qtotal = 28 // How many questions are there in total?
  179. global.qDecisionValue = 0
  180. global.disableBubble = 0
  181. submitTest = 0
  182. finish = false
  183.  
  184. /*
  185.  
  186. Methodical vs Visceral // MV (Plan then act or act then plan?)
  187. Interpersonal vs Solitary // IS (Like working with people or like working alone?)
  188. Concrete vs Abstract // CA (Down to earth or hypothetical?)
  189. Grandiose vs Bashful // GB (Prideful or Humble?)
  190.  
  191. */
  192.  
  193. var i;
  194. i = global.qtotal;
  195. repeat(global.qtotal+1)
  196. {
  197. global.resultMV[i] = 0
  198. global.resultIS[i] = 0
  199. global.resultCA[i] = 0
  200. global.resultGB[i] = 0
  201. global.qDV[i] = 0
  202. global.qstring[i] = ""
  203. i -= 1;
  204. }
  205.  
  206. ///////////////////////////////
  207.  
  208. //////// THE QUESTIONS //////// //MV //IS //CA //GB
  209.  
  210. ///////////////////////////////
  211.  
  212. global.qstring[1] = "You would consider yourself#to be a risk-taker." //MV
  213. global.qstring[2] = "You have a large circle of friends." //IS (Reverse)
  214. global.qstring[3] = "You do not daydream." //CA (Reverse)
  215. global.qstring[4] = "You like to be in the spot light." //GB (Reverse)
  216. global.qstring[5] = "You come up with a plan rather than#figuring it out as you go." //MV (Reverse)
  217. global.qstring[6] = "You learn better with people than#you do on your own." //IS (Reverse)
  218. global.qstring[7] = "You like to think about theories and philosophies." //CA
  219. global.qstring[8] = "You like to have plenty of recognition." //GB (Reverse)
  220. global.qstring[9] = "You write a lot of notes for class#or a meeting." //MV (Reverse)
  221. global.qstring[10] = "You consider yourself to have a large#personal space bubble." //IS
  222. global.qstring[11] = "You often think about dreams or the future." //CA
  223. global.qstring[12] = "You are open with the things you like and do." //GB (Reverse)
  224. global.qstring[13] = "You prefer to explore instead of taking a#pre-determined route." //MV
  225. global.qstring[14] = "You look to others before making a decision." //IS (Reverse)
  226. global.qstring[15] = "You think of the present instead of the big picture." //CA (Reverse)
  227. global.qstring[16] = "You think highly of yourself." //GB (Reverse)
  228. global.qstring[17] = "You like to use a planner." //MV
  229. global.qstring[18] = "You get drained easily from socializing." //IS
  230. global.qstring[19] = "You focus more on your physical state#rather than your mental state." //CA (Reverse)
  231. global.qstring[20] = "People consider you to be a leader." //GB (Reverse)
  232. global.qstring[21] = "You prefer to work on a few large projects#instead of many smaller ones." //MV (Reverse)
  233. global.qstring[22] = "When you're designing art, you do so#in steps instead of improvizing." //MV (Reverse)
  234. global.qstring[23] = "You care about having your clothes match." //MV (Reverse)
  235. global.qstring[24] = "You like to have plenty of privacy." //IS
  236.  
  237. ///////////////////////////////
  238.  
  239. ///////////////////////////////
  240.  
  241. ///////////////////////////////
  242.  
  243. global.resultMV = 0
  244. global.resultIS = 0
  245. global.resultCA = 0
  246. global.resultGB = 0
  247. global.MV = ""
  248. global.IS = ""
  249. global.CA = ""
  250. global.GB = ""
  251.  
  252. ///////////////////////////////
  253.  
  254. // NO NEED TO EDIT!!! /////////
  255.  
  256. ///////////////////////////////
  257.  
  258.  
  259.  
  260. // CREATING THE ANSWER BUBBLES
  261.  
  262. xoff = 0
  263. qSide = -3
  264.  
  265. repeat(7)
  266. {
  267. with(instance_create(view_xview+view_wview/8+xoff,view_yview+view_hview/1.3,surveyButton))
  268. {
  269. questionSide = other.qSide
  270. }
  271. qSide += 1
  272. xoff += view_wview/8
  273. }
  274.  
  275. Step Event:
  276.  
  277. execute code:
  278.  
  279.  
  280. display_reset(0,true);
  281.  
  282. /////////////////////////////
  283. /////////////////////////////
  284. /////////////////////////////
  285.  
  286. if finish = true && keyboard_check(vk_control) && keyboard_check(ord('C'))
  287. {
  288. clipboard_set_text(string_copy(global.MV,1,1)+string_copy(global.IS,1,1)+string_copy(global.CA,1,1)+string_copy(global.GB,1,1);
  289. }
  290.  
  291. if keyboard_check_pressed(vk_left) && global.q > 1
  292. { global.q -= 1 }
  293.  
  294. if keyboard_check_pressed(vk_right) && global.q < global.qtotal
  295. { global.q += 1 }
  296.  
  297. if keyboard_check_pressed(vk_enter) && global.q = global.qtotal
  298. { global.disableBubble = 1; submitTest = 1; }
  299.  
  300. /* global.qDV[] */
  301.  
  302. if (submitTest = 1 && finish = false)
  303. {
  304.  
  305.  
  306. global.resultMV += ( // MV RESULT
  307. (global.qDV[1]
  308. + -(global.qDV[5])
  309. + -(global.qDV[9])
  310. + global.qDV[13])
  311. + global.qDV[17]
  312. + -(global.qDV[21])
  313. + -(global.qDV[22])
  314. + -(global.qDV[23])
  315. )
  316.  
  317. global.resultIS += ( // IS RESULT
  318. -(global.qDV[2])
  319. + -(global.qDV[6])
  320. + global.qDV[10]
  321. + -(global.qDV[14])
  322. + global.qDV[18]
  323. + global.qDV[24]
  324. )
  325.  
  326. global.resultCA += ( // CA RESULT
  327. (global.qDV[3]
  328. + global.qDV[7]
  329. + global.qDV[11])
  330. + -(global.qDV[15])
  331. + -(global.qDV[19])
  332. )
  333.  
  334. global.resultGB += ( // GB RESULT
  335. -(global.qDV[4])
  336. + -(global.qDV[8])
  337. + -(global.qDV[12])
  338. + -(global.qDV[16])
  339. + -(global.qDV[20])
  340. )
  341.  
  342. /*
  343. 1 MV
  344. 2 IS
  345. 3 CA
  346. 4 GB
  347. 5 MV
  348. 6 IS
  349. 7 CA
  350. 8 GB
  351. 9 MV
  352. 10 IS
  353. 11 CA
  354. 12 GB
  355. 13 MV
  356. 14 IS
  357. */
  358.  
  359. if global.resultMV < 0 { global.MV = "M-"+string(abs(global.resultMV)) }
  360. if global.resultMV > 0 { global.MV = "V-"+string(abs(global.resultMV)) }
  361. if global.resultMV = 0 { global.MV = "X-"+string(abs(global.resultMV)) }
  362.  
  363. if global.resultIS < 0 { global.IS = "I-"+string(abs(global.resultIS)) }
  364. if global.resultIS > 0 { global.IS = "S-"+string(abs(global.resultIS)) }
  365. if global.resultIS = 0 { global.IS = "X-"+string(abs(global.resultIS)) }
  366.  
  367. if global.resultCA < 0 { global.CA = "C-"+string(abs(global.resultCA)) }
  368. if global.resultCA > 0 { global.CA = "A-"+string(abs(global.resultCA)) }
  369. if global.resultCA = 0 { global.CA = "X-"+string(abs(global.resultCA)) }
  370.  
  371. if global.resultGB < 0 { global.GB = "G-"+string(abs(global.resultGB)) }
  372. if global.resultGB > 0 { global.GB = "B-"+string(abs(global.resultGB)) }
  373. if global.resultGB = 0 { global.GB = "X-"+string(abs(global.resultGB)) }
  374.  
  375. //audio_play_sound(lol,0,false) NO SOUND >:)
  376.  
  377. finish = true
  378.  
  379. }
  380.  
  381. if keyboard_check(ord('R')) { game_restart() }
  382.  
  383.  
  384.  
  385.  
  386. Draw Event:
  387.  
  388. execute code:
  389.  
  390. var col = c_aqua
  391. var title = "/* Temperament Type Test */"
  392. var testResults = "/* Your Score */##"+string(global.MV)+"#"+string(global.IS)+"#"+string(global.CA)+"#"+string(global.GB)+"##Press R to Restart Test."
  393.  
  394. draw_set_font(font1)
  395. if submitTest = 0
  396. {
  397. text_draw(view_xview+32,view_yview+view_hview/1.85,string(global.q)+". "+string(global.qstring[global.q]),col)
  398. }
  399.  
  400. draw_set_font(font3)
  401.  
  402. text_draw_ext(view_xview+84,view_yview+70,"
  403.  
  404. [Methodical/Visceral] [M-V] (Plan then act or act then plan?)
  405. [Interpersonal/Solitary] [I-S] (Like working with people or like working alone?)
  406. [Concrete/Abstract] [C-A] (Down to earth or hypothetical?)
  407. [Grandiose/Bashful] [G-B] (Prideful or Humble?)
  408.  
  409. ",c_yellow,-1,1000,1,1)
  410.  
  411. draw_set_font(font2)
  412.  
  413. text_draw(view_xview+(view_wview/6),view_yview+16,string(title),col)
  414.  
  415. if (global.q = global.qtotal && submitTest = 0)
  416. {
  417. text_draw(view_xview+32,view_yview+view_hview/1.1,"Press ENTER to Submit Test",c_white)
  418. }
  419.  
  420. draw_set_font(font4)
  421. if submitTest = 1
  422. {
  423. text_draw(view_xview+view_wview/3-string_width(testResults)/2,view_yview+view_hview/2.375,string(testResults),c_white)
  424. }
  425.  
  426.  
  427. ______________________________________________________
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement