Commit f232015f authored by owlo's avatar owlo

movement

parent e129ce75
No preview for this file type
......@@ -596,13 +596,82 @@ func main() {
if ok {
w.Header().Set("Authorization", "ok")
dir := req.Header.Get("Direction")
w.Header().Set("Room Desc", "A lone room in a love hotel:There is little in this room of interest.:A door into the verse stands to the east.")
w.Header().Set("Room Actions", "Your body is rezzed into being.")
w.WriteHeader(http.StatusOK)
room := flour.Dough(17, 17)
room = flour.Oven(room, "X", 17, 17)
xvar := 17
yvar := 17
room := flour.Dough(xvar, yvar)
room = flour.Oven(room, "X", xvar, yvar)
room[122].Label = "player"
switch dir {
case "east":
for i := range room {
if room[i].Label == "player" {
room[i+1].Label = "player"
room[i].Label = ""
break
}
}
case "west":
for i := range room {
if room[i].Label == "player" {
room[i-1].Label = "player"
room[i].Label = ""
break
}
}
case "north":
for i := range room {
if room[i].Label == "player" {
room[i-xvar].Label = "player"
room[i].Label = ""
break
}
}
case "south":
for i := range room {
if room[i].Label == "player" {
room[i+xvar].Label = "player"
room[i].Label = ""
break
}
}
case "northeast":
for i := range room {
if room[i].Label == "player" {
room[i-xvar+1].Label = "player"
room[i].Label = ""
break
}
}
case "northwest":
for i := range room {
if room[i].Label == "player" {
room[i-xvar-1].Label = "player"
room[i].Label = ""
break
}
}
case "southeast":
for i := range room {
if room[i].Label == "player" {
room[i+xvar+1].Label = "player"
room[i].Label = ""
break
}
}
case "southwest":
for i := range room {
if room[i].Label == "player" {
room[i+xvar-1].Label = "player"
room[i].Label = ""
break
}
}
}
space := ""
for x := range room {
done := false
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment