I am wondering how extremely basic physics engines work and how I could implement them. lets say I have a player class (like a frame, except it holds the variables for the players), and I would like to add gravity. Could I go something like this
Player p = new Player(); p.addPhysics(gravity);
to add gravity to the player? Also I am wondering how easy would it be to do something like this with just gravity, and lets say different friction coefficients (ice, sand, grass, etc)?
Thanks for any help