Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 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. }
  5. else if (input == "text 1" && "currentroom" != "area_1") {
  6. $("<p>reply 2.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  7. }
  8.  
  9. //got to room
  10. if (input == "go to area 2" && "currentroom" == "area_1") {
  11. currentroom = "area_outside";
  12. $("<p>You are now in area 2.</p>")
  13. }
  14. else if (input == "go to area 2" && "currentroom" != "area_1") {
  15. $("<p>You cant go that way.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  16. }
  17. if (input == "go to area 1" && "currentroom" == "area_2") {
  18. currentroom = "area_outside";
  19. $("<p>You are back in area 1.</p>")
  20. }
  21.  
  22. //invaild commands/dont understand.
  23. else {
  24. $("<p>"+input+" is not vaild. type help for vaild commands.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  25. }
  26.  
  27. //take commands
  28. if (input == "text 1" && currentroom == "area_1") {
  29. $("<p>reply 1.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  30. }
  31. else if (input == "text 1" && "currentroom" != "area_1") {
  32. $("<p>reply 2.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  33. }
  34.  
  35. //got to room
  36. else if (input == "go to area 2" && "currentroom" == "area_1") {
  37. currentroom = "area_outside";
  38. $("<p>You are now in area 2.</p>")
  39. }
  40. else if (input == "go to area 2" && "currentroom" != "area_1") {
  41. $("<p>You cant go that way.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  42. }
  43. else if (input == "go to area 1" && "currentroom" == "area_2") {
  44. currentroom = "area_outside";
  45. $("<p>You are back in area 1.</p>")
  46. }
  47.  
  48. //invaild commands/dont understand.
  49. else {
  50. $("<p>"+input+" is not vaild. type help for vaild commands.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement