user888467
user888467

Reputation:

NetLogo - Display value of a turtle to monitor

I am creating two agents which are of breed players.

breed [players player]

The players will need to have certain attributes therefore I have used players-own

players-own 
[
   lives
   health
   score
]

I have then created the two players and set the values for the attributes.

create-players 2

  ask player 0
  [
    set lives 3
    set health 100
    set score 0
  ]

  ask player 1
  [
    set lives 5
    set health 100
    set score 0

  ]

The part I am struggling to work out is how can I display the value of player 0's lives in one monitor and the value of player 1's lives in another monitor.

Any help on this would be much appreciated :)

Upvotes: 2

Views: 6219

Answers (1)

Seth Tisue
Seth Tisue

Reputation: 30508

Put this code in one monitor:

[lives] of player 0

and this code in another:

[lives] of player 1

Upvotes: 7

Related Questions