예제 #1
0
        public override void onCollide(BasicSprite collided, Rectangle data, GameTime time)
        {
            base.onCollide(collided, data, time);

            // only if on top
            if (data.Height >= 1.0f)
            {
                collided.updatePositionFromVelocity(Velocity.FromCoordinates(0.0f, collided.velocity.getY() + velocity.getY()));
            }
        }
예제 #2
0
        public override void onCollide(BasicSprite collided, Rectangle data, GameTime time)
        {
            base.onCollide(collided, data, time);

            collided.updatePositionFromVelocity(velocity);
        }