Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [CREATE]
- talking=false;
- 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.";
- txtcount=0;
- txtlength=0;
- displaytxt="";
- txtspeed=1;
- [DRAW EVENT]
- draw_me();
- if (distance_to_object(obj_player)<18){
- if (talking=false){
- draw_sprite(spr_down,0,x,y-25);
- }
- if (keyboard_check_pressed(vk_down)){
- talking=true
- obj_player.stop=true;
- }
- }
- if (talking=true){
- var currentletter;
- txtlength=string_length(txt);
- repeat(txtspeed){
- if (txtcount<txtlength){
- if (keyboard_check(vk_down))
- txtspeed=3;
- else
- txtspeed=1;
- txtcount+=1;
- currentletter=string_char_at(txt,floor(txtcount));
- displaytxt=displaytxt+string(currentletter);
- }
- else{
- if keyboard_check_pressed(vk_down){
- obj_player.stop=false;
- global.talk=false;
- talking=false;
- txtcount=0;
- txtlength=0;
- displaytxt="";
- txtspeed=1;
- }
- }
- }
- }
- if (talking=true){
- global.talk=true;
- draw_set_color(c_black);
- draw_set_font(fnt_text);
- draw_sprite(spr_text_box,0,view_xview+205,view_yview+78);
- draw_sprite(spr_portrait_sign,0,view_xview+248,view_yview+132);
- draw_text(view_xview+147,view_yview+10,displaytxt);
- obj_player.stop=true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement