Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [CREATE]
  2. talking=false;
  3. txt="Press the [UP] button to jump.#The longer you hold#it down the higher you jump.#You can cling onto vines and#climb along them. Just press#[UP] when you are in the air.";
  4. txtcount=0;
  5. txtlength=0;
  6. displaytxt="";
  7. txtspeed=1;
  8.  
  9.  
  10. [DRAW EVENT]
  11. draw_me();
  12. if (distance_to_object(obj_player)<18){
  13.     if (talking=false){
  14.         draw_sprite(spr_down,0,x,y-25);
  15.         }
  16.     if (keyboard_check_pressed(vk_down)){
  17.         talking=true
  18.         obj_player.stop=true;
  19.         }
  20.     }
  21. if (talking=true){
  22.     var currentletter;
  23.     txtlength=string_length(txt);
  24.     repeat(txtspeed){
  25.         if (txtcount<txtlength){
  26.             if (keyboard_check(vk_down))
  27.                 txtspeed=3;
  28.             else
  29.                 txtspeed=1;
  30.             txtcount+=1;
  31.             currentletter=string_char_at(txt,floor(txtcount));
  32.             displaytxt=displaytxt+string(currentletter);
  33.             }
  34.         else{
  35.             if keyboard_check_pressed(vk_down){
  36.                 obj_player.stop=false;
  37.                 global.talk=false;
  38.                 talking=false;
  39.                 txtcount=0;
  40.                 txtlength=0;
  41.                 displaytxt="";
  42.                 txtspeed=1;
  43.                 }
  44.             }
  45.         }
  46.     }
  47. if (talking=true){
  48.     global.talk=true;
  49.     draw_set_color(c_black);
  50.     draw_set_font(fnt_text);
  51.     draw_sprite(spr_text_box,0,view_xview+205,view_yview+78);
  52.     draw_sprite(spr_portrait_sign,0,view_xview+248,view_yview+132);
  53.     draw_text(view_xview+147,view_yview+10,displaytxt);
  54.     obj_player.stop=true;    
  55.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement