D0nyAlcap0ney

Code for Dialogue Tutorial

Feb 24th, 2026
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Game Maker 11.55 KB | Source Code | 0 0
  1. ///Pastebin for Dialogue tutorial.
  2.  
  3. ///ScrHouseCall
  4.  
  5. draw_set_blend_mode(bm_subtract)
  6. draw_sprite_tiled(sprScanlines,0,x,my_y)
  7. my_y=random(32)
  8. draw_set_blend_mode(bm_normal)
  9.  
  10. if instance_exists(objPlayer) {
  11. width=display_get_width()
  12. height=display_get_height()
  13. factor=1
  14.  
  15. if global.xbox=1 {
  16. if checkbutton(0,getid(9)) {
  17. global.mousex=objPlayer.x+rightthumb_x(0)*0.009
  18. global.mousey=objPlayer.y-rightthumb_y(0)*0.006
  19. } else {
  20. if objPlayer.object_index=objPlayerMouse or objPlayer.object_index=objPlayerMouseHouse or objPlayer.object_index=objPlayerBiker or objPlayer.object_index=objPlayerBikerHouse {
  21. global.mousex=objPlayer.x+lengthdir_x(64,objPlayer.dir)
  22. global.mousey=objPlayer.y+lengthdir_y(64,objPlayer.dir)
  23. } else {global.mousex=objPlayer.x global.mousey=objPlayer.y}
  24. }
  25. } else {
  26. if keyboard_check_direct(vk_shift) factor=1.8
  27. global.mousex=objPlayer.x+((display_mouse_get_x()-width*0.5)*(view_wview[0]/width))*factor
  28. global.mousey=objPlayer.y+((display_mouse_get_y()-height*0.5)*(view_hview[0]/height))*factor
  29. }
  30. x=global.mousex
  31. y=global.mousey
  32. if instance_exists(global.enemy) {
  33. global.mousex=global.enemy.x
  34. global.mousey=global.enemy.y
  35. } else global.enemy=-1234
  36. }
  37. if !instance_exists(objMaskMenu) and !instance_exists(objPhoneConversation) global.time+=1
  38. if instance_exists(objDizzy) exit
  39. if blackx<15 blackx+=1
  40. global.dir+=1
  41. if action>0 {image_blend=merge_color(merge_color(c_aqua,c_fuchsia,0.5+lengthdir_x(0.5,global.dir*3.27)),c_white,0.5+lengthdir_y(0.5,global.dir*1.97))
  42. test=1
  43. if !instance_exists(objPlayer) test=0
  44. if instance_exists(objPlayerMouseHouse) {if objPlayer.aimon=0 test=0}
  45. if test=1 {
  46. draw_sprite_ext(sprCursorAction,action-1,global.mousex+1,global.mousey+1,1,1,-view_angle[0],c_black,0.5)
  47. draw_sprite_ext(sprCursorAction,action-1,global.mousex,global.mousey,1,1,-view_angle[0],image_blend,1)
  48. }
  49. }
  50.  
  51. test=1
  52. if !instance_exists(objPlayer) test=0
  53. if instance_exists(objPlayerMouseHouse) {if objPlayer.aimon=0 test=0}
  54. if instance_exists(objPhoneConversation) or instance_exists(objFinalDialogue) or instance_exists(objFinalDialogue2) test=0
  55. if test=1 {
  56. draw_sprite_ext(sprite_index,image_index,global.mousex+1,global.mousey+1,1,1,-view_angle[0],c_black,0.5)
  57. draw_set_blend_mode(bm_add)
  58. draw_sprite_ext(sprite_index,image_index,global.mousex,global.mousey,1,1,-view_angle[0],c_white,1)
  59. draw_set_blend_mode(bm_normal)
  60. }
  61. with objAnsweringMachine {
  62. if active=1 and sprite_index=sprDrawersH24Phone draw_sprite(sprArrow,image_index*2,x,y-16+lengthdir_x(3,global.dir*6))
  63. }
  64. with objPhone {
  65. if called=1 and answered=0 draw_sprite_ext(sprArrow,0,x,y-12+lengthdir_x(3,dir*2),1,1,0,c_white,1)
  66. }
  67.  
  68. with objBox {
  69. if global.phone=1 draw_sprite(sprArrow,global.dir,x,y-16+lengthdir_x(3,global.dir*6))
  70. }
  71.  
  72.  
  73. if room=rmMansionMainHall {
  74. if instance_exists(objBoss) {
  75. with objSpecificWeapon {
  76. if image_index=20 and instance_exists(objBodyguard) draw_sprite(sprArrow,global.dir,x,y-16+lengthdir_x(3,global.dir*6))
  77. if image_index=34 and !instance_exists(objBodyguard) and !instance_exists(objPBodyguardBash) and !instance_exists(objBodyguardCrawl) and !instance_exists(objPKillBodyguard) draw_sprite(sprArrow,global.dir,x,y-16+lengthdir_x(3,global.dir*6))
  78. }
  79. }
  80. }
  81.  
  82. d3d_set_projection_ortho(0,0,view_wview[0],view_hview[0],0)
  83.  
  84. if room=rmSequence12b {
  85. if !instance_exists(objPlayer) {
  86. dir+=8
  87. color2=merge_color(merge_color(c_aqua,c_fuchsia,0.5+lengthdir_x(0.5,dir*2.32)),c_white,0.5+lengthdir_x(0.5,dir*3))
  88. color1=merge_color(c_maroon,merge_color(c_aqua,c_fuchsia,0.5-lengthdir_x(0.5,dir*2.32)),0.75+lengthdir_x(0.25,dir*3))
  89. draw_set_halign(fa_center)
  90. draw_set_valign(fa_center)
  91. ammostring="R TO RESTART!"
  92. if ammoy<40 ammoy+=1 else ammoy=40
  93. if update=0 draw_set_font(fntScore) else draw_set_font(fntScoreUpdate)
  94. draw_set_color(c_black)
  95. draw_set_font(fntScore)
  96. draw_rectangle(0,view_hview[0]-ammoy-11,18+string_width(ammostring)+6,view_hview[0]-ammoy+11,0)
  97. draw_set_font(fntScore)
  98. draw_set_color(color1)
  99. draw_set_font(fntScore)
  100. if ammoy>-32 draw_text_transformed(18+string_width(ammostring)*0.5+lengthdir_x(1,dir),view_hview[0]-ammoy+lengthdir_y(1,dir),ammostring,1,1,lengthdir_x(2,dir))
  101. draw_set_color(color2)
  102. if ammoy>-32 draw_text_transformed(18+string_width(ammostring)*0.5+lengthdir_x(1,dir-180),view_hview[0]-ammoy+lengthdir_y(1,dir-180),ammostring,1,1,lengthdir_x(2,dir-10))
  103. }
  104. }
  105.  
  106.  
  107.  
  108.  
  109. if leveltitle="" nothing=1 else {
  110. if levelshow>0 levelshow-=1 else leveltitle=""
  111. draw_set_font(fntDate)
  112. draw_set_halign(fa_center)
  113. draw_set_valign(fa_top)
  114. if levelshow>180 draw_set_alpha((240-levelshow)*(1/60))
  115. if levelshow<60 draw_set_alpha(levelshow*(1/60))
  116. draw_set_color(c_black)
  117. draw_text(view_wview[0]/2+1,view_hview[0]*0.7+1,leveltitle)
  118. draw_set_color(c_white)
  119. draw_text(view_wview[0]/2,view_hview[0]*0.7,leveltitle)
  120. draw_set_alpha(1)
  121. }
  122.  
  123. with objGoToCar {
  124. if ammoy<36 ammoy+=4 else ammoy=40
  125. draw_set_color(c_black)
  126. draw_set_font(fntScore)
  127. ammostring="GO TO CAR!"
  128. draw_set_halign(fa_center)
  129. draw_set_valign(fa_center)
  130. draw_rectangle(0,view_hview[0]-ammoy-11,18+string_width(ammostring)+6,view_hview[0]-ammoy+11,0)
  131. draw_set_color(merge_color(c_teal,c_red,0.5+lengthdir_x(0.5,dir)))
  132. draw_text_transformed(18+string_width(ammostring)*0.5+lengthdir_x(1,dir),view_hview[0]-ammoy+lengthdir_y(1,dir),ammostring,1,1,lengthdir_x(2,dir*1.34))
  133. draw_set_color(merge_color(c_white,c_yellow,0.2+lengthdir_x(0.2,dir)))
  134. dir+=10
  135. draw_text_transformed(18+string_width(ammostring)*0.5+lengthdir_x(1,dir-180),view_hview[0]-ammoy+lengthdir_y(1,dir-180),ammostring,1,1,lengthdir_x(2,dir*1.34-10))
  136. }
  137.  
  138. scrStoryDrawAmmo()
  139.  
  140.  
  141. if fade=0 {
  142. if amount<180 {
  143. amount+=5-start*4
  144. color1=merge_color(c_black,merge_color(c_aqua,c_white,0.5+lengthdir_x(0.5,amount)),0.5+lengthdir_x(0.5,amount))
  145. if amount>90 color2=merge_color(c_black,merge_color(c_fuchsia,c_white,abs(lengthdir_y(1,amount))),abs(lengthdir_y(1,amount))) else color2=c_white
  146. draw_set_blend_mode(bm_subtract)
  147. draw_rectangle_color(-10,-10,view_wview[0]+10,view_hview[0]+10,color1,color2,color2,color1,0)
  148. draw_set_blend_mode(bm_normal)
  149. } else {start=0 show_date=0}
  150. }
  151.  
  152. if fade=1 {
  153. if amount>0  {
  154. amount-=10
  155. if restart=1 or newsong=1 {
  156. sxeasy_setVolume(amount*(1/180))
  157. }
  158. color1=merge_color(c_black,merge_color(c_aqua,c_white,0.5+lengthdir_x(0.5,amount)),0.5+lengthdir_x(0.5,amount))
  159. if amount>90 color2=merge_color(c_black,merge_color(c_fuchsia,c_white,abs(lengthdir_y(1,amount))),abs(lengthdir_y(1,amount))) else color2=c_white
  160. draw_set_blend_mode(bm_subtract)
  161. draw_rectangle_color(-10,-10,view_wview[0]+10,view_hview[0]+10,color2,color1,color1,color2,0)
  162. draw_set_blend_mode(bm_normal)
  163. } else {fade=0 if restart=1 {sxeasy_stop(1) sxeasy_setVolume(0) game_restart()//sxeasy_play(working_directory+"\HorseSteppin.mp3"); room=rmMenu
  164. } else {if next=1 {if newsong=1 {sxeasy_stop(1) if room=rmDream1 sxeasy_setVolume(0) sxeasy_play(song);} if room=rmTutorial sxeasy_stop(1) room=nextroom} else {scrResetSurfaces() game_load(working_directory+"\tempsave.sav")}}}
  165. }
  166. coldir+=1
  167.  
  168. scrDrawPlayer()
  169.  
  170. if show_date=1 {
  171. if room=rmSequence1 text="April 3rd, 1989#Miami - Florida"
  172. if room=rmSequence2 text="April 8th, 1989#Miami - Florida"
  173. if room=rmSequence3 text="April 16th, 1989#Miami - Florida"
  174. if room=rmSequence4 text="April 25th, 1989#Miami - Florida"
  175. if room=rmSequence5 text="May 5th, 1989#Miami - Florida"
  176. if room=rmSequence6 text="May 11th, 1989#Miami - Florida"
  177. if room=rmSequence7 text="May 13th, 1989#Miami - Florida"
  178. if room=rmSequence8 text="May 23rd, 1989#Miami - Florida"
  179. i=0
  180. draw_set_alpha(0.5+lengthdir_x(0.5,amount))
  181. draw_set_color(c_gray)
  182. draw_set_font(fntDate)
  183. draw_set_halign(fa_center)
  184. draw_set_valign(fa_center)
  185. draw_text(view_wview[0]/2+1,view_hview[0]/2+1,text)
  186. draw_set_color(c_white)
  187. draw_text(view_wview[0]/2,view_hview[0]/2,text)
  188. draw_set_alpha(1)
  189. //d3d_set_projection_ortho(0,0,view_wview[0],view_hview[0],0)
  190. }
  191.  
  192. if brus>0 {
  193. brus-=1
  194. if lastbrus=0 audio_play_sound(sndNoise,0,false)
  195. lastbrus=brus
  196. if brus=0 audio_stop_sound(sndNoise)
  197. draw_sprite_tiled(sprNoise,global.dir*0.5,0,0)
  198. draw_set_color(c_black)
  199. draw_rectangle(0,0,view_wview[0],blackx,0)
  200. draw_rectangle(0,view_hview[0],view_wview[0],view_hview[0]-blackx*1.5,0)
  201. }
  202.  
  203.  
  204.  
  205.  
  206. draw_set_blend_mode(bm_subtract)
  207. draw_circle_color(view_wview[0]/2,view_hview[0]/2,240+random(24)+24,c_black,merge_color(c_navy,c_aqua,0.25+random(0.25)),0)
  208. draw_set_blend_mode(bm_normal)
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218. if instance_exists(objPhoneConversation) {
  219. index=objPhoneConversation.index
  220. if blackx<45 blackx+=2.5
  221. if blackx>15 {
  222. if phonex<180 phonex+=10
  223. }
  224.  
  225. phonecolor1=merge_color(c_orange,c_lime,0.5+lengthdir_x(0.25,global.dir*2))
  226. phonecolor2=merge_color(c_maroon,c_navy,0.5+lengthdir_x(0.25,global.dir*2))
  227. if instance_exists(objLightingEngine) {
  228. with objLight {
  229. if targetstrength=1 {
  230. objEffector.phonecolor1=color
  231. objEffector.phonecolor2=c_black
  232. }
  233. }
  234. }
  235.  
  236.  
  237. draw_triangle_color(view_wview[0]-phonex,0,view_wview[0],0,view_wview[0],view_hview[0],phonecolor1,phonecolor1,phonecolor2,0)
  238. draw_triangle_color(view_wview[0]-phonex,0,view_wview[0]-phonex+70,view_hview[0],view_wview[0],view_hview[0],phonecolor1,phonecolor2,phonecolor2,0)
  239. draw_sprite_ext(sprPhoneLine,0,view_wview[0]-phonex,0,1,2,15,c_white,1)
  240. draw_set_color(c_black)
  241. draw_rectangle(0,0,view_wview[0],blackx,0)
  242. draw_rectangle(0,view_hview[0],view_wview[0],view_hview[0]-blackx*1.5,0)
  243. draw_sprite_ext(sprite,index,view_wview[0]-phonex+128+2,view_hview[0]/2+3,image_xscale,image_yscale,lengthdir_x(4,global.dir*1.67),c_black,0.5)
  244. draw_sprite_ext(sprite,index,view_wview[0]-phonex+128,view_hview[0]/2,image_xscale,image_yscale,lengthdir_x(4,global.dir*1.67),c_white,1)
  245. if blackx >= 45 {
  246. textcolor1=merge_color(merge_color(c_maroon,c_teal,0.5+lengthdir_x(0.5,global.dir)),c_black,objPhoneConversation.reload*0.1)
  247. textcolor2=merge_color(merge_color(c_white,c_yellow,0.25-lengthdir_x(0.25,global.dir)),c_black,objPhoneConversation.reload*0.1)
  248. draw_set_color(textcolor1)
  249. draw_set_halign(fa_left)
  250. draw_set_valign(fa_top)
  251. draw_set_font(fntScore)
  252. draw_text(17,view_hview[0]-57,(objPhoneConversation.line1[objPhoneConversation.current]))
  253. draw_text(17,view_hview[0]-39,(objPhoneConversation.line2[objPhoneConversation.current]))
  254. draw_set_color(textcolor2)
  255. draw_text(15.5-lengthdir_x(0.5,global.dir*4),view_hview[0]-58.5-lengthdir_x(0.5,global.dir*4), (objPhoneConversation.line1[objPhoneConversation.current]))
  256. draw_text(15.5-lengthdir_x(0.5,global.dir*4),view_hview[0]-40.5-lengthdir_x(0.5,global.dir*4), (objPhoneConversation.line2[objPhoneConversation.current]))
  257. }
  258. } else {
  259. if blackx>15 {
  260. if phonex>0 phonex-=10
  261. if phonex>40 {
  262. if blackx>15 blackx-=2.5
  263. }
  264.  
  265. if phonex>0 {
  266. phonecolor1=merge_color(c_orange,c_lime,0.5+lengthdir_x(0.25,global.dir*2))
  267. phonecolor2=merge_color(c_maroon,c_navy,0.5+lengthdir_x(0.25,global.dir*2))
  268. if instance_exists(objLightingEngine) {
  269. with objLight {
  270. if targetstrength=1 {
  271. objEffector.phonecolor1=color
  272. objEffector.phonecolor2=c_black
  273. }
  274. }
  275. }
  276. draw_triangle_color(view_wview[0]-phonex,0,view_wview[0],0,view_wview[0],view_hview[0],phonecolor1,phonecolor1,phonecolor2,0)
  277. draw_triangle_color(view_wview[0]-phonex,0,view_wview[0]-phonex+70,view_hview[0],view_wview[0],view_hview[0],phonecolor1,phonecolor2,phonecolor2,0)
  278. draw_sprite_ext(sprPhoneLine,0,view_wview[0]-phonex,0,1,2,15,c_white,1)
  279. }
  280. draw_set_color(c_black)
  281. draw_rectangle(0,0,view_wview[0],blackx,0)
  282. draw_rectangle(0,view_hview[0],view_wview[0],view_hview[0]-blackx*1.5,0)
  283. if phonex>0 {
  284. draw_sprite_ext(sprite,index,view_wview[0]-phonex+128+2,view_hview[0]/2+3,image_xscale,image_yscale,lengthdir_x(4,global.dir*1.67),c_black,0.5)
  285. draw_sprite_ext(sprite,index,view_wview[0]-phonex+128,view_hview[0]/2,image_xscale,image_yscale,lengthdir_x(4,global.dir*1.67),c_white,1)
  286. }
  287. }
  288. }
  289.  
Advertisement
Add Comment
Please, Sign In to add comment