Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GameView() {
- AnimationTimer animationTimer = new AnimationTimer() {
- @Override
- public void handle(final long time) {
- updateGame()
- }
- };
- private void updateGame() {
- entitiesView.stream().forEach(entityView::update);
- }
- }
- EntityView() {
- EntityModel model;
- ImageView myImage;
- public EntityView(EntityModel model) {
- this.model = model;
- // creazione immagine e inserimento nella scena
- // etc..
- }
- public void update() {
- myImage.setX(model.getPosition().x);
- myImage.setY(model.getPosition().y);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement