# Hit.Test For detecting laser to Character collision

**URL:** https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341
**Category:** flash
**Created:** [October 4, 2002, 4:38pm UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341 "2002-10-04T16:38:08Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![cybergold](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cybergold](https://forum.kirupa.com/u/cybergold)
#### Post date: [October 4, 2002, 4:38pm UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/1 "2002-10-04T16:38:08Z")

</div>

Anyone know how i can get these lasers to work in the correct manner. For some reason, 2-3 seconds in the game, the game goes to the next frame. I can’t get the second player’s fire to stick with him as he travels across the screen. Here’s the fla.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 4, 2002, 4:38pm UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/2 "2002-10-04T16:38:51Z")

</div>

I am using Flash 5

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 4, 2002, 4:55pm UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/3 "2002-10-04T16:55:49Z")

</div>

well, your first ‘if statement’ on your lazers were empty:

```auto

onClipEvent (enterFrame) {
	if (this._name<>"laserr") {
	}
	this._x -= laserrMoveSpeed;
	if (this._x>600) {
		this.removeMovieClip();
	}
}

```

I changed this one to:

```auto

onClipEvent (enterFrame) {
	if (this._name<>"laserr") {
	this._x -= laserrMoveSpeed;
	if (this._x>600) {
		this.removeMovieClip();
	}
        }
}

```

do the same to the other one, and it should work. then just try to debug as necessary.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 4, 2002, 5:08pm UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/4 "2002-10-04T17:08:03Z")

</div>

The blue “laserr” won’t take the “enemy” ship as it’s source, what do i do?(won’t fire blue laser, blue laser located at a certain x/y position every time you fire. does not stick to the ship) Do you know how i can get letters as controls, they won’t work

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 4, 2002, 5:23pm UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/5 "2002-10-04T17:23:02Z")

</div>

I found out why the game says game over(frame 2) because the hit.Test which i put it in detects the invisible MC of the laser clip which is continually looping over and over. Anyone know how i can get rid of this one?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 4, 2002, 6:48pm UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/6 "2002-10-04T18:48:16Z")

</div>

The answer to that is switching the IF statement. That took care of it for me when I did it. That fixes it so that the Invisible Lazers don’t read the hitTest

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 4, 2002, 7:06pm UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/7 "2002-10-04T19:06:21Z")

</div>

You can use if (this.\_name != “laserr”). That’s from the David Duoll tuorial if I’m not mistaken. It’s a good firing system. For just a two player simple shooter - you can use a much simpler firing system though.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 4, 2002, 7:09pm UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/8 "2002-10-04T19:09:54Z")

</div>

P.S. You art seem to be better than mine. I’ve asked the designer dudes to help but had little response. Take a look at [http://flex.funkyolive.com/test/newgamedemo.html](http://flex.funkyolive.com/test/newgamedemo.html)

I the graphics here aren’t original but I want to use original ones. If you can help out, let me know.

Here’s the original thread [http://www.kirupaforum.com/showthread.php?s=&threadid=6959&pagenumber=1](http://www.kirupaforum.com/showthread.php?s=&threadid=6959&pagenumber=1) it’s a long one.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 4, 2002, 7:18pm UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/9 "2002-10-04T19:18:46Z")

</div>

I did say I wouldn’t be helping out that much more but when it comes to gaming stuff, well, sometimes I can’t resist it. See cybergold, you didn’t the fla after all! Ive been a little busy but if you do I have take that homer business out.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 5, 2002, 3:00am UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/10 "2002-10-05T03:00:10Z")

</div>

Looking for designers/animators? well, i can’t say i am that good in animating with pixels, but flash has simplified cartooning drastically. I could help you out in some fields, but i am severely limited in my concept of motion/moving characters around. Here is a vietnamese man i drew. I am having difficulty, getting boat motions and such though

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 5, 2002, 3:03am UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/11 "2002-10-05T03:03:15Z")

</div>

here is the fla

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 5, 2002, 3:45am UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/12 "2002-10-05T03:45:01Z")

</div>

If you’re serious about gaming, watch the flashkit games forum, read Ed Mack and Friends of Ed tutorials, Mad Sci, Outside of Society and play around with techniques. I’m still learning, but have learnt alot from tutorials from these guys.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 5, 2002, 3:48am UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/13 "2002-10-05T03:48:03Z")

</div>

pm = Private Mail? if so, you’ll have to send it again, i made it temporarily exclusive. try one more time though, it should work

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 5, 2002, 3:49am UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/14 "2002-10-05T03:49:38Z")

</div>

I’ve sent you a private message. Click on User cp tab at the top, then Private messages. Let me know when you’ve got it so I can take it off line.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 5, 2002, 3:52am UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/15 "2002-10-05T03:52:49Z")

</div>

River2 is not working, can’t think why not. Says “unexpected file format”

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 5, 2002, 3:55am UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/16 "2002-10-05T03:55:14Z")

</div>

found how to use the PM

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 5, 2002, 3:58am UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/17 "2002-10-05T03:58:13Z")

</div>

Did you get it?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 5, 2002, 4:00am UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/18 "2002-10-05T04:00:45Z")

</div>

Do you still want to keep the characters cartoon like? I will try making some characters with action, which game are you hoping to go with, the robot or kid one? give me some feedback

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 5, 2002, 4:01am UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/19 "2002-10-05T04:01:24Z")

</div>

I’m going with the robot one.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 5, 2002, 4:04am UTC](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341/20 "2002-10-05T04:04:51Z")

</div>

Got it

[Next page](https://forum.kirupa.com/t/hit-test-for-detecting-laser-to-character-collision/6341.md?page=2)
