ActionScript 2.0 :: [mx] Create Shoot Lasers From The Nose Of The Plane?
Feb 8, 2003
I'm working on a new project, its a side scrolling game where an airplane (user) has to shoot down a bunch of other enemy planes. how to create an AS to shoot lasers from the nose of the plane
View 6 Replies
Similar Posts:
Jun 2, 2011
I am building a custom preloader which is different than the "traditional" sliding bar that is common in RIAs. The preloader uses 100 white laser lights which are in a straight line, and collectively they indicate the progress bar. Let me describe how this works before I ask my question:
........................,,,,,,,,,:::::::::::::::::::::::::BBBBBBBB and so on...
The above string captures the spirit of the preloader indicator. In this illustration, the bigger and fatter the character, the brighter the laser light in my actual preloader: The farthest laser to the right indicates the currently loaded percentage. This is also the brightest laser light.All other trailing lasers get increasingly dimmer until they become completely black, as if they had burned a whole in the back of the screen.
Step "2" is where things get tricky. For some reason, the trialing lasers do not get darker, except for a few random lasers. Here is a snippet of the code controlling the brightness (or, as I used it, the alpha property) of the dot:
... more code ...
//Build the dots according the configuration and load status parameters
private function buildDots(x:int, y:int):void {
//Draw the dot, details not shown[code].......
This entire preloader is inside of a custom class.The laser lights are created completely by code, without access to the library.
View 2 Replies
Sep 21, 2009
I found a basic example of how to create something that'll shoot an object and create an arc based on an angle. I added a power Bar to it, but I noticed something bad about it.
The way it works the higher the speed is the further it goes and the faster it moves across the screen. This doesn't give me enough control. Because essentially I want fast moving projectiles but I want to also be able to shoot both near and far.
With this current system that's an impossibility.. Can anyone shed some light on how I can do this better? Here's the current way it's being done (important parts):
Code:
bullet = new Bullet;
this.stage.addChild(bullet);
bullet.speed = 1 + powerBar.scaleX * 20;
[Code].....
View 2 Replies
Jul 5, 2009
I want to create a basic flash file with a little plane that is constantly flying. It never stops just keeps on moving. Now it would be fairly simple to do that but i want to be able to rotate the plane using the arrow keys. Once the plan is rotated I want the plane to fly in the direction of the rotation.
I could easily keep increasing the planes x value but that will make it fly only to the right I want to be able to make the plane fly freely.
[Code]....
View 2 Replies
Mar 4, 2012
this is in my bullet movie clip on the timeline.[code]It all works but when i turn around it still shoots the same way im sure its something simple but i just cant work it out.
View 7 Replies
Dec 5, 2011
I have a TargetCirlce_mc which moves on "y" axis from top to bottom. And I have an arrow_mc which is on x:100 & y:200. How can I shoot an arrow exactly on the registration point of the TargetCircle_mc (automatically) while it is exactly opposite to the arrow_mc?
View 1 Replies
Aug 11, 2011
My goal is to shoot a bullet everytime I click on ship. What happens, in fact, is that If I click on it once, the bullet is shot, but if I click on it twice before the first bullet is off the screen, the first bullet literally stops(it does not disappear, only stops) and the second bullet is shot.
public var ship:Ship = new Ship();
public var bullet:Bullet = new Bullet();
stage.addChild(ship);[code]...
View 2 Replies
Nov 8, 2009
I'm doing a simple game where you move the character using the arrow keys and shoot using the Mouse. The character rotates based on the Mouse angle. I have two problems: when I move the character, he moves once, then stops then moves again as normal. My other problem is that when I click over a MovieClip, the bullet goes to the wrong angle.My moving function:
Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
function keyHandler(event:KeyboardEvent):void {
[code]....
View 2 Replies
Aug 13, 2004
How do you make a MC like shoot a gun or something when you press the spacebar?
View 1 Replies
Aug 5, 2011
what i whant is when any of the units get to a certain distance of the enemy it should trace(shoot).
[CODE]...
View 6 Replies
Dec 25, 2006
How would you go about making a movie clip shoot a bullet from it, but have the movieclip able to move around, like a sidescroller game...
View 2 Replies
Oct 11, 2010
When I run the file and try to shoot the zombies, none of them are clickable. I really can't tell what I have done wrong here. Here is my code:
stage.addEventListener(Event.ENTER_FRAME, moveBullseye);
function moveBullseye(event:Event) {
bullseye_mc.x=mouseX;[code].....
View 2 Replies
Nov 23, 2011
THIS THREAD IS SOLVED.. Answer lies upon a website tutorial. Final Page on this Thread.So far so good, i've gotten most my as2 to as3.. And coming out good Buttons are working, The only last part im working on is upon shooting, it'll bring in the calls to Fire the missle.. (tracein the button works great).
[Code]...
This is what im trying.. But it says undefined use for addchild.. so im taking im missing somthing..
(the missile is a animation graphic i created).I have made a Missile.as to control what the missle does when its addchild is placed on stage. Problem is, (addchild isnt doing it) and im not sure if its going to shoot out the nose of the hero..
View 14 Replies
Sep 28, 2002
i've posted many times and got loads of responses but i dont understand how to make a bullet hole appear when you shoot an object. MSN me a [URL] to have a chat about doin the actionscript.
View 1 Replies
Mar 16, 2005
I havent used flash in years and I wanted to make a game. Ive made a few before but i didnt ever finish them and now i dont have them anymore. I wanna make this game where you are this man that can move around. (i can remember how to do that) and you shoot these huge exploding cats. How do i make the person shoot when you press the spacebar?How do i make the barrel of the gun follow the mouse and the bullets shoot that way?
View 10 Replies
Feb 25, 2010
I am developing a game like this. [URL]. I just start this game And stuck in a problem. Moving arrow of game according mouse moveing like Given URL just check out. I know it is just a mathematical calculation. I have done according X position of mouse moving. But confuse something With Y position also. So I am not getting proper solution of X & Y position Both Togather.
View 2 Replies
Feb 15, 2003
I have just read the tut on the shooting aspect of games and i tried it for myself. I altered it so that you shoot on the x axis and you shoot when the space button is pressed.My question is, how do you make the bullets shoot when the space button is releases? And or can make the bullet shoot at an interval of one second or so when the space is pressed... The bullets for me are shooting at a continuous streem and that may be a too great advantage for a user..
View 6 Replies
Nov 10, 2010
Im trying to figure out how to travel along a plane to a point in 3d space. It needs to feel as though travelling down a road. I have attached a swf with the desired effect. Im using the formula scale = fl/(fl + z);the problem im having is it looks fine until scale is > 1. I need the plane to stay central to the screen.
View 0 Replies
Apr 1, 2007
how to rotate a 2d plane in 3d? for example... i want to load a jpeg in to a movieclip, and then, using actionscript, flip the photo around so essenitally you're looking at the back of it.i've seen the Scripting 3D in Flash kirupa resource, but it's a bit advanced for what i need. i only want to flip a 2d plane 180 degrees.
View 2 Replies
Apr 15, 2011
how i can add text on a plane and put the plane in a 3d scene?
I have the following
Code:
[Embed(source="../lib/QuickScan.png")] private var QuickScan:Class;
private function createScene():void {
quickscan = new QuickScan();
[Code].....
View 2 Replies
Jun 7, 2010
I have a machine that shoots canon balls into three different barrels, each on a different x axis, I need to be able to shoot at an arc into the target barrel, the target barrel will be randomly determined right before the ball is fired, the barrels will be randomly placed from stage to stage
the friction and gravity applied are constant variables, how can i determine both the correct x and y veleocity to shoot the balls out so that they end up in the correct barrel. I don't want to hard code any variables
View 2 Replies
Sep 24, 2010
So I've set myself a little project to build a bowman game. Everythings working smashing until the math at the point where the computer needs to figure out the power and angle to shoot the arrow back at you. What I've been working off is my knowledge from applied-math classes in school. I've been using the following formula where g is gravity, t is time (this would be in frames for flash), sx is the distance between the players, u is the initial force of the arrow and a is the angle we need to find. With a bit of moving around to seperate the angle, this becomes For my AS3 this translates to:
[Code]...
What happens is that it always fires the projectile at a very low angle that doesnt change to match the correct circumstances and I can't figure out how to get around this. Changing the force doesnt make any difference and the program will need to get around changing distances between the player so this math is pretty necessary (I think). Any math heads out there know what I should change?
View 1 Replies
Jan 16, 2012
I'm basically trying to emulate Photoshop's Vanishing Point tool where you can define the 4 2D points and the 3D plane is calculated from that information, in terms of the rotation of the plane relative to x y and z axes.
So if you have an image like this one:
And you define the points of the four corners, maybe like this:
It would define the 3D plane that the surface must live on relative to the x y and z axes. Researching this has led me to some tutorials on drawTriangles and Homographies, but they all seem to be focused on mapping bitmap data and I can't seem to find anything that defines a 3D plane itself.
View 5 Replies
Jun 11, 2010
I have a 2d plane rotated on its x axis, with 2d display objects I want to move around on the plane. Its pretty similar to a chess board [URL]..
The board is a rotated rectangle, and the pieces are just 2d display objects. Whats the easiest way to manipulate those objects so they appear to be moving on the board?
View 1 Replies
Jun 22, 2010
I have an array of points and I need square planes to be drawn between these points and distorted if points change their coordinates (see what I mean in the attached file).So what is the best practice I should use to create such set of planes knowing just coordinates of the points (planes vertices)?
View 4 Replies
Jul 22, 2011
I am having trouble getting a spaceship to fly through space in 3 dimensions. I was wondering if anyone knows of like some good example source code for 3D plane flying movement?
Or if someone could point me in the right direction for the Trigonometry equations,
View 0 Replies
Oct 13, 2011
Can I make Spiral Plane with Papervision3d using TweenMax or other tweener engine the like attached picture? Which plugin should I use if possible?
View 1 Replies
Sep 15, 2009
I add an FLVPlayback component on to a Papervision Plan. So far so good. Video plays, 3d works. But I am facing two issues:
1. Even though I set my MovieMaterial to interactive, I canot click on the controls. I have found someone else that stumbled onto something similar (link 1, link 2), but since they did not have answer, I though of asking here.
2. The FLVPlayback is jittery. What I mean is that the component's x position moves all the time from something like 0 to 10 or 20, then back to zero. Remember in the old days of analog television (if you're old enough) when you had to play with the tracking? It looks like that.
Here is my code:
Code:
package
{
// + ----------------------------------------
// [ IMPORTS ]
[Code]....
View 2 Replies
Oct 25, 2009
Trying some tutorials about Papervision3d. Found a problem when trying to rotate the plane.the AS conde below:
Code:
package {
import flash.events.Event;
[code].....
View 1 Replies
May 10, 2010
if I take a square, turn into a Movie Clip, addjust the Perspective Angle, and the Vanishing Points. Then I rotate the square along the x axis so that the square is now a plane laying on the z axis. How do I get the length of the Movie Clip? I need to know when a plane starts and ends on the z axis. I also need to get the width.
View 3 Replies