What's the reasoning behind players.player(foo) and players.name(foo)?
setfocus("sign")
dosomething
dosomething()
belford wrote:What's the reasoning behind players.player(foo) and players.name(foo)?
The first is a player object, and the second is a string. They're not interchangeable. Use a player object to get a player properties, and to pass to other players.xxx() functions. The player name is only for printing.
the wiki wrote:players.player()
players.player(player)
Returns the name of the acting player, or the player with the given database key (an ObjectId). If the argument is a player object, this returns it unchanged.
if snakepos == 1:
if foodpos % 2 < 1:
foodpos -= 1
snakehunger += 3
elif snakepos == 2:
if foodpos % 4 < 2:
foodpos -= 2
snakehunger += 3
elif snakepos == 3:
if foodpos % 8 < 4:
foodpos -= 4
snakehunger += 3
elif snakepos == 4:
if foodpos < 8:
foodpos -= 8
snakehunger += 3
Users browsing this forum: No registered users and 2 guests