The game loop happens in a callback function, you can register it with … tada: registerCallback

$.playground().registerCallback(function(){// do something here, function is called every 30ms},30);

$.playground().registerCallback(function() {
// do something here, function is called every 30ms
}, 30);

A sprite has an animation and can do collision detection. The pong-players and the ball are sprites.

// add a sprite to your playground
$.playground().addSprite('ball',{
animation:new $.gameQuery.Animation({
imageURL:"./blank.gif"}),
width:10,
height:10});// check if ball its a player, if so, change the direction by just changing the sign
$("#ball").collision('.player').each(function(){
$("#ball").get(0).gameQuery.velX=-$('#ball').get(0).gameQuery.velX;});