Hi all,
Well, finally I've something that works with pulleyjoint. it's coded in Tier2 with XCode (the first post test was done with Tier 1 in Windows 7), here is the code:
#include "template.h"
using namespace AGK;
app App;
float x=20.0f;
float y=20.0f;
int estado=0;
int sprBal1;
int sprBal2;
void app::Begin ( void )
{
agk::SetVirtualResolution ( 800, 600 );
agk::SetPhysicsGravity(0,150);
sprBal1=agk::CreateSprite(agk::LoadImage("campo.jpg"));
agk::SetSpriteScale(sprBal1,0.2,0.12);
agk::SetSpritePosition(sprBal1,150,300);
agk::SetSpritePhysicsOn(sprBal1,2);
agk::SetSpriteShape(sprBal1,2);
agk::SetSpritePhysicsMass(sprBal1,100);
sprBal2=agk::CreateSprite(agk::LoadImage("campo.jpg"));
agk::SetSpriteScale(sprBal2,0.2,0.12);
agk::SetSpritePosition(sprBal2,450,300);
agk::SetSpritePhysicsOn(sprBal2,2);
agk::SetSpriteShape(sprBal2,2);
agk::SetSpritePhysicsMass(sprBal2,100);
//Pulley parameters:
//Joint no., sprite 1, sprite 2, ground 1x, ground 2x, anchor 1x, anchor 2x, radius (not 0), collision
agk::CreatePulleyJoint(1,sprBal1,sprBal2,
agk::GetSpriteX(sprBal1)+(agk::GetSpriteWidth(sprBal1)/2),0,
agk::GetSpriteX(sprBal2)+(agk::GetSpriteWidth(sprBal2)/2),0,
agk::GetSpriteX(sprBal1)+(agk::GetSpriteWidth(sprBal1)/2),agk::GetSpriteY(sprBal1)+(agk::GetSpriteHeight(sprBal1)/2),
agk::GetSpriteX(sprBal2)+(agk::GetSpriteWidth(sprBal2)/2),agk::GetSpriteY(sprBal2)+(agk::GetSpriteHeight(sprBal2)/2),
1,0);
agk::SetPhysicsDebugOn();
}
void app::Loop ( void )
{
agk::Sync();
}
void app::End ( void )
{
// this function gets called when the game ends, in here you can clean up
// all resources and deal with things like saving game data
// master reset everything
}
I'm going to port it to Tier 1 in Windows, hope it works now.
Thanks!
Regards