Exemple #1
0
        public void update(GameTime gameTime)
        {
            if (this.movementQueue.hasNext() && this.actualMovement == null)
            {
                this.actualMovement = (BasicMovement)this.movementQueue.first();
                this.movementQueue.remove(this.actualMovement);
                this.actualMovement.onReady();
            }

            if (this.actualMovement != null)
            {
                if (!this.actualMovement.isPlaying())
                {
                    this.actualMovement.play();
                }

                this.actualMovement.update(gameTime);

                if (this.actualMovement.isFinished())
                {
                    this.actualMovement = null;
                }
            }

            onUpdate(gameTime);
        }
Exemple #2
0
        public BasicDrawable(float x, float y, Color color, float scale, float rotation)
        {
            this.color = color;
            this.x     = x;
            this.y     = y;

            this.rotation = rotation;
            this.scale    = scale;

            this.movementQueue  = new BasicCollection("movementQueue");
            this.actualMovement = null;

            this.hiden = false;
        }
Exemple #3
0
 public void addMovement(BasicMovement m)
 {
     m.drawable = this;
     this.movementQueue.add(m);
 }