Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. //take commands
  2. if (input == "text 1" && currentroom == "area_1")
  3. $("<p>reply 1.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  4. else if (input == "text 1" && "currentroom" != "area_1")
  5. $("<p>reply 2.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  6.  
  7.  
  8. //got to room
  9. if (input == "go to area 2" && "currentroom" == "area_1") {
  10. currentroom = "area_outside";
  11. $("<p>You are now in area 2.</p>");
  12. } else if (input == "go to area 2" && "currentroom" != "area_1")
  13. $("<p>You cant go that way.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  14.  
  15. if (input == "go to area 1" && "currentroom" == "area_2") {
  16. currentroom = "area_outside";
  17. $("<p>You are back in area 1.</p>")
  18. } else { //invaild commands/dont understand.
  19. $("<p>"+input+" is not vaild. type help for vaild commands.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  20. }
  21.  
  22. //take commands
  23. if (input == "text 1" && currentroom == "area_1") {
  24. $("<p>reply 1.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  25. }
  26. else if (input == "text 1" && "currentroom" != "area_1") {
  27. $("<p>reply 2.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  28. }
  29.  
  30. //got to room
  31. else if (input == "go to area 2" && "currentroom" == "area_1") {
  32. currentroom = "area_outside";
  33. $("<p>You are now in area 2.</p>")
  34. }
  35. else if (input == "go to area 2" && "currentroom" != "area_1") {
  36. $("<p>You cant go that way.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  37. }
  38. else if (input == "go to area 1" && "currentroom" == "area_2") {
  39. currentroom = "area_outside";
  40. $("<p>You are back in area 1.</p>")
  41. }
  42.  
  43. //invaild commands/dont understand.
  44. else {
  45. $("<p>"+input+" is not vaild. type help for vaild commands.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  46. }
  47.  
  48. if (input == "go to area 1" && "currentroom" == "area_2")
  49.  
  50. if (input == "go to area 1" && currentroom == "area_2")
  51. // No quotes ------------------^----------^
  52.  
  53. if (input == "text 1" && currentroom == "area_1") {
  54. $("<p>reply 1.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  55. }
  56. else if (input == "text 1" && currentroom != "area_1") {
  57. $("<p>reply 2.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  58. }
  59. else if (input == "go to area 2" && currentroom == "area_1") {
  60. currentroom = "area_outside";
  61. $("<p>You are now in area 2.</p>")
  62. }
  63. else if (input == "go to area 2" && currentroom != "area_1") {
  64. $("<p>You cant go that way.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  65. }
  66. else if (input == "go to area 1" && currentroom == "area_2") {
  67. currentroom = "area_outside";
  68. $("<p>You are back in area 1.</p>")
  69. }
  70. else {
  71. //invaild commands/dont understand.
  72. $("<p>" + input + " is not vaild. type help for vaild commands.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  73. }
  74.  
  75. "currentroom" == "area_2"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement