# Game

**URL:** <https://forum.kirupa.com/t/game/23157>\
**Category:** Uncategorized\
**Created:** [June 13, 2003, 7:10pm UTC](https://forum.kirupa.com/t/game/23157 "2003-06-13T19:10:37Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![SBV](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@SBV](https://forum.kirupa.com/u/SBV)\
**Post date:** [June 13, 2003, 7:10pm UTC](https://forum.kirupa.com/t/game/23157/1 "2003-06-13T19:10:37Z")

</div>

Im making a game with that firing thing i have a few questions, few have been mentioned before i believe, but i lost track of the topic and i searched for it and there was way to many topics…

Anyway, i made a game based on that crab.

I have made the enemies.  
I have made things that if the ship touches, it dies.  
Ihave made things taht if bullet touches, it disapears.

But out of them 3, i have only made the picture, i have no idea for the action script.

I want the enemies to randomly come at random times, also i want the obsitcals to come at random times.

Also, action script for walls and such.

-Thx in advanced.

P.S dont tell me to search, i have.

---

<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:** [June 13, 2003, 8:34pm UTC](https://forum.kirupa.com/t/game/23157/2 "2003-06-13T20:34:11Z")

</div>

Well i’m no game programmer so I can’t help you out much, but maybe this guy can…

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=25602](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=25602)

---

<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:** [June 13, 2003, 8:41pm UTC](https://forum.kirupa.com/t/game/23157/3 "2003-06-13T20:41:57Z")

</div>

I am no game code either, but here are some fla files I have picked up that may be able to help you.

TD

---

<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:** [June 13, 2003, 9:36pm UTC](https://forum.kirupa.com/t/game/23157/4 "2003-06-13T21:36:11Z")

</div>

Its helped with enemies, but when i hit them i dont die, and when i shoot them, they dont die.

Edit- Also, i want the enemies to come downwards, not sideways.

---

<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:** [June 13, 2003, 10:28pm UTC](https://forum.kirupa.com/t/game/23157/5 "2003-06-13T22:28:38Z")

</div>

You need collision detection to work out when two objects eg: you and the enemy have come together, then on that event, move to an explosion movie inside one of the sprites…

---

<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:** [June 13, 2003, 10:32pm UTC](https://forum.kirupa.com/t/game/23157/6 "2003-06-13T22:32:18Z")

</div>

How would i do that?

---

<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:** [June 13, 2003, 10:50pm UTC](https://forum.kirupa.com/t/game/23157/7 "2003-06-13T22:50:16Z")

</div>

This is a Flash 5 tute, but the theory remains the same for MX - [http://www.kirupa.com/developer/actionscript/hittest.htm](http://www.kirupa.com/developer/actionscript/hittest.htm) . Once you’ve got the movie able to tell when two objects have touched, you can just alter the code that happens on the event to destroy either your sprite or an enemy sprite.

---

<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:** [June 13, 2003, 11:05pm UTC](https://forum.kirupa.com/t/game/23157/8 "2003-06-13T23:05:08Z")

</div>

all sounds easy but can you do 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:** [June 13, 2003, 11:28pm UTC](https://forum.kirupa.com/t/game/23157/9 "2003-06-13T23:28:42Z")

</div>

Me? Yes. 🙂 I’ve got a Space Invaders game around somewhere, hang on let me see if I can find it… That’s got collision detection in it, might be helpful. 🙂

---

<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:** [June 13, 2003, 11:31pm UTC](https://forum.kirupa.com/t/game/23157/10 "2003-06-13T23:31:46Z")

</div>

well this will give me something to do

that and make me site:)

---

<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:** [June 14, 2003, 8:51am UTC](https://forum.kirupa.com/t/game/23157/11 "2003-06-14T08:51:27Z")

</div>

```auto
onClipEvent (load) {
	baddepth = 1000;
	_root.i = 0;
}
onClipEvent (mouseDown) {
	_root.i++;
	laserCheck++;
	_root.fired++;
	_root.shot.duplicateMovieClip("bullet"+_root.i, _root.i);
}
onClipEvent (enterFrame) {
	_root.perc = Math.round((_root.score/_root.fired)*100)+"%";
	if (laserCheck>50) {
		_root.i = 0;
		laserCheck = 0;
		trace("laser reset");
	}
	chance = random(35);
	if (chance == 10) {
		baddepth++;
		_root.baddie.duplicateMovieClip("baddie"+baddepth, baddepth);
	}
}

```

Well this is from tobys game, it works here but the enemies are going the wrong way, how do i make them go downwards and not sideways. Also there is only one enemy coming towards me now…

---

<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:** [June 14, 2003, 5:38pm UTC](https://forum.kirupa.com/t/game/23157/12 "2003-06-14T17:38:54Z")

</div>

There it is so far…

---

<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:** [June 17, 2003, 4:58pm UTC](https://forum.kirupa.com/t/game/23157/13 "2003-06-17T16:58:05Z")

</div>

Bump
