1
Graphics / Circular movement
« on: January 13, 2014, 06:25:33 pm »
Hello,
I want to let move circle in a circular path. How can I do that?
I tried this. It works, but this was not the solution for my problem => its completly wrong:
I think, I have to work with sin and cos, but I dont know how I can do that..
kurs
I want to let move circle in a circular path. How can I do that?
I tried this. It works, but this was not the solution for my problem => its completly wrong:
//if(stoney <= 100){down=true; up=false;}
//if(stoney >= 350){down=false; up=true;}
//if(down==true,up==false)
//{
// stone.move(0,Speed*ElapsedTime);
//}
//else if(down==false,up==true)
//{
// stone.move(0,-Speed*ElapsedTime);
//}
//if(stonex <= 125){right=true; left=false;}
//if(stonex >= 375){right=false; left=true;}
//if(right==true,left==false)
//{
// stone.move(Speed*ElapsedTime,0);
//}
//else if(right==false,left==true)
//{
// stone.move(-Speed*ElapsedTime,0);
//}
//std::cout << "X: " << stonex << " Y: " << stoney << std::endl;
//if(stoney >= 350){down=false; up=true;}
//if(down==true,up==false)
//{
// stone.move(0,Speed*ElapsedTime);
//}
//else if(down==false,up==true)
//{
// stone.move(0,-Speed*ElapsedTime);
//}
//if(stonex <= 125){right=true; left=false;}
//if(stonex >= 375){right=false; left=true;}
//if(right==true,left==false)
//{
// stone.move(Speed*ElapsedTime,0);
//}
//else if(right==false,left==true)
//{
// stone.move(-Speed*ElapsedTime,0);
//}
//std::cout << "X: " << stonex << " Y: " << stoney << std::endl;
I think, I have to work with sin and cos, but I dont know how I can do that..
kurs