Making Computer Player
dyllan
Member Posts: 35
Hi GameSalad,
Does anybody know how to make a computer player? I have had an app idea which requires a computer player that selects things at random (5 items).
Thanks
Does anybody know how to make a computer player? I have had an app idea which requires a computer player that selects things at random (5 items).
Thanks
Comments
To point you in the right direction, you'd first need to have an integer or index attribute (lets call it dice).
Then when you need to make a selection, set dice to a random number between 1-5.
Then you could have rules that say:
if dice = 1 {do something}
if dice = 2 {do something else}
if dice = 3 {do something else}
if dice = 4 {do something else}
if dice = 5{do the last thing}.
This video shows you how to get started with random numbers: