Making A Shooter And I Need Some Help
i would like a gun shot wound to show up on the enemy where ever i shoot him/her
FlashKit > Flash Help > Flash ActionScript
Posted on: 02-14-2006, 11:42 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Help On Making A Shooter Game
I'm begging with something very simple. My characters move, can be shoot, and it displays if you shot the person or not. Now that I have done that, I am so proud as dumb as that is, I'm gonna make more missions to my game. So I wanted to know, how would I make a game were say I had five people on screen and each could be shot. How would I make it so that they can be shot in any order and so that they all have timers for when they shoot at you, and finally a life bar. HOW?!? After I know the answer though I'll wonder how I missed it. :-)
Making A Shooter Game
Ok...im making a shooter game, where dudes run around the area and you have to shoot them. Now everything was going fine until i wanted the guy to get shot, Now i had a button over the top, that apparantly should have lead to the dying frame....but it isn't seeming to register as a button, can any one help?
Or even better could someone rectify the old FLA. file, then send it back, and tell me where i went wrong?
Making Scrolling Shooter, Need A Bit Of Help
I'm making a scrolling shooter. Here's the title screen: jordanissex.googlepages.com/aerostrike.html
If u press enter, you'll see an early version of the controls. When you turn left/right the plane slants/tips slightly, but it sort of "clicks" right to that frame. I have a sprite of the plane in between:
Straight:
ziggystardustmedicaldoctor.googlepages.com/straight.png
Left, transition:
ziggystardustmedicaldoctor.googlepages.com/left1.png
Left:
ziggystardustmedicaldoctor.googlepages.com/left2.png
..and i want to make it sort of animated, so that when you press left, or right, it smoothly (somewhat, how smooth could it be with 2 frames) tips in that direction. If that makes any sense.
Help?
Plz&Thx.
-Jordan
Making A Mech Blow Stuff Up(side View Shooter Disscusion
this thread is about side view shooters
any one working on a side view shooter who needs help or wants to help me i want in here posting ideas, theres no good thread on the subject so lets get one going
---whats a good way to rotate towards the mouse and fire for a side view shooter
+delay between reloading
+bullets with varrying speed for diffrent guns
---hit testing the ground and surondings
+landing on platforms
+hitting walls
+jumping
---hittesting the enemy and bullets and player for bullets
+realistic animations for being hit and hittings omthing
---bouncing grenades
---picking up items
+inventorys
---real and simulated physics
+ive seen some pretty amazing looking fake physics i will share at some point in this thread
!---!enemy ai ( THIS IS THE PART I NEED HELP WITH)
AND MOST IMPORTANTLY the best side view shooters youve played
mine are thingthing arena 2 and wpn fire(destruction mode)
POST QUESTIONS COMMENTS IDEAS AND QUESTIONS IVE FORGOTEN tommorow i wil be posting my answers to these questions and i want to hear yours
Making A First-person Shooter: How To "pop-up" Enemies?
Greetings All!
A coworker of mine will retire in a few months. As a way of having a bit of fun with him, I thought it'd be great if I could build a first-person shooter game with Flash... as if he came back after retirement and went "postal" !
(Yeah, it's a bit gruesome, but this guy is a grumpy old crumudgeon, so we'd be poking fun at his temper a bit.)
I thought I could take actual interior photos around here for
backgrounds... and I could turn the stock employee photos that
are "out there" on our network and make them the targets.
So, I've been reading various tutorials and trying things...
in-between my regular duties.
What I'd like to do is have my targets / victims "pop up"
randomly. But the only tutorials I'm finding that discuss this
usually talk about making a separate object... such as a trash
can... and putting it in a "higher layer" on the background, then
putting your randomly generated target-person-image behind it...
and then turn that image into a movie clip that slowly moves up
the stage to reveal itself.
I really don't want to throw other objects into the picture. I
thought perhaps there would be some way to create the target
movie clip so that it slowly reveals itself onto the stage ??
I originally hit upon this idea when I stumbled onto a game that's in the "Full source" subcategory in the game section. (However, the download does NOT seem to have ANY source code in it, from what I can tell.) It's the "chaingun" game:
http://www.flashkit.com/movies/Games...1175/index.php
I tried posting on that developer's blog well over a week ago, asking for the full source. I haven't heard anything back yet.
Thanks!
-= Dave =-
Shooter
Hi! I have another question. I want to make a shooter game, actually, a very simple one. I want to be able to click on the enemies (while thy just tstand there) and kill them, but I want to know how to make it so that if you don't shoot them fast enough they will shoot you and you will loose life. The problem for me, since I am sort of a beginner and I Don't know anything about actionscript, I don't know how to make the enemies movie clips so that they can be killed by being clicked on. Anyways, if anybody understands what i mean and can help me I thank you in advance!
Shooter Help
can oyu guys take a look at these two fla's i am wondering why when i copied the bullet mc and the aimer mc why the bullet doesn't stay there when you shoot again like it does in this stupid shooter i made a little ago, could you guys take a look thanks
wait i just saved as mx and now it works why would that be here is the fla
Help Me Out Plz - Shooter
ok i may just as well be the biggest flash noob in the entire planet, and i'm trying to make a basic shooter.
I got up right to the point when i tried to animate the game to fire when i press the mouse button.
I put this script on the crosshair movie clip:
onClipEvent(mouseDown) {
_root."pointer".gotoAndPlay(2);
}
onClipEvent(mouseUp) {
_root."pointer".gotoAndStop(1);
}
It didn't work. Can someone help me fix it to make it 'fire' when i press the mouse button?
By The Way: This is timeline for my crosshair movie clip. Just in case i did it wrong, someone tell me plz.
Frame 1.......Frame 2....Frame 3
Neutral State.Fires......Action - gotoAndStop(1)
Hw Shooter(so Far)
I have been for a small while been working on a game called homework shooter... it is attached to this post... that is what I have so far and it works very reliably. I am trying to make it have different sounds and different "exploded"-type messages. I am using the math.random() function to achieve this...I know this may be a noobish question but is there a way to get this code:
Code:
_root.sight.gotoAndPlay(numb);
refering to a movie clip, to reconsider this code:
Code:
num=math.round(math.random()*5);
if(num=0){
numb=2
}
if(num=1){
numb=5
}
if(num=2){
numb=11
}
if(num=3){
numb=14
}
if(num=4){
numb=17
}
if(num=5){
numb=8
}
constantly so that each time you click it comes up with a new message thing...?
ok... thanks in advance to anyone that can help me out with this...
Don't Get Deported,
Eric
Help W/ Shooter
im making a first perosn shooter and i want to make it so when u damage it 5 times it runs away im using a variable here is the scipt
qd=1
i have it set so when you shoot the brain it plays the injured animation heres the script
on (release) {
_root.score = _root.score+50;
}
on (release) {
gotoAndPlay(51);
}
on (release) {
qd = qd+1;
}
i have the attack animation looping with
gotoandplay(30)
at the end if the injured animation i have the script
if (_root.qd==5) {
gotoAndPlay(68);
}
else; gotoAndPlay (30);
it doesnt work can anyone see a fault cause all the scripts are put in right...
Help W/ Shooter Again...
i fixed the last problem but when the boss runs away it spawns some enemys to fight but they dont damage you. i know what the problem is but i have no idea how to fix it...
when the enemys attack they are programmed with
tellTarget ("_parent.Health") { nextFrame (); }
the script works but only when the enemy movieclip is on the main timeline but when the enemy movieclip is in another movieclip it doesnt work. is there a way to fix it without screwing the ones on the main timeline up if u dont understand what i just said let me know and ill try to explain it better its just im in a bit of a hurry
Shooter 1.0
I'm making a game with a guy that moves and shoots wit a pistol but I don't know how to make he bullets. If i make a bullet a movie clip, then with what script can the movie clip bullet appear in front of the movie clip shooter with a speed of 4?
Oh and last night I made a web-site for a friand and It was the first in which I didn't get most of the stuf from other web-sites(exept the sound ofcource) Tell me what you think(and manu's my friends name)
http://freewebs.com/design2004/manu.html
Help With A Simple Shooter
I am trying to make a simple space invaders type game, but cant seem to figure out how to make the main ship shoot. Suggestions?
Thanks
Dan
First Person Shooter
Hey, I need help! I'm looking for a tutorial or even script to make a first person shooter.
Shooter Game
could someone point me in the right direction on how to learn to make games... i'd like to make a simple shooter game... things flying around, cross hair as weapon... tutorials or one on one help would be great... thanks
First Person Shooter...
Well I have made a first person shooter before, just it wasn't very complicated. This time, i'm making one where it shows the hand holding the gun. The problem is, I want the hand and the gun to stay in the same spot at ALL times, but when you move the crosshairs left or right, the hand and the gun will be shown at a side view.
If you understand what i'm talking about, then please tell me what I have to do to accomplish this.
Thanks
Shooter Games
can someone help me making a shooter -with heads of friends and a crossline-
the meaning is to have pop-ups on the field (my mates) so that i can shoot them -> and they me...
or does someone have an .fla?
thx,
TheNymf
Scroll Shooter
I have a problem with a game that i created (with a tutorial)
If I shoot a laserbeam, it comes from the back of my ship.
Does any 1 knows what I did wrong?
btw: this is the first game i created...
Shooter Game Help
heres my problem, I have a circle (cross hairs) and a box (an enemy) this is what i wanted to do, when you roll over the enemy, the circle turns red..i got that to work, the next thing i wanted to do was when your mouse is over the box (enemy) and you press space it takes away health, i cant seem to get that to work
heres my code
on (rollOver) {
_root.aim.gotoAndplay(2);
if (Key.isDown("<Space>")) {
hp = hp-1;
}
}
on (rollOut) {
_root.aim.gotoAndplay(1);
}
and my file
thanks to anyone who helps
PS im using MX on windows
Shooter Game
I've given up on the jeopardy game i was working on before...it just isnt going to work...instead ive started making a shooter game and i need some help on that as well...i want to have a shot count bar, a health bar, a scoreboard, and a time limit
for the shot count, right now the player can have unlimited shots, what i want it to do it have 25 shots, and then you need to re-load by pressing r, and i also would like his shots to count down as they are used
for the health bar, i already have it so every time the enemy shoots the player, it take away part of its health, but i dont know how to show this on the screen, i want it to be at 100 when full, and 0 when dead
for the scoreboard i want to add 10 points for every time an enemy is killed
as for the timer, i dont want to have to animate the entire thing for however long i make it go for, so i also wanted to know if anyone can help me out with a script for that as well
thanks for any and all help : )
First Person Shooter
im making a first person shooter where enemys move the from the left side of the screen to the right side of the screen, when they collide with a movie clip on the right side of the screen it's game over. the enemy is a short movie clip animation with an invisible button over it when pressed plays the death animation, the problem is when the enemy has been shot and the death ani is playing, it still moves across the screen and collides with the movie clip, so i need the enemys speed to be 0 when the death ani starts, can anyone help thanx!
Spinning Shooter
Alright, I have a small spinning shooter game where you use the arrows to rotate the 'gun' and it shoots out blocks. The blocks are supposed to fly off in one direction, fade away slowly, and be removed when they are done fading out. However, some of the blocks will suddenly stop in one place without moving or fading, and will suddenly dissappear when the next block 'shoots.'
On the first frame:
Code:
function setVar() {
dir = 1;
score = 0;
speed = 6;
dotAmount = 0;
totalTimeLeft = 96/4;
timeLeft = totalTimeLeft;
}
On a blank movie clip called 'actions'
Code:
onClipEvent (enterFrame) {
//
// MOVE MRDOT
//
_root.timeLeftText = _root.timeLeft+1;
_root.timeLeft--;
if (_root.timeLeft<=0) {
_root.dotAmount++;
duplicateMovieClip(_root.mrdot, "mrdot" + _root.dotAmount, _root.dotAmount);
_root["mrdot"+_root.dotAmount]._x = _root.origin._x;
_root["mrdot"+_root.dotAmount]._y = _root.origin._y;
_root.timeLeft = _root.TotalTimeLeft;
_root["mrdot"+_root.dotAmount]._rotation = _root.arrow._rotation;
}
//
// CHECK THE ARROW KEYS
//
if (Key.isDown(39)) {
// Right Arrow 39
_root.arrow._rotation += 5;
} else if (Key.isDown(37)) {
// Left Arrow 37
_root.arrow._rotation -= 5;
}
//
// MOVE IT
//
for (i=0; i <= _root.dotAmount; i++) {
if(_root["mrdot"+i]._alpha <= 0){
_root.dotAmount--;
removeMovieClip(_root["mrdot"+i]);
}
_root["mrdot"+i]._x += -_root.speed*(Math.sin(_root["mrdot"+i]._rotation*(Math.PI/180)));
_root["mrdot"+i]._y += _root.speed*(Math.cos(_root["mrdot"+i]._rotation*(Math.PI/180)));
//
// HIT TEST FOOD
//
if (_root["mrdot"+i].hitTest(_root.food)) {
_root.mrdot._xscale += 10;
_root.mrdot._yscale += 10;
_root.score += 10;
_root.food._x = Math.random()*550;
_root.food._y = Math.random()*400;
}
_root["mrdot"+i]._alpha -= 0.8;
}
}
Does anybody know why the blocks suddenly freeze?
I've attached the FLA also.
1st Person Shooter ?
I am looking to venture in to FPS games a little. I have looked in Flashkit and online for any tutorials on First Person Shooters and have come up pretty empty handed... some very very basic ones at the most. Does anyone know over any good ones and where to find them?
thanks
Simple Shooter Help
I'm making a simple shooter in flash. The largest problem I'm having is how to do the programming, I've searched the site some and havn't found a clear answer so I figured I'd ask.
The game will have the user trying to hit ten targets as fast as possible. A timer will start from zero and will stop when the last target is hit. What I have come up with so far is that I should have a variable, x, equal ten at the begging then evey time the target is hit it subtracts 1 from x and ends when x equals 0. I will also have targets at the bottom of the screen near the timer to represent how many targets the user has left to hit. So the number of targets would be equal to x.
Thats the idea of the game in a nutshell. My problem is that I'm not very proficient with action script yet. Any advice or direction to something that would help is greatly appreciated. Thank you.
Help With A Game Shooter
I am wanting to make a Halo game in Flash. However it isn't a first person shooter (I've never enjoyed Flash FPS's becaues you can't walk where you want to, normally). It's like the games Stickman Sam, in that it is a sidescroller, and your mouse is a crosshairs, and wherever you click, your guy shoots. So I need a way that whenever you click the mouse, a line will come from the main character to where the mouse clicked at. how do I do it?
Help With Space Shooter
Im trying to make a space shooting game, kind of like Space Invaders but more of a 1941(nes) style. Any way, I cant get the lasers to fire right. I want the users ship to fire a laser every time they push space bar so I used code like this.
Code:
if (Key.isDown (Key.SPACE)){
laser._x = ship._x;
laser._y = car._y;
}
laser.onEnterFrame = function(){
laser._y -=15;
}
The first part puts the laser where the ship is and the second part moves it up, just like I want.
The problem is I want the player to fire more then one laser but if you push spacer bar over and over it just resets. I can I create a new laser for each key press instead of restarting.
Any help would be nice
[F8] 2D Side Shooter Help
I was wondering if some one could get me starting on making my character's gun follow/rotate with my mouse while it being anchored to my body. Maybe show me some good tutorials or .fla examples.
Madness Interactive is a good example of what I'm trying to accomplish
http://www.2flashgames.com/f/f-281.htm
Thanks.
Sidescrolling Shooter Help...
Hi! Im making a sidescrollin game and Im using Flash 8. I used the cartoonsmart tutorials and customized the actionscript to create my own game. My problem is such: I can shoot watermelon seeds put of my watermelon, but the way I do it eventually makes my game lag, and I want to put hittests on my blocks to land on fir my bullets, but the only way to do such is use the same method that I am using to shoot which makes it LAG! If anyone can solve my problem, feel free to respond and I will boot up me actionscript or the game in its current awesomeness.
Actionscripting For Top-down Shooter
hi, i'm leon of clavacia, and this is my first post :]
i'm nmot exactly a newbie to flash, but i am in actionscripting, and as i have recently dedicated some of my time to making a top down shooter game, i need help. i am using macromedia flash mx with actionscript 2.0
i only have a moveing spaceship on a blank canvas at this time, and the first thing i want, is to try and add the moveing background. just to clarify, i wanjt a sort of space background, where the stars keep flying past, not one that slides when you reach the boundary. if i am still unclear, please tell me, and i will try and clarify even more...
sorry if this is in the wrong section, i'm new, and haven't yet explored the forums...
any help will be appreciated, and if i am in the wrong section, can you point a finger for me?
Third Person Shooter
does anyone know how to make your gun move with your mouse, like the game "last stand"
http://www.newgrounds.com/portal/view/375622
maybe how to shoot too?
Shooter Game
I'm making a pretty standard first person shooter game. I currently have the following code for the generation of monsters and it works great. The only problem is that it only creates one monster, I want the game to randomly choose a monster from a set of movie clips so it's not the same enemy every time.
Attach Code
var monsterNumber:uint;
var monsterTimer:Timer;
var cursor:MovieClip;
var container:MovieClip;
function startGame():void {
monsterNumber = 40;
monsterTimer = new Timer(500, monsterNumber);
container = new MovieClip();
addChild(container);
monsterTimer.addEventListener(TimerEvent.TIMER, createMonsters);
monsterTimer.start();
}
function createMonsters(event:TimerEvent):void {
var monster:MovieClip;
monster = new Monster();
monster.x = Math.random() * (450 - 50) + 50;
monster.y = Math.random() * (400 - 100) + 100;
container.addChild(monster);
}
startGame();
Shooter.Part1
Here is what i have so far for my game...
Credits....
Programming>Coolazz0
Drawings>Munk3333
Those are the Aim names..
I ziped it just for ou so i hope you oppen it..
The peraon who makes the game would like that...
Help Shooter Games....
I was just looking at the the tutorial in the tutorial section on how to make a shooter. That's easy enough...The thing I want to know is how would you make it so that when you shoot a bullet and it hits a target, that target explodes, and if one of the targets where to hit you(the mc shooting the bullets) what would you need to do to make the movie go to a game over frame. I know it involves hittest, but that's about it. Any help will be greatly appreciated. Thanks.
Top Down Shooter Tutorials
OK, here's the deal, I have so far found no tutorials for making a top down shooter in Flash MX. Does anyone know where I can find some that work, and that I don't have to pay for.
Cheers
First Person Shooter Help
ok, well i have been using flash for about 3 days... not to long, and i have encountered a problem when making my first game, i am making a first person shooter but the health bar doesnt work! download it here can someone please try and give me an answer to my problem? i know it is probly really simple, but im only 14!
[AS3] Shooter Game Help
I am building a simple shooter game with a character at the top of the screen that can move left to right. At the bottom will be 3 guns spaced out evenly that will shoot out objects and different intervals. If the object hits the character or hits the end point the balls are destroyed.
I have a working version but man when all three guns are shooting my system slows down a bit. I am destroying all my object but have a feeling it has something to do with my class. I built a class called SportsItemGenerator. This class has a timer that will create a ball and add to the display list at different intervals. For anyone who has created a shooting game like the above, can you offer any advice on how to properly create my shooter balls without bogging down the system.
Here is my code, I am still prototyping so it is pretty dirty and crappy.
Code:
package dsg.elements {
import dsg.utils.StageUtils;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.utils.Timer;
public class SportsItemGenerator {
private var __container:Sprite;
private var __x:Number;
private var __y:Number;
private var __delay:Number;
private var __sportsItem:SportsItem;
private var __timer:Timer;
public function SportsItemGenerator(container:Sprite, _x:Number, _y:Number, delay:Number) {
__container = container;
__x = _x;
__y = _y;
__delay = isNaN(delay) ? 1000 : delay;
createTimer();
}
public function start():void {
initializeCurrentTimer()
}
private function createTimer():void {
__timer = new Timer(__delay, 1);
}
private function initializeCurrentTimer():void {
initializeTimer();
__timer.start();
}
private function initializeTimer():void {
__timer.addEventListener(TimerEvent.TIMER, timerHandler);
__timer.addEventListener(TimerEvent.TIMER_COMPLETE, timerCompleteHandler);
}
private function timerCompleteHandler(event:TimerEvent):void {
createSportsItem();
desinitializeTimer();
initializeCurrentTimer();
}
private function timerHandler(event:TimerEvent):void {
//createSportsItem();
}
private function desinitializeTimer():void {
__timer.removeEventListener(TimerEvent.TIMER, timerHandler);
__timer.removeEventListener(TimerEvent.TIMER_COMPLETE, timerCompleteHandler);
__timer.reset();
}
private function createSportsItem():void {
__sportsItem = new SportsItem(__container);
__sportsItem.x = __x;
__sportsItem.y = __y;
__sportsItem.setItemType("Ball");
__container.addChild(__sportsItem);
trace(__container.numChildren);
}
}
}
First-Person-Shooter : Help With The Bosses.
Ok. I'm making a first person shooter game and I made 3 levels now...but the third is a Boss...I know how to put some life to him but what I don't know is : when a certain key is pressed, the shield is on. And then make that when the missiles touch the shield, you don't lose life...
U know how?? please!
If you got time, can you tell me the Actionscript for a health bar? I tried and It doesn't work....
---------
FL/SHMAN
---------
Problem With My Shooter Game
im making a shooter for fun so i can learn some thigns about flash and im having a bit of trouble with health.
when your health goes below '0' you die. and i made this code in the enemy which says
_root.health -= 20;
'health' is a text variable and it equals 100 at the start.
im trying to figure out how to make it so whenever 'health' equals or is less than '0' you die and goto a death screen.
ive tried
if (_root.health <= 0 ) {
gotoAndStop ("deathscene");
}
but it doesnt work! argh. any help?
Help W/ Scripting In 1st Person Shooter
me and my friend are making a second game in our series for a 1st person shooter, in the last game for the guns we had 3 versions of ever gun, one facing left, one facing right, and one facing the middle, now we want to change this and make the gun actualy move across the bottom of the screen, and the placement of the gun will depend on where your mouse is on the screen, so lets say the gun is on the bottom of the screen, and when you move your mouse left, it moves as if the barrel was pointing directly at the crosshair, and lets say you move your mouse up, so what happens is your gun re adjusts so the gun will have to move to the right, so what im looking for is a formula of some sort where when the gun will place itself according to where the crosshairs are, now is there any one that has a idea of what my coding should be, if your confused for what im asking for is the coding for where you move the mouse, the gun will point right at it
ive seen simular coding such as in flash golf games, where where ver you point the mouse, the ball will go in that direction, and the club will hit it acording to where you need it
Some Problems With That Space Shooter
hi all,
i`ve programmed and attached an old style space shooter and some things won`t work.
1. there is a small gap between MCbg01 and MCbg02 in the animated background.
2.at hitTest with the asteroid the spaceship shouldn`t be destroyed by the first few hits, but should lose only 10% of its life energy.
3.if one shoot an asteroid by hitting the spacebar and rest on the same y-position, the asteroid appears again and collide with the space ship.
ne1 ne ideas? thank you very much!
u777
p.s. use the arrow pads to control the spaceship`s position.
Sideways Shooter Game, Need A Little Help Plz
Im making this game as the obligatory "learn AS" thing, think thunderforce 3 or R-Type...anyway its going ok so far... well im gradually learning.
but one of my problems is this:
when you shoot, reguardless of where you are the first in an array of 5 enemieMCs is removed... but this is after i had it working fine and the only changes i made was code in the bulletMC....?
so heres the "before" code (the stuff i changed is in bold... if you can see it!
code: onClipEvent (load) {
if (_name == "shotparent") {
_visible = false;
_root.array = new Array();
_root.arraySize = 0;
ticks = 0;
i = 0;
} else {
this._y=_root.ship._y+12;
this._x=_root.ship._x+50;
speed = 10;
move = 1;
}
}
onClipEvent (enterFrame) {
if (_name == "shotparent") {
ticks++;
if (ticks> 8) {
if (Key.isDown(32)) {
this.duplicateMovieClip("shot"+i, i+10);
}
_parent["shot"+i].name = i;
_root.array[_root.arraysize] = i;
_root.arraysize++;
i++;
ticks = 0;
}
} else {
if (move == 1) {
_x += speed;
if(_x> 550){
move = 0;
}
} else {
for(i = 0;i <_root.arraysize;i++){
if(_root.array[i] == name){
//trace(_root.array);
for(j = i;j <_root.arraysize-1;j++){
_root.array[j] = _root.array[j+1];
}
delete _root.array[_root.arraysize];
_root.arraysize--;
i = _root.arraysize;
}
removeMovieClip ("");
}
}
}
}
and this is the updated one which i changed to tidy it up a bit and to add a delay to the stream of bullets fired... meaning it shot in bursts:
code: onClipEvent (load) {
if (_name == "shotparent") {
_visible = false;
_root.array = new Array();
_root.arraySize = 0;
tocks = 0;
ticks = 3;
i = 0;
} else {
this._y=_root.ship._y+12;
this._x=_root.ship._x+50;
speed = 40;
move = 1;
}
}
onClipEvent (enterFrame) {
if (_name == "shotparent") {
//here
if (tocks == 8){
tocks = 0;
}
if (Key.isDown(32)){
ticks++;
if (ticks> 3){
if (tocks< 5){
this.duplicateMovieClip("shot"+i, i+10);
_parent["shot"+i].name = i;
_root.array[_root.arraysize] = i;
_root.arraysize++;
i++;
tocks++;
if (ticks == 4){
ticks = 0;
}
}
}
} else {
ticks = 3;
tocks = 0;
}
//here
} else {
if (move == 1) {
_x += speed;
if(_x> 550){
move = 0;
}
} else {
for(i = 0;i <_root.arraysize;i++){
if(_root.array[i] == name){
//trace(_root.array);
for(j = i;j <_root.arraysize-1;j++){
_root.array[j] = _root.array[j+1];
}
delete _root.array[_root.arraysize];
_root.arraysize--;
i = _root.arraysize;
}
removeMovieClip ("");
}
}
}
}
and like i said, somehow, the changes ive made are effecting another MC (i can post thats AS if you need, but its pretty much the same as the above, except for a few changes... and ideas... please?
and sorry if ive offended anyone for making such a big code-y post
2 First Person Shooter Questions
Two questions really.
(1) Is thier a way of detecting when the right button is clicked on the mouse without displaying the flash menu?
(2) I dont know if this can be done but is thier a way of making a gun continually fire using only the left button on the mouse, like in a first person shooter such as halo using a machine gun??
Thanx if u can help
PS i know this shud be in the games section but i posted it before I realised which room i was in, please dont blast me
Help With Building A Very Simple Shooter
Hello all. I'm very new to flash. I use Koolmoves 5.0.5 and was wondering if it is possible to create a very simple shooter game. All I want to do is have 3 or 4 characters pop up in the background and then I can shoot them. I don't even want them to shoot back.
I'm just wondering if this is even possible in Koolmoves, or do I need to buy a much more expensive program. Thanks for any help.
Shooter Game Actionscript Help
Hi. I have a Sniper style shooting game on Flash 8 and i have a problem. it has a crosshair and the aim of the game is to shoot the guy. one prob is tho that when it reloads you can still shoot the guy. i believe that i need to add a "wait" script in it somewher but i dont know where. here is the actionscript for the crosshair
onClipEvent (enterFrame) {
startDrag(this, true);
Mouse.hide();
}
onClipEvent (mouseDown) {
if (_root.bullet == true) {
this.gotoAndPlay(2);
_root.bullet = false;
tellTarget (_parent.bulet) {
gotoAndStop(2);
}
}
}
where whould i add it.
if you would like the fla file to see what i need to do i would be happy to send it to you.
Thanks
Sterockicy
Help: Stickman Sam Type Shooter
I am making a game that is similar in gameplay to Stickman Sam, but I am having a few problems with it. The main problem is that I don't know much about Actionscript at all. Are there any online guides or anything like that which could help me out with this sort of game?
[MX04] Platform Shooter
I'm making a side-view platform shooter, but the only thing i need is the shooting part, i don't know the script to make the character shoot left and right. (and possibly a melee attack with a combat knife)?
**Need Quick Help With Basic Shooter**
Hi, I have been trying to make my first shooter for quite some time now with some success. For some reason my enemies do not respond when shot and I don't know why. I am not very good with actionscript and was wondering if someone could give me the code neccessary for an enemy. The more detailed and the more explained the better.
Also I want to be able to have multiple enemies on the stage at once and wasn't able to before. I would attach my flash file, but it says it cannot upload (probably because it is too large). Also this is in Flash MX 2004.
Thx in advance
Over The Shoulder Type Shooter
I can't find any tutorials on this. I just can't figure out how to make the background scroll over when u move the crosshair left or right.
Also, I would like to keep the gun in the lower right hand side. Like, when u move the mouse the gun will follow it a bit, but then stop so just the tip follows....not sure how to got about that.
Any help is appreciated.
How Do I Add A Energy Bar To My Shooter Game
I am very new to AS3..
I am creating a kids game in AS3. There is a smile meter that goes up when you click on a good character and down when you click on a bad character. If you reach the top you win and if you reach the bottom you you lose.
What is the best way to achieve this? Attached is my Stage source code.
Any help would be greatly appreciated.
Thanks,
Scott
I asked the same question in the kirupa forum, but I cant seem to piece the code together correctly. Can anyone help? Here are my codes:
AS3 CODE ON FRAME 1:
var duckTimer:Timer = new Timer(2000, 1);
duckTimer.addEventListener(TimerEvent.TIMER, makeADuck);
duckTimer.start();
function makeADuck(evt:TimerEvent):void {
var newDuck:duck = new Duck();
var duckIndex:Number = this.getChildIndex(gdCheet1)+1;
addChildAt(newDuck, duckIndex);
newDuck.y = 204.8;
newDuck.swim();
newDuck.addEventListener(MouseEvent.CLICK, clickDuck);
}
var duckTimer2:Timer = new Timer(8000,1);
duckTimer2.addEventListener(TimerEvent.TIMER, makeADuck2);
duckTimer2.start();
function makeADuck2(evt:TimerEvent):void {
var newDuck:duck2 = new Duck2();
var duckIndex:Number = this.getChildIndex(duck2Fnl)+1;
addChildAt(newDuck, duckIndex);
newDuck.y = 178.6;
newDuck.swim();
}
var duckTimer3:Timer = new Timer(10000,1);
duckTimer3.addEventListener(TimerEvent.TIMER, makeADuck3);
duckTimer3.start();
function makeADuck3(evt:TimerEvent):void {
var newDuck:duck3 = new Duck3();
var duckIndex:Number = this.getChildIndex(bamboo1)+1;
addChildAt(newDuck, duckIndex);
newDuck.y = 100.0;
newDuck.swim();
}
var duckTimer4:Timer = new Timer(15000,1);
duckTimer4.addEventListener(TimerEvent.TIMER, makeADuck4);
duckTimer4.start();
function makeADuck4(evt:TimerEvent):void {
var newDuckuck4 = new Duck4();
var duckIndex:Number = this.getChildIndex(goodMnky2)+1;
addChildAt(newDuck, duckIndex);
newDuck.y = 147.6;
newDuck.swim();
}
var duckTimer5:Timer = new Timer(15000,1);
duckTimer5.addEventListener(TimerEvent.TIMER, makeADuck5);
duckTimer5.start();
function makeADuck5(evt:TimerEvent):void {
var newDuck:duck5 = new Duck5();
var duckIndex:Number = this.getChildIndex(goodMnky)+1;
addChildAt(newDuck, duckIndex);
newDuck.y = 58.1;
newDuck.swim();
}
var duckTimer6:Timer = new Timer(25000,1);
duckTimer6.addEventListener(TimerEvent.TIMER, makeADuck6);
duckTimer6.start();
function makeADuck6(evt:TimerEvent):void {
var newDuck:duck6 = new Duck6();
var duckIndex:Number = this.getChildIndex(goodMnky)+1;
addChildAt(newDuck, duckIndex);
newDuck.y = 389.6;
newDuck.swim();
}
var duckTimer7:Timer = new Timer(5000,1);
duckTimer7.addEventListener(TimerEvent.TIMER, makeADuck7);
duckTimer7.start();
function makeADuck7(evt:TimerEvent):void {
var newDuck:duck7 = new Duck7();
var duckIndex:Number = this.getChildIndex(bamboo1)+1;
addChildAt(newDuck, duckIndex);
newDuck.y = 374.6;
newDuck.swim();
}
var duckTimer8:Timer = new Timer(20000,1);
duckTimer8.addEventListener(TimerEvent.TIMER, makeADuck8);
duckTimer8.start();
function makeADuck8(evt:TimerEvent):void {
var newDuckuck8 = new Duck8();
var duckIndex:Number = this.getChildIndex(bamboo1)+1;
addChildAt(newDuck, duckIndex);
newDuck.y = 485.5;
newDuck.swim();
}
var duckTimer9:Timer = new Timer(2500,1);
duckTimer9.addEventListener(TimerEvent.TIMER, makeADuck9);
duckTimer9.start();
function makeADuck9(evt:TimerEvent):void {
var newDuckuck9 = new Duck9();
var duckIndex:Number = this.getChildIndex(goodMnky)+1;
addChildAt(newDuck, duckIndex);
newDuck.y = 385.4;
newDuck.swim();
}
var duckTimer10:Timer = new Timer(7000,1);
duckTimer10.addEventListener(TimerEvent.TIMER, makeADuck10);
duckTimer10.start();
function makeADuck10(evt:TimerEvent):void {
var newDuckuck10 = new Duck10();
var duckIndex:Number = this.getChildIndex(goodMnky)+1;
addChildAt(newDuck, duckIndex);
newDuck.y = 352.3;
newDuck.swim();
}
function clickDuck(evt:MouseEvent):void {
evt.target.hit();
}
Mouse.hide();
mTarget.mouseEnabled = false;
function moveTarget(evt:MouseEvent):void {
//target graphic = mTarget
mTarget.x = evt.stageX;
mTarget.y = evt.stageY;
}
stage.addEventListener(MouseEvent.MOUSE_MOVE,moveT arget);
AS3 EXTERNAL FILES
package {
import flash.display.MovieClip;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.motion.Animator;
public class Duck extends MovieClip {
var duckHit_animator:Animator;
function Duck():void {
}
public function swim():void {
var swimTween = new Tween(this, "x",None.easeNone,4.8,4.8, 5, true);
}
public function hit():void {
var duckHit_xml:XML = <Motion duration="10" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
<source>
<Source frameRate="12" x="-167.85" y="292.75" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" symbolName="duckHit">
<dimensions>
<geom:Rectangle left="-85.65" top="-51" width="171.3" height="102"/>
</dimensions>
<transformationPoint>
<geom:Point x="0.5046701692936368" y="0.5"/>
</transformationPoint>
</Source>
</source>
<Keyframe index="0" tweenSnap="true" tweenSync="true">
<tweens>
<SimpleEase ease="0"/>
</tweens>
<filters>
<filters:GlowFilter blurX="0" blurY="0" color="0xFF0000" alpha="1" strength="0" quality="1" inner="false" knockout="false"/>
</filters>
</Keyframe>
<Keyframe index="4" tweenSnap="true" tweenSync="true">
<tweens>
<SimpleEase ease="0"/>
</tweens>
<filters>
<filters:GlowFilter blurX="45" blurY="45" color="0x3366FF" alpha="1" strength="1" quality="1" inner="false" knockout="false"/>
</filters>
</Keyframe>
<Keyframe index="9">
<filters>
<filters:GlowFilter blurX="0" blurY="0" color="0xFF0000" alpha="1" strength="0" quality="1" inner="false" knockout="false"/>
</filters>
</Keyframe>
</Motion>;
duckHit_animator = new Animator(duckHit_xml, this);
duckHit_animator.play();
}
}
}
SECOND AS3 FILE ect..
package{
import flash.display.MovieClip;
import fl.transitions.Tween;
import fl.transitions.easing.*;
public class Duck2 extends MovieClip {
function Duck2():void{
}
public function swim():void {
var swimTween = new Tween(this, "x",None.easeNone,302.4, 222, 4, true);
}
}
}
|