# Common question about collision test

**URL:** <https://forum.kirupa.com/t/common-question-about-collision-test/230952>\
**Category:** programming\
**Created:** [June 30, 2007, 12:59pm UTC](https://forum.kirupa.com/t/common-question-about-collision-test/230952 "2007-06-30T12:59:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fw2803](https://avatars.discourse-cdn.com/v4/letter/f/e5b9ba/32.png) [@fw2803](https://forum.kirupa.com/u/fw2803)\
**Post date:** [June 30, 2007, 12:59pm UTC](https://forum.kirupa.com/t/common-question-about-collision-test/230952/1 "2007-06-30T12:59:38Z")

</div>

Hi there  
I’ve read through many tutorials from different sites. However, I still cannot make my tank stop upon hitting obstacles!  
I have two obstacles with instance names “obstacle0” and “obstacle1” placed on the stage. I’ve tried the array-method for testing collision among multiple objects but I failed. I typed in the following codes on the **first** frame:

```auto

var obstacles = ["obstacle0","obstacle1"]
//obstacle hit test
numObstacles = obstacles.length
for (i=0;i<numObstacles;i++) {
 obstacle = obstacles*
 temp = eval(obstacle)
 if (temp.hitTest(_root.stnk)) {
  _root.stnk.speed = 0
 }
}

```

My script is based on [this](http://www.kirupa.com/forum/www.kirupa.com/developer/actionscript/multiple_collision.htm) kirupa tutorial. I wonder if I misinterpreted something as my case is just similar to the case in the tutorial.

Well… i better add the 10.4kb-only file here.

Basic controls  
Arrow keys - movement  
Spacebar - fire missiles  
Q and W - rotate turret and control the direction of fly missiles  
Shift - fire deadly laser  
A - speed boost (under construction)  
S - cloaking device (another problem encountered, in my other thread)

Erm… Forgot to tell you that the grey rotating thing is the service depot where you can reload everything and the green small things on the ground are mines…
