PDA

View Full Version : Slippery tiles??



Tarface
October 22nd, 2005, 02:58 PM
well im making a game and i want my character to run on some icey tiles and when he stops he will slide a bit, ive tried saying basically if(character is standing on a slippery tile){
if (speed >= 5){
speed = 5;
character.x += speed*dirx; //speed = 5
speed -= 0.5;
}
if (speed <= -5){
speed = 5;
character.x += speed*dirx; //speed = -5
speed += 0.5;
} else (speed == 0){
speed = 0;
char.gotoAndStop("idle");
}
}

but it doesnt work at all, i know its close, but way off at the same time, so could someone answer this question for me?

GPP
October 22nd, 2005, 03:08 PM
here http://www.kirupa.com/forum/showthread.php?t=192700