# Problem with platform game

**URL:** https://forum.kirupa.com/t/problem-with-platform-game/26960
**Category:** Uncategorized
**Created:** [July 28, 2003, 7:10pm UTC](https://forum.kirupa.com/t/problem-with-platform-game/26960 "2003-07-28T19:10:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Theory](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@Theory](https://forum.kirupa.com/u/Theory)
#### Post date: [July 28, 2003, 7:10pm UTC](https://forum.kirupa.com/t/problem-with-platform-game/26960/1 "2003-07-28T19:10:02Z")

</div>

I have a platform game, where you can move side to side, and jump.

When you push CONTROL, your character fires a bullet that goes EAST, and only east.  
(or right if you dont know directions)  
(the bullet is actually a clip, and when it hits an enemy, its takes the enemy to the second frame within themselves.)

Here is the actionscript I have for the bullet:

onClipEvent (load) {

laserMoveSpeed=20;  
this.\_x=\_root.character.\_x+57;  
this.\_y=\_root.character.\_y-48;

}

onClipEvent (enterFrame) {  
if (this.\_name\<\>“laser”){  
this.\_x+=laserMoveSpeed;  
if (this.\_x\>550){  
\_root.character.laserCounter–;  
this.removeMovieClip();  
}

if (this.hitTest( \_root[“enemy”])){  
\_root.score+=10;  
\_root[“enemy”].gotoAndPlay( 2 );  
}

}  
}

Is there a way you could make it so, if you push right, your character faces right, and fires right.

But if you push left, your character faces left, and fires left.

Ive been trying to get this for a while… Is it something like

Make 4 keyframes within the character.

1. Facing right
2. Firing right
3. Facing left
4. Firing left

The actionscript I have for JUST standing right, and JUST firing right, is:

if (Key.isDown(Key.CONTROL) and (laserCounter\<=maxLasers)) {

laserCounter++;  
\_root.laser.duplicateMovieClip( “laser”+depthCounter, depthCounter );  
\_root[“laser”+depthCounter].\_visible=true;  
depthCounter++;  
if (depthCounter\>maxLasers){  
depthCounter=1;  
}  
}  
}

If you dont want to help, I understand. Its a very complicated question…

---

<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: [July 28, 2003, 9:26pm UTC](https://forum.kirupa.com/t/problem-with-platform-game/26960/2 "2003-07-28T21:26:04Z")

</div>

No ones gonna respond? alright…

---

<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: [July 29, 2003, 12:13am UTC](https://forum.kirupa.com/t/problem-with-platform-game/26960/3 "2003-07-29T00:13:36Z")

</div>

Can you post 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: [July 29, 2003, 2:45am UTC](https://forum.kirupa.com/t/problem-with-platform-game/26960/4 "2003-07-29T02:45:37Z")

</div>

Ill post the SWF… Dont want anyone stealin 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: [July 29, 2003, 2:46am UTC](https://forum.kirupa.com/t/problem-with-platform-game/26960/5 "2003-07-29T02:46:17Z")

</div>

…OK so the file didnt attach…
