diff --git a/src/main/java/JumpGame.java b/src/main/java/JumpGame.java index 8f1a260..caa33a5 100644 --- a/src/main/java/JumpGame.java +++ b/src/main/java/JumpGame.java @@ -1,5 +1,6 @@ import entities.*; import models.IModel; +import models.ModelType; import models.PlayerModel; import views.IView; import views.PlayerRenderer; @@ -22,17 +23,18 @@ //--------------------------------------------------------------- // new + private int i = 0; private ArrayList views = new ArrayList<>(); private ArrayList models = new ArrayList<>(); - private PlayerModel playerModel = new PlayerModel(ground); - //--------------------------------------------------------------- //--------------------------------------------------------------- // public void gravity(double y) { - // this.force.gravity(y); - // this.time.gravity(y); +// this.force.gravity(y); +// this.time.gravity(y); + PlayerModel playerModel = (PlayerModel) models.get(ModelType.PlayerModel); + playerModel.updateGravity(y); } //--------------------------------------------------------------- @@ -43,7 +45,8 @@ models.add(new PlayerModel(ground)); // view - views.add(new PlayerRenderer("resources/chicken.png")); + views.add(new PlayerRenderer("resources/chicken.png", 0.5)); + } //--------------------------------------------------------------- @@ -54,6 +57,7 @@ for (IModel model : models) { for (IView view : views) view.display(model); } + // Modelの更新 // // Space キーのインプット