# While loop & hitTestPoint malfunction

**URL:** <https://forum.kirupa.com/t/while-loop-hittestpoint-malfunction/304859>\
**Category:** flash\
**Created:** [February 15, 2010, 5:15pm UTC](https://forum.kirupa.com/t/while-loop-hittestpoint-malfunction/304859 "2010-02-15T17:15:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Setup56](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@Setup56](https://forum.kirupa.com/u/Setup56)\
**Post date:** [February 15, 2010, 5:15pm UTC](https://forum.kirupa.com/t/while-loop-hittestpoint-malfunction/304859/1 "2010-02-15T17:15:11Z")

</div>

```auto
 if (mc_Blockers.hitTestPoint(char_Anelianne.x,char_Anelianne.y-1,true)) {
  while (mc_Blockers.hitTestPoint(char_Anelianne.x,char_Anelianne.y,true)) {
   mc_Blockers.y ++;
  }
 }
 

```

This code serves the purpose of raising the character upon going up a hill. However, since the game will be on a large space (larger than the document size 1000x750) I am moving the ground (mc\_Blockers) instead. This code is supposed to push the mc\_Blockers down then it intercepts with the characters y. But instead, it just throws the character really high. When I examined it closely, it seemed to me that it threw the character up till the bounding box of the mc\_Blockers (the whole stage is drawn, I’m not using blocks for floor, etc.).
