forked from Chasmiccoder/acm-rpg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added hemanth, but straying off path :(
- Loading branch information
1 parent
74f9bd7
commit bb98c90
Showing
4 changed files
with
91 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generate path for npc | ||
|
||
def f(_type, direction, time=0): | ||
if _type == "walk": | ||
print("{type:\"" + _type + "\",direction:\"" + direction + "\"},") | ||
else: # "stand" | ||
print("{type:\"" + _type + "\",direction:\"" + direction + "\",time:" + str(time) + "},") | ||
|
||
|
||
def p(direction_string): | ||
i = 0 | ||
while i < len(direction_string): | ||
dir = direction_string[i] | ||
if dir == "l": | ||
f("walk", "left") | ||
elif dir == "r": | ||
f("walk", "right") | ||
elif dir == "u": | ||
f("walk", "up") | ||
elif dir == "d": | ||
f("walk", "down") | ||
elif dir == "s": # stand | ||
i += 1 | ||
D = direction_string[i] | ||
f("stand", D, 500) | ||
i += 1 | ||
|
||
p("rurrdrrrrrsrdllllldllsuulu") |
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