///set up array to hold data // 1 question // 2 answer a // 3 answer b // 4 answer a target [0 is none] // 5 answer b target [0 is none] global.diag[1,1]="Are you in a good mood?"; global.diag[1,2]="Yes, I'm in great mood."; global.diag[1,3]="No, I'm sad."; global.diag[1,4]=2; global.diag[1,5]=3;
global.diag[2,1]="That's great!#Would you like#some cheese?"; global.diag[2,2]="Yyes, I love cheese."; global.diag[2,3]="No. I'll pass."; global.diag[2,4]=4; global.diag[2,5]=5;
global.diag[3,1]="Too bad.#Can I sing#you a song?"; global.diag[3,2]="Yes. Sing me a#shanty song."; global.diag[3,3]="No. I'd rather you didn't."; global.diag[3,4]=6; global.diag[3,5]=7;
global.diag[4,1]="Brie or stilton?"; global.diag[4,2]="Brie, please."; global.diag[4,3]="Stilton, please."; global.diag[4,4]=10; global.diag[4,5]=8;
global.diag[5,1]="How about some gold?"; global.diag[5,2]="Yes, i'm after gold."; global.diag[5,3]="No, i have enough already."; global.diag[5,4]=11; global.diag[5,5]=14;
global.diag[6,1]="Yo ho ho &#a bottle of rum.#Want some rum?"; global.diag[6,2]="Yes. Hmm rum."; global.diag[6,3]="No. I don't drink."; global.diag[6,4]=15; global.diag[6,5]=12;
global.diag[7,1]="OK. Want to go fishing?"; global.diag[7,2]="Yes. Sounds good!"; global.diag[7,3]="No. Fishing is boring."; global.diag[7,4]=9; global.diag[7,5]=13;
global.diag[8,1]="Yuck! I prefer brie.##[r to restart]"; global.diag[8,2]=""; global.diag[8,3]=""; global.diag[8,4]=0; global.diag[8,5]=0;
global.diag[9,1]="Awesome! I'll get my rod.##[r to restart]"; global.diag[9,2]=""; global.diag[9,3]=""; global.diag[9,4]=0; global.diag[9,5]=0;
global.diag[10,1]="Great choice!##[r to restart]"; global.diag[10,2]=""; global.diag[10,3]=""; global.diag[10,4]=0; global.diag[10,5]=0;
global.diag[11,1]="Here's 1,000 coins.##[r to restart]"; global.diag[11,2]=""; global.diag[11,3]=""; global.diag[11,4]=0; global.diag[11,5]=0;
global.diag[12,1]="Probably for the best!##[r to restart]"; global.diag[12,2]=""; global.diag[12,3]=""; global.diag[12,4]=0; global.diag[12,5]=0;
global.diag[13,1]="OK be boring then!##[r to restart]"; global.diag[13,2]=""; global.diag[13,3]=""; global.diag[13,4]=0; global.diag[13,5]=0;
global.diag[14,1]="No gold! Your choice.##[r to restart]"; global.diag[14,2]=""; global.diag[14,3]=""; global.diag[14,4]=0; global.diag[14,5]=0;
global.diag[15,1]="Don't drink too much!##[r to restart]"; global.diag[15,2]="Continue"; global.diag[15,3]=""; global.diag[15,4]=16; global.diag[15,5]=0;
global.diag[16,1]="Maybe just have a coffee.##[r to restart]"; global.diag[16,2]=""; global.diag[16,3]=""; global.diag[16,4]=0; global.diag[16,5]=0;
global.message=1; global.gold=0; room_goto(room_dialogue); Information about object: obj_button_one
///Example Do Something - ie choose yes to question 5 if global.message==5 { global.gold+=1000; } //for every click global.message=global.diag[global.message,4];
Draw Event:
execute code:
if global.diag[global.message,2]!="" { var width=string_width(global.diag[global.message,2]); if width>50 // adjust image size if a long text option { var size=(250+(width-50))/250 image_xscale=size; } draw_self(); draw_set_font(font_message); draw_set_halign(fa_center); draw_set_valign(fa_middle); draw_set_colour(c_black); draw_text(x,y,global.diag[global.message,2]); }
if global.diag[global.message,3]!="" { var width=string_width(global.diag[global.message,3]); if width>50 // adjust image size if a long text option { var size=(250+(width-50))/250 image_xscale=size; } draw_self(); draw_set_font(font_message); draw_set_halign(fa_center); draw_set_valign(fa_middle); draw_set_colour(c_black); draw_text(x,y,global.diag[global.message,3]); }
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///drop a bomb / fruit & increase speed global.game_speed--; if global.game_speed<2 global.game_speed=2; alarm[0]=global.game_speed; drop=choose("bomb","fruit","fruit"); if drop=="bomb" { var bomb=instance_create(slot*64,120,obj_bomb); bomb.direction=270; bomb.speed=2; //audio_play_sound(choose(snd_ar_1,snd_ar_2),1,false); } if drop=="fruit" { var fruit=instance_create(slot*64,120,obj_fruit); fruit.direction=270; fruit.speed=2; //audio_play_sound(snd_bonus_coming,1,false); }
execute code:
///reset alarm alarm[0]=global.game_speed;
execute code:
///move //weigh it to move away from edge if slot==11 dir="left"; if slot==1 dir="right"; //choose next direction - wieghed to move in same direction dir=choose("left","right",dir,dir); if dir=="left" { image_xscale=-1; slot--;
} if dir=="right" { image_xscale=1; slot++; } //keep in range if slot<1 slot=1; if slot>11 slot=11;
Alarm Event for alarm 1:
execute code:
///send bomb scatter alarm[1]=room_speed*5;
var loop; for (loop = 210; loop < 350; loop += 15) { //audio_play_sound(choose(snd_ar_3,snd_ar_4),1,false); var bomb=instance_create(x,y,obj_scatter_bomb); bomb.direction=loop; bomb.speed=3; }
Alarm Event for alarm 2:
execute code:
alarm[2]=room_speed*8; //throw sword var sword=instance_create(x,y,obj_enemy_sword); sword.direction=point_direction(x,y,obj_player.x,obj_player.y); sword.speed=5;
Alarm Event for alarm 3:
execute code:
///jump up sprite_index=spr_pirate_jump; image_speed=0.5; image_index=0; alarm[3]=room_speed*10;
Step Event:
execute code:
///move to position slot move_towards_point(64*slot,y,4); //stop if x==64*slot { dir="idle"; speed=0; }
execute code:
///sprite control if sprite_index==spr_pirate_jump && image_index>=15 { sprite_index=spr_pirate_idle; image_index=0; image_speed=1; }
Collision Event with object obj_player_sword:
execute code:
if sprite_index==spr_pirate_jump { global.enemyhp-=5; //audio_play_sound(choose(snd_pirate_ouch_1,snd_pirate_ouch_2),1,false); } with (other) instance_destroy();
//keep in range if slot<1 slot=1; if slot>11 slot=11;
//stop if x==64*slot { dir=idle; speed=0; }
//make a sword if keyboard_check_pressed(vk_up) && can_shoot { can_shoot=false; alarm[0]=room_speed; var sword=instance_create(x,y,obj_player_sword); sword.direction=90; sword.speed=5; }
execute code:
///animation if dir=left sprite_index=spr_player_left; if dir=right sprite_index=spr_player_right;
No comments:
Post a Comment