To understand the interest of methods and fields, first you need to understand the interest of Object Oriented Programming over procedural programming.
Let me try to explain:
OOP permit us to divide the problem at hand into entities.
This makes programming simpler as it allows us to think in a similar manner we solve problems in real life.
Indeed, facing a fairly complex problem, humans tend to divide one big problem into several smaller problems because they are easier to solve.
Once all the smaller problems are solved, the big one is as well.
In a game you may have an entity called "Enemy" and another one called "Player".
Enemy and Player are each of them capable of doing things.
For instance an Enemy might be alble to chase the Player and the Player might be able to jump.
The methods are the list of Actions that entities can do.
For example: enemy1.ChasePlayer() or player1.Jump().
The fields represents the "memory" of each object. Indeed , to accomplish actions (i.e. to use its methods) an object needs to know things about himself like its position e.g. player1.posx =12. This necessary knowledge is strored in the fields.
To give birth to objects, you need to create a Type (equivalent of a class in other OOP language such as Java and C#).
A type is really a blueprint. From one single blueprint of a house you can build as many houses as you want. The same apply to objects. If you create a Type "Enemy" we can create so many objects or "instances" of that type,we want to.
If you decide to create two enenies then at the same time (= in the same frame) one can have a position in X = 12 (i.e. enemy1.posx=12) and the second one can have a position in X = 24 (i.e. enemy2.posx=24).
Similarly at this same time (= in the same frame) enemy1 might be executing its ChasePlayer() method and enemy2 might be executing its Evade() method.
Hope this helps you a bit to grasp OOP.
Let me try to explain:
OOP permit us to divide the problem at hand into entities.
This makes programming simpler as it allows us to think in a similar manner we solve problems in real life.
Indeed, facing a fairly complex problem, humans tend to divide one big problem into several smaller problems because they are easier to solve.
Once all the smaller problems are solved, the big one is as well.
In a game you may have an entity called "Enemy" and another one called "Player".
Enemy and Player are each of them capable of doing things.
For instance an Enemy might be alble to chase the Player and the Player might be able to jump.
The methods are the list of Actions that entities can do.
For example: enemy1.ChasePlayer() or player1.Jump().
The fields represents the "memory" of each object. Indeed , to accomplish actions (i.e. to use its methods) an object needs to know things about himself like its position e.g. player1.posx =12. This necessary knowledge is strored in the fields.
To give birth to objects, you need to create a Type (equivalent of a class in other OOP language such as Java and C#).
A type is really a blueprint. From one single blueprint of a house you can build as many houses as you want. The same apply to objects. If you create a Type "Enemy" we can create so many objects or "instances" of that type,we want to.
If you decide to create two enenies then at the same time (= in the same frame) one can have a position in X = 12 (i.e. enemy1.posx=12) and the second one can have a position in X = 24 (i.e. enemy2.posx=24).
Similarly at this same time (= in the same frame) enemy1 might be executing its ChasePlayer() method and enemy2 might be executing its Evade() method.
Hope this helps you a bit to grasp OOP.