A fox moves in a random direction if they haven't eaten enough food that turn

From TRCCompSci - AQA Computer Science
Revision as of 10:46, 25 May 2017 by Admin (talk | contribs)
Jump to: navigation, search

The Fox Class

Declare a new Boolean called MoveFox, this should be declared as private (you could make it simpler by declaring it public).

Then create a method to set this value.

Then create a method to get this value.

    private bool MoveFox = false;

    public void SetMoveFox(bool value) 
    {
        MoveFox = value;
    }

    public bool GetMoveFox()
    {
        return MoveFox;
    }