# Help me with a Scorched Earth-like game!

**URL:** <https://forum.kirupa.com/t/help-me-with-a-scorched-earth-like-game/120518>\
**Category:** Uncategorized\
**Created:** [August 25, 2004, 2:55am UTC](https://forum.kirupa.com/t/help-me-with-a-scorched-earth-like-game/120518 "2004-08-25T02:55:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonathanCarter](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@JonathanCarter](https://forum.kirupa.com/u/JonathanCarter)\
**Post date:** [August 25, 2004, 2:55am UTC](https://forum.kirupa.com/t/help-me-with-a-scorched-earth-like-game/120518/1 "2004-08-25T02:55:37Z")

</div>

I am making a game somewhat similar to Scorched Earth in Flash MX 2004. What I need help with is making a gun who’s rotation is controlled by arrow keys.

This is as far as I have gotten so far but I will definately need further help once this step is completed.

I just need script to make the gun rotate at 10 degree intervals and keep track of its position with a variable.

After this I will make different weapons to be fired out of the gun.

---

<div class="post-metadata">

**Author:** ![Moopers](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Moopers](https://forum.kirupa.com/u/Moopers)\
**Post date:** [August 25, 2004, 3:30am UTC](https://forum.kirupa.com/t/help-me-with-a-scorched-earth-like-game/120518/2 "2004-08-25T03:30:55Z")

</div>

Just have an mc that’s a turret and put this code in.

onClipEvent(enterFrame){  
//keep track of position  
position=this.\_rotation;  
//to rotate the turret…  
if (Key.isDown(Key.RIGHT)){  
this.\_rotation+=10;  
}  
if (Key.isDown(Key.LEFT)){  
this.\_rotation-=10;  
}  
}

remember to put the movie clip origin on one side of the turret so it rotates correctly.

---

<div class="post-metadata">

**Author:** ![Skribble](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Skribble](https://forum.kirupa.com/u/Skribble)\
**Post date:** [August 25, 2004, 3:36am UTC](https://forum.kirupa.com/t/help-me-with-a-scorched-earth-like-game/120518/3 "2004-08-25T03:36:23Z")

</div>

Here you go. Hope this is what you meant.

:EDIT::

aahh moopers beat me to it. **shakes fist at moopers** ^.^

---

<div class="post-metadata">

**Author:** ![Moopers](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Moopers](https://forum.kirupa.com/u/Moopers)\
**Post date:** [August 25, 2004, 1:13pm UTC](https://forum.kirupa.com/t/help-me-with-a-scorched-earth-like-game/120518/4 "2004-08-25T13:13:14Z")

</div>

heh heh heh

---

<div class="post-metadata">

**Author:** ![JonathanCarter](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@JonathanCarter](https://forum.kirupa.com/u/JonathanCarter)\
**Post date:** [August 25, 2004, 2:16pm UTC](https://forum.kirupa.com/t/help-me-with-a-scorched-earth-like-game/120518/5 "2004-08-25T14:16:20Z")

</div>

Wow, thanks Moopers! I would give you a dollar!

If the attacher thing works, than here’s what it looks like so far.

I’ll post again once I’m finished making the power control bar.
