i have a variable in one method and want to use it in a different one
if i try make it public it breaks the whole code

7 Replies

originally i made checkP1/2 into other variables but i thought it probably wasnt the easiest way to get it working
i also wanted to get rid of this block at the start

Either push the variable into the other method as an argument, or use class field/property
how would i do that
You're already doing it with other data
Like you pass team1 variable into penalty method
ohh i see
cheers