Line of sight now works, and is required to look at things. Foundations for NPCs has also been laid.
This commit is contained in:
parent
267f0e9123
commit
e0b88e7a45
4 changed files with 151 additions and 17 deletions
|
@ -235,10 +235,12 @@ Object can be the name of the object, or its coordinates."""
|
|||
if args[0] == 'the':
|
||||
args.pop(0)
|
||||
thing, x, y = self.parseCoords(args, usePlayerCoords = False)
|
||||
if thing:
|
||||
print(self.justifyText(str(thing)), file = self.outstream)
|
||||
else:
|
||||
if not self.level.lineOfSight(self.playerx, self.playery, x, y):
|
||||
print("{} cannot see that.".format(self.playerName))
|
||||
elif thing == None:
|
||||
print("There is nothing to see here.\n", file = self.outstream)
|
||||
else:
|
||||
print(self.justifyText(str(thing)), file = self.outstream)
|
||||
#_hq.heappush(self.eventQueue, (self.gameTime, _ge.NoOpEvent()))
|
||||
|
||||
def use(self, args):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue