Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //take commands
- if (input == "text 1" && currentroom == "area_1")
- $("<p>reply 1.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
- else if (input == "text 1" && "currentroom" != "area_1")
- $("<p>reply 2.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
- //got to room
- if (input == "go to area 2" && "currentroom" == "area_1") {
- currentroom = "area_outside";
- $("<p>You are now in area 2.</p>");
- } else if (input == "go to area 2" && "currentroom" != "area_1")
- $("<p>You cant go that way.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
- if (input == "go to area 1" && "currentroom" == "area_2") {
- currentroom = "area_outside";
- $("<p>You are back in area 1.</p>")
- } else { //invaild commands/dont understand.
- $("<p>"+input+" is not vaild. type help for vaild commands.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
- }
- //take commands
- if (input == "text 1" && currentroom == "area_1") {
- $("<p>reply 1.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
- }
- else if (input == "text 1" && "currentroom" != "area_1") {
- $("<p>reply 2.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
- }
- //got to room
- else if (input == "go to area 2" && "currentroom" == "area_1") {
- currentroom = "area_outside";
- $("<p>You are now in area 2.</p>")
- }
- else if (input == "go to area 2" && "currentroom" != "area_1") {
- $("<p>You cant go that way.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
- }
- else if (input == "go to area 1" && "currentroom" == "area_2") {
- currentroom = "area_outside";
- $("<p>You are back in area 1.</p>")
- }
- //invaild commands/dont understand.
- else {
- $("<p>"+input+" is not vaild. type help for vaild commands.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
- }
- if (input == "go to area 1" && "currentroom" == "area_2")
- if (input == "go to area 1" && currentroom == "area_2")
- // No quotes ------------------^----------^
- if (input == "text 1" && currentroom == "area_1") {
- $("<p>reply 1.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
- }
- else if (input == "text 1" && currentroom != "area_1") {
- $("<p>reply 2.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
- }
- else if (input == "go to area 2" && currentroom == "area_1") {
- currentroom = "area_outside";
- $("<p>You are now in area 2.</p>")
- }
- else if (input == "go to area 2" && currentroom != "area_1") {
- $("<p>You cant go that way.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
- }
- else if (input == "go to area 1" && currentroom == "area_2") {
- currentroom = "area_outside";
- $("<p>You are back in area 1.</p>")
- }
- else {
- //invaild commands/dont understand.
- $("<p>" + input + " is not vaild. type help for vaild commands.</p>").hide().insertBefore("#placeholder").fadeIn(1000);
- }
- "currentroom" == "area_2"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement