J
JesterLuciferDeath
Guest
Tell me if this is right, because I get this:
Objects / Characters / char_unknowngirl / Create / Code
image_speed = .2
global.text = false
Objects / Characters / char_unknowngirl / Step / Code
if ( distance_to_object ( char_unknowngirl ) < 4 ) {
if (keyboard_check_pressed (vk_space) && global.text = false)
instance_create ( x , y , obj_cryngshdetxt )
}
Objects / Objects / obj_cryngshdetxt / Create / Code
text1 = string ("I.... I'm sorry lord...")
text2 = string ("I... I couldn't protect my little lamb..")
text3 = string ("I... I.. I thought he was safe..")
text4 = string ("(You attempt to get her attention, even yelling..)")
text5 = string ("(....She seems to not notice you...?)")
talk = 0
global.text = true
out = string ("")
spd = 0
Objects / Objects / obj_cryngshdetxt / Step / Code
if ( distance_to_object ( obj_cryngshdetxt ) < 4 ) {
image_index = 1;
}
else
{
image_index = 0;
}
depth = -y;
if talk = 1 {
out = string_copy (text1, 1, spd);
}
if talk = 2 {
out = string_copy (text2, 1, spd);
}
if talk = 3 {
out = string_copy (text3, 1, spd);
}
if talk = 4 {
out = string_copy (text4, 1, spd);
}
if talk = 5 {
out = string_copy (text5, 1, spd);
}
spd += 0.25
if ( keyboard_check_pressed ) ( vk_space ) ){
talk += 1;
spd = 0;
}
if ( talk > 5 ) {
instance_destroy();
}
Objects / Objects / obj_cryngshdetxt / Draw / Code
draw_set_font(font);
draw_set_valign(fa_top);
draw_set_halign(fa_left);
if ( talk = 1 ) {
draw_sprite (obj_cryngshdetxt, 0, view_xview[0], view_yview[0]+240);
draw_set_color(c_white)
draw_text (view_xview[0], view_yview[0]+240-75, out);
}
if ( talk = 2 ) {
draw_sprite (obj_cryngshdetxt, 0, view_xview[0], view_yview[0]+240);
draw_set_color(c_white)
draw_text (view_xview[0], view_yview[0]+240-75, out);
}
if ( talk = 3 ) {
draw_sprite (obj_cryngshdetxt, 2, view_xview[0], view_yview[0]+240);
draw_set_color(c_red)
draw_text (view_xview[0], view_yview[0]+240-75, out);
}
if ( talk = 4 ) {
draw_sprite (obj_cryngshdetxt, 3, view_xview[0], view_yview[0]+240);
draw_set_color(c_white)
draw_text (view_xview[0], view_yview[0]+240-75, out);
}
if ( talk = 5 ) {
draw_sprite (obj_cryngshdetxt, 4, view_xview[0], view_yview[0]+240);
draw_set_color(c_white)
draw_text (view_xview[0], view_yview[0]+240-75, out);
}
Objects / Characters / char_unknowngirl / Create / Code
image_speed = .2
global.text = false
Objects / Characters / char_unknowngirl / Step / Code
if ( distance_to_object ( char_unknowngirl ) < 4 ) {
if (keyboard_check_pressed (vk_space) && global.text = false)
instance_create ( x , y , obj_cryngshdetxt )
}
Objects / Objects / obj_cryngshdetxt / Create / Code
text1 = string ("I.... I'm sorry lord...")
text2 = string ("I... I couldn't protect my little lamb..")
text3 = string ("I... I.. I thought he was safe..")
text4 = string ("(You attempt to get her attention, even yelling..)")
text5 = string ("(....She seems to not notice you...?)")
talk = 0
global.text = true
out = string ("")
spd = 0
Objects / Objects / obj_cryngshdetxt / Step / Code
if ( distance_to_object ( obj_cryngshdetxt ) < 4 ) {
image_index = 1;
}
else
{
image_index = 0;
}
depth = -y;
if talk = 1 {
out = string_copy (text1, 1, spd);
}
if talk = 2 {
out = string_copy (text2, 1, spd);
}
if talk = 3 {
out = string_copy (text3, 1, spd);
}
if talk = 4 {
out = string_copy (text4, 1, spd);
}
if talk = 5 {
out = string_copy (text5, 1, spd);
}
spd += 0.25
if ( keyboard_check_pressed ) ( vk_space ) ){
talk += 1;
spd = 0;
}
if ( talk > 5 ) {
instance_destroy();
}
Objects / Objects / obj_cryngshdetxt / Draw / Code
draw_set_font(font);
draw_set_valign(fa_top);
draw_set_halign(fa_left);
if ( talk = 1 ) {
draw_sprite (obj_cryngshdetxt, 0, view_xview[0], view_yview[0]+240);
draw_set_color(c_white)
draw_text (view_xview[0], view_yview[0]+240-75, out);
}
if ( talk = 2 ) {
draw_sprite (obj_cryngshdetxt, 0, view_xview[0], view_yview[0]+240);
draw_set_color(c_white)
draw_text (view_xview[0], view_yview[0]+240-75, out);
}
if ( talk = 3 ) {
draw_sprite (obj_cryngshdetxt, 2, view_xview[0], view_yview[0]+240);
draw_set_color(c_red)
draw_text (view_xview[0], view_yview[0]+240-75, out);
}
if ( talk = 4 ) {
draw_sprite (obj_cryngshdetxt, 3, view_xview[0], view_yview[0]+240);
draw_set_color(c_white)
draw_text (view_xview[0], view_yview[0]+240-75, out);
}
if ( talk = 5 ) {
draw_sprite (obj_cryngshdetxt, 4, view_xview[0], view_yview[0]+240);
draw_set_color(c_white)
draw_text (view_xview[0], view_yview[0]+240-75, out);
}
Last edited by a moderator: