# Slippery tiles?

**URL:** https://forum.kirupa.com/t/slippery-tiles/166776
**Category:** Uncategorized
**Created:** [October 22, 2005, 6:58pm UTC](https://forum.kirupa.com/t/slippery-tiles/166776 "2005-10-22T18:58:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Tarface](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@Tarface](https://forum.kirupa.com/u/Tarface)
#### Post date: [October 22, 2005, 6:58pm UTC](https://forum.kirupa.com/t/slippery-tiles/166776/1 "2005-10-22T18:58:15Z")

</div>

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?
