import entities.*; import models.IModel; import models.PlayerModel; import views.IView; import views.PlayerRenderer; import java.util.ArrayList; public class JumpGame { //--------------------------------------------------------------- // private Time time = new Time(); private Ground ground = new Ground(); // private Position position = new Position(ground); // private Gameover gameover = new Gameover(position); // private Onground onground = new Onground(ground, position); // private Velocity velocity = new Velocity(position, onground); // private Clear clear = new Clear(position); // private Move move = new Move(velocity); // private Acceleration acceleration = new Acceleration(velocity, onground); // private Force force = new Force(acceleration); // private Mass mass = new Mass(acceleration); //--------------------------------------------------------------- // new private ArrayList<IView> views = new ArrayList<>(); private ArrayList<IModel> models = new ArrayList<>(); private PlayerModel playerModel = new PlayerModel(ground); //--------------------------------------------------------------- //--------------------------------------------------------------- // public void gravity(double y) { // this.force.gravity(y); // this.time.gravity(y); } //--------------------------------------------------------------- // 初期化 public void init() { // model models.add(new PlayerModel(ground)); // view views.add(new PlayerRenderer("resources/test.png")); } //--------------------------------------------------------------- // 更新処理 public void update() { // Viewの更新 for (IModel model : models) { for (IView view : views) view.display(model); } // Modelの更新 // // Space キーのインプット // // マイフレーム更新 gravity(0.01); //重力 } //--------------------------------------------------------------- // デストラクタのような処理 public void delete() { for (IView view : views) view.delete(); } //--------------------------------------------------------------- //--------------------------------------------------------------- }