ActionScript 2.0 :: Simple Vertical Shooting Game - Rebound Missile Always Spawns At Left Of The Stage?
Feb 6, 2011
Basically, I have a border(line) at the top of the stage so that whenever my ship's missile comes in contact with this line, it is removed and a rebound missile clip is attached.Here is the missile code:
Actionscript Code:[code].....The problem is that the rebound missile always spawns at left of the stage, not wherever the ship missile was removed.I'm not sure if I should attach the fla, action script files, swf etc. to the thread. Also, my flash version is CS5.
View 3 Replies
Similar Posts:
Jul 15, 2010
I'm making a Space Invaders-type game. Y'know? Arrow keys to fly Space to shoot? Well, shooting isn't working so well. I have two .as files: Ship.as which controls the ship's ActionScript, and Missile.as which is supposed to control the missile. When I hit load it up I get the error: The class or interface 'Missile' could not be loaded.
View 2 Replies
Feb 6, 2009
Shooting game in FlashView Game - Click hereKindly check game codeProblem:1) The rabbit should be random shown in ground areaif someone can give explaination onmonster.x = Math.random() * stage.stageWidth;and why the rabbit is showing bigger size?2) Other animals should also be able to target
//----->
stop();
var monstersAlive:uint;
[code].....
View 1 Replies
May 7, 2010
I am at uni and have a project to create an interactive game for the story Johnny Mnemonic. I would like to create a game whereby the player has a whip type weapon, there is an opponent jumping up and down and with the whip you attack them and cut off limbs -
I'm thinking it would be like a simple shooting ducks style game in terms of coding, the player has visible just a hand with the whip in it, you move the whip to your desired location click chosen button to hit, the whip then animates a flick, if it hits correct spot on bouncing opponent then an animation of the limb flying off happens, so the bouncing opponent is like the duck and the whip like the gun - if that is right at all?
View 1 Replies
Nov 23, 2005
I've been making this space shooting game but I'm having problems getting boundaries to work. I've read tutorials and done lots of searching here and couldn't get anything to work... On the main time line, there's 2 layers. One with the ship, and one with the background (both are movie clips). Inside the background movie clip, I'd like to add boundaries, almost as complex as a maze but not so restricting.. as in, a path to fly through that'd probably be as wide as the screen itself. Here's what I'm trying to work with. Use the arrow keys to move, space to shoot, and press control to toggle between fixed camera and fixed ship modes.
View 1 Replies
Feb 18, 2009
So the problem is basicly this: It all works just fine, but when the bullet hits the target it gets destroyed (this is ok) but also any bullet that was shoot before it (meaning also: with a lower y) gets destroyed aswell wich is anoying. Here's the code (left the comments so you can find your way around easier)
Code:
stop();//add a stop function too!
enemyspeed =1
life=3
var gameOver:Boolean = false;
[Code]..
View 2 Replies
Feb 13, 2011
I am creating a 2d platform shooting game. Currently I have my main character walking around left and right and the stage background also moves left and right.
The problem I am having is that if I go to far left the charater just walks 'off stage' and into nothingness but the stage still follows. How can I make it so if the character hits a certain point he just 'stops' and cant go left no more but can go right no problem. I have tried using hitTest with another movieclip but couldnt get it working.[code]...
View 1 Replies
Apr 4, 2002
Ok I am creating a 2d game similar to the original mega mans and mario for nintendo. The character moves back and forth using the left and right arrow keys on the screen and has a walk animation and all. The next step is to get him to shoot his laser gun. I want this to be done using the space bar key. What I have right now is identical to Kirupa's movement using X and Y values tutorial but it only moves one direction of course. How can I make it so that it will continue to move automatically after pressing space instead of having to hit the space bar each time I want it to move 10 units over etc.?
View 12 Replies
Mar 22, 2011
I'm making target shooting game and the hitTestObject not working its located in the function collision detection below in my code:
import fl.motion.MotionEvent;
import flash.events.MouseEvent;
var xSwitch:Array = new Array ;
var count:Number = 120;
var seconds:Number = 0;
var minutes:Number = 0;
[Code] .....
View 1 Replies
Jun 2, 2008
I'm making a shooting game, would like the gun to flip _xscale when you move the gun past half the width of the stage. Here's the script I made which doesn't work and is probably not written correctly:
if(_xmouse >= Stage.width/2){
_root.gun_mc._xscale * -1;
}
View 4 Replies
Dec 2, 2009
I have benn programming in AS2 for a while, but I'm moving to AS3, and I'm having some trouble with syntax and mostly with management of parameters and variables (actually I tried to work with functions in packages without good results T.T). The game has four different types of shooters, and all of them use the same bullet (shoot function). I have succeeded on disappearing the target (a coin in this case) when it is hit by the bullet, but the problem is that I can't quite find the way to dissapear the bullet properly. I keep receiving this message:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/removeChild()
at eco_adm9_fla::MainTimeline/moveBullet()
[code].....
View 3 Replies
Aug 30, 2011
I'm doing the shooting game. In that character should move left and right by using the arrow keys. The background is movieClip with image. The character is walking very slow sometimes. And the zombies will come automatically. Why the movement is very slow sometimes?
View 4 Replies
Oct 25, 2010
I'm making a flash game in AS2, and i am having troubles with my gun, i have fiddled with it for a while now and i have narrowed down the problem, but i can't fix it. My problem is that i want a gun to follow the player, but the coordinates are messing up and going to his feet.
Code:
onClipEvent (enterFrame) {
_y += (_root.player._y-_y)/1; //This code makes it goto his feet, but the gun no longer follows player when he jumps.
_x += (_root.player._x-_x)/1;[code].............
View 1 Replies
Aug 10, 2009
How to create realistic smoke coming out from the back of a missile flying on stage?
it's for a top-view arcade-type game, where the player shoots a missile from a plane...
View 1 Replies
Aug 25, 2009
I want to create a simple effect, Basically I have an image in an MC. I want to create an MC above it that would contain vertical lines/boxes sliding from left to right and changing size and alpha.So basically random vertical boxes sliding over it.
View 11 Replies
Mar 7, 2012
I am going to develop a very simple game for android and for iphone/ipad I have the option to develop it in cocos2d or in adobe flash air (i am not a developer, but i have 2 developers who are offering me the service)I have a developer that states that cocos2d is better and other one that states that adobe flash air.I want it in cross platform.the cost offered by both developers is the same..i have heard that adobe air has the flaw that it is very slow, is this real? if you had the 2 options which will you use to develop your game and why?
View 1 Replies
Feb 28, 2011
I'm creating a game at the moment for my university course and it involves the player character jumping on top of boxs twice to break them as opposed to just once.What would be the most efficient/simple way of writing this in Actionscript 3.
View 1 Replies
Apr 3, 2011
I have a simple flash site here [URL] I need to make the products button show a drop down menu on rollOver that oversteps the items bellow it and contains 4 su bmenu items. Now I managed to hide the buttons bellow and show the new ones, but when I move the cursor away from the Products button the sub menu disappears. I want to know how to make the sub menu stay there until the cursor is moved away from it and not away from the Products button
View 1 Replies
Dec 6, 2009
I've been trying to work on this simple vertical plane shooter. I got as far as creating everything and am now on the step to check if my bullet hits an enemy plane or an enemy bullet hits my plane. Because the enemy planes are created dynamically, I am trying to counter that with assigning then names when created so that the bullet knows what to look for. My approach for this might be somewhat wrong though. As for the enemy bullet hitting my plane, I just tell it to look for the instance of the plane already on the stage. Both result in the same error of undefined(the object can't be found).
Here is the code for both bullet collisions and the code for creating enemies.
ActionScript Code:
public function enemyHit(e:Event):void {
//declare i
var i:int;
//check if the bullet hit any enemy object
for(i = 1; i <= MovieClip(root).amount; i++) {
if(this.hitTestObject(enemy + i)) {
trace("enemy hit");
[Code] .....
The bullets have their own class files and the spawn enemy code is located within the fla file.
View 2 Replies
Jan 22, 2011
I have the xspeed and yspeed of a round ball, xspeed is distance ball moves to the right each frame and yspeed distance ball moves down each frame.I have 3 different gradients of slopes, one is at 15 degrees off the horizontal.How can I calculate the xspeed and yspeed of the ball after a collision with, for instance, the 15 degree slope.
View 2 Replies
Feb 3, 2009
I have set up a system that spawns barriers for the player to dodge but it appears the functions won't trigger properly from within "if" statements. I've put nots on my code to guide you through what is going on.
[Code]...
View 5 Replies
Feb 15, 2004
i'm new to actionscripting so bear with me on this:
i've been using motion tweens to create simple movement animations and i'm looking to reduce the size of my movie - can anyone suggest a simple tutorial on how to achieve a simple left to right movement of a line using actionscritping? [URL]
View 1 Replies
Dec 10, 2009
I have created an animation (see attached) where the stage can be dragged from left to right to reveal hidden areas off the edge of the stage. Unfortunately I need to add buttons containing links to websites within the dragable movie symbol and I can't work out how to do it.
View 2 Replies
Oct 22, 2011
I am in the process of creating a vertical scrolling space shooter game for deployment on mobile platforms using AIR.I've used some excellent tutorials online, video tutorials on Lynda and several books, including Game Programming University.Something they all seem to gloss over are the various screens that will be used.
For instance, my game right now will use a splash screen, a main menu screen, a credits screen,a settings screen, a difficulties screen, an instruction screen, an end game screen and save/load screen...and a play game screen, where the actual game will be played.I've created the screens as seperate frames in the main timeline with stop commands in between and code on each page (I know... bad!... but easy).So basically,they can navigate through the menus using buttons (mouseclicks, which will work with touchs as well) and when they are How do I pass data between them? I was thinking of storing it in shared object.
View 1 Replies
Dec 21, 2011
I'm trying to work through the Vertical Shooter Game within the tutorials section of this site:[URL]I noticed an code error of if spriteX -= steps; (which should have been += steps)However there are further errors within the tutorial as on page 3 where the man should be able to move and shoot his arrows, mine just shoots his arrows and has stopped moving. I'm using CS5 ActionScript3 to do this tutorial.
//---- variables ----
var steps:Number = 5;
var spriteX:Number = 265;
var spriteY:Number = 265;
[code]....
View 2 Replies
Nov 24, 2010
I have a jet_mc object flying from left to right, i got that part ok but my question is how can make it fly from left to right again and again untill the user finish the game. what line of code should i add to make it loop.stage.addEventListener(Event.ENTER_FRAME,run)function run (e:Event){ jet_mc.x-=5}
View 4 Replies
Dec 12, 2003
I have developed a simple quiz game, but im having a slight problem with it.I have a variable set to myScore=0
Everytime you get a right answer it should increment 2points But when you get all 3 answers correct i get a final score of 4points
View 2 Replies
Jan 5, 2010
when my flash movie in full screen status i want to align stage center. (Vertically and horizontally) from this code i able to align stage horizontally center.
ActionScript Code:
Stage.align = "T";
but its not vertically align middle. its only aligned to top (Vertically) what is code/ property i should use to make it vertically middle.?
View 0 Replies
Sep 8, 2009
I'm sort of new to Flash, have been using it for ages but just to animate, i haven't done any programming or interactive stuff for years, so i feel new to it again!Creating a very simple platform.Movie clip of the character (instance name z_1)- runs button - when pressed makes z_1 invisible and loads another movieclip of him firing a weapon (z_fire). (also makes ground stop moving- basically game is a static running animation, over a moving ground, if that makes sense)This all works fine, i even figured how to make the score increase!After the firing animation is finished (there is a stop on the movieclip) i want the original running animation to be visible again and for the ground etc to play again. The firing animation is only 12 frames long so i imagine i need to tell the button to resume normal service on the stage after that time period![code]It's probably completely wrong but it works, i just need to know the extra code to make the original animations start back again after z_fire has played.
View 2 Replies
May 13, 2009
I'm looking to build a very simple (hopefully!) interactive game.
- A number of balls are situated at the bottom of the stage.
- There are several dropzones which the balls can be placed in.
-Once a dropzone is occupied with a ball, its not possible to populate that the dropzone with another ball until the present one has been removed. -Depending on which balls are present in the dropzones, the balls animate differently. the red ball is placed in a dropzone. There are currently no other dropzones populated with a ball.
[Code]...
View 5 Replies