- Code: Select all
xvelocity+=0.1;
if(xvelocity==0)
{
xvelocity=0;
}
I'm trying to make it so that my character will slow down to a complete stop, but I did something wrong...
xvelocity+=0.1;
if(xvelocity==0)
{
xvelocity=0;
}
xvelocity*=0.99;
if(xvelocity<0.1){
xvelocity=0;}
if (xvelocity>0)
{
xvelocity = xvelocity - .99;
}
if (xvelocity<0.01)
{
xvelocity = 0;
}
Hblade wrote:you could try this
- Code: Select all
if (xvelocity>0)
{
xvelocity = xvelocity - .99;
}
if (xvelocity<0.01)
{
xvelocity = 0;
}
xvelocity+=0.1;
Users browsing this forum: No registered users and 1 guest