ActionScript 3.0 :: Shooting In Different Directions?

Sep 16, 2010

I have been googling my butt off I can not find anything about AS3 and shooting in different directions.

I just need to shoot in the direction my char is facing.

I have this so far which work flawlessly ;-)

function Shoot(event:MouseEvent):void { trace("shoot");}

oh also I can get the direction my hero is facing using trace "character_mc.rotation"

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Directions Of Movieclip?

Jan 28, 2012

I have a movieclip that moves arround on my stage. I'm looking for a way to tell what direction my movieclip is going in AS3. (up, down, left, right

View 1 Replies

ActionScript 3.0 :: Shooting A Target?

Apr 24, 2009

I have a monster_mc that shoots a bullet_mc at a target_mc.When I click the Keyboard.RIGHT the bullet jumps once then hesitates or pauses then continues -=25 pixels, instead of shooting smoothly.Am I missing something here?, can I make it perform better?

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
target_mc.stop();
function keyPressed(event:KeyboardEvent):void[code].....

View 1 Replies

MX Shooting Bullets In Any Direction?

Jun 28, 2011

I need a code in AS2 that launches a bullet ("bullet") from the character ("hero") towards wherever you clicked the mouse.For example, if I click somewhere, I want the bullet to launch straight towards where I clicked.

View 10 Replies

ActionScript 3.0 :: Move Link In 4 Directions

Jun 4, 2009

I'm trying to clone The Legend of Zelda (NES) Link's movement.

This what I have:

PHP Code:

stop();var leftKeyDown:Boolean = false;var upKeyDown:Boolean = false;var rightKeyDown:Boolean = false;var downKeyDown: Boolean = false;var linkSpeed:Number= 7;// Link MovementLink.addEventListener(Event.ENTER_FRAME, moveLink);function

[Code].....

View 13 Replies

Image Working As A Scrollable Map (all 4 Directions)?

Dec 31, 2011

Ok, so I got this huge image of a map. I put a Mask over it so it will fit on a small screen. But....I want users to be able to view the whole map but click on arrow buttons that will transfer them in all 4 directions. I know I can do this with keyframes, showing different parts of them map each stage....But isn't there a simplier way? Some sort of actionscript code that will tell flash to scroll how many pixels left or right or up or down? And that it will know that the image will stop here so don't scroll more than that?

View 4 Replies

ActionScript 3.0 :: Autoscrolling Text In Different Directions

Apr 24, 2009

I've a got bar (songBar) on which it will appear the artist and the song name (artist_txt). What I want is when the title_txt width is larger than the songBar.width, the text to scroll from right to left, and when the tween is finished to scroll from left to right (all this tween has to be a loop). If the width of artist_txt is smaller or equal to the songBar.width then artist_txt is aligned in the center of the songBar. All I'm trying to code it's just what you see in winamp player.

Code:
var textTween:Tween;
if (mp3player.artist_txt.width > mp3player.songBar.width){
textTween = new Tween(mp3player.artist_txt, "x", Linear.easeNone, mp3player.songBar.x, mp3player.songBar.width - mp3player.artist_txt.width, 1, true);
} else {
mp3player.artist_txt.x =(mp3player.songBar.width + mp3player.songBar.x)/2

I don't know how to reverse the tween when it ends, how to create the loop and how to stop the tween if the else statement comes into play. i don't want to create the animation on timeline, all I want is code.

View 2 Replies

ActionScript 3.0 :: Shooting Game In Flash CS3?

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

ActionScript 3.0 :: Shooting In Same Direction As Character?

Feb 15, 2010

I'm making a game that is birds eye view like the old grand theft autos. anyway im currently stuck at this... I can have my character fire and have the bullet follow my mouse but I cant seem to figure out how to just make the bullet go straight off the screen in the direction my character is facing.

View 2 Replies

Create A Shooting Style Game?

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

ActionScript 2.0 :: Top Down Shooting Game - Boundaries

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

ActionScript 3.0 :: Shooting In Same Direction As Character

Sep 20, 2010

I'm making a game that is birds eye view like the old grand theft autos. anyway im currently stuck at this... I can have my character fire and have the bullet follow my mouse but I cant seem to figure out how to just make the bullet go straight off the screen in the direction my character is facing.

View 8 Replies

ActionScript 3.0 :: Adding Get Directions Functionality To A Google Map

Mar 18, 2010

I wish to extend upon a basic Google Map. What need to do is make a submit field where people can enter in their postcode and it directs to a preset destination by defining a route upon the map. My test map is here if you wish to view it: [URL]
 
The Google Map that I have so far has been created by following an excellent tutorial by tunevision: [URL]
 
Here is the code that I have used including most of the comments:

[Code]....

View 3 Replies

Flash :: Google Maps Api Directions Failure 400?

Sep 10, 2011

I created a map with the Google Map API For Flash that shows directions. It creates a line between the 2 addresses and gives turnbyturn directions.

This is working perfectly in Flash test mode locally but once i put it online The map still works but the directions dont show and i get the Failure status 400.

Does anywone know whats the problem here? I'ts driving me crazy just because its working locally but not online.

DirectionsEvent.DIRECTIONS_FAILURE.feature.status = 400

View 2 Replies

ActionScript 3.0 :: Rotating Circle In Both Directions Using Buttons

Oct 20, 2010

What I have is a circle image (for this purpose lets say it looks like a clock). For example: when you click 3 o'clock, the whole clock needs to rotate around with the 3 o'clock btn at the 6 o'clock position (with the pivot point in the centre). each of the 'time' positions (2 o'clock, 3 o'clock, 4 o'clock ...etc) needs to be a button and thus be able to rotate around to the 6 o'clock position. This would seem simple enough by just using a .rotate value or using tween movieclips...however the tricky part is:

The actionscript needs to determine which way the clock turns (anti/clockwise), dependant on where the clicked time-btn's position is. it needs to be some sort of if statement that says: If (3'oclock-btn) is positioned between 0 degrees (being original 12'oclock position) and 180 degrees (original 6 o'clock position), then rotate clockwise to the 6 o'clock position. If the (3o'clock btn) is positioned between 180degrees and 259 degrees (12 o'clock position), rotate anti-clockwise to the 6'oclock position.

View 3 Replies

ActionScript 2.0 :: Kirupa Mc Create Duplicates In Both Directions X And -x

Aug 11, 2005

[Code]....

I changed the code a bit because I would like it to work like this...If I put my mc (photo) in the center of the stage, it would creat dups every 125 pixels. But this script only makes one duplicate, I must have done something to mess it up. Idealy I would like to have the mc create dups in both directions; x and -x.

View 6 Replies

ActionScript 2.0 :: Get The Chainsaw To Only Flip Directions When Dragging It

Aug 26, 2006

ive been making real simple ads for my friend for about two months now slowly getting more and more detailed but this one i tried alot of new stuff and am getting a lot of new problems. ive searched for the answers and found close stuff but havent been able to adapt it to what i need. Problems:

1. im not sure how to get the chainsaw to only flip directions when i am draging it.(i tried what i could think of but my bag of tricks is small)

2. i found the code to spawn the zombies with random numbers of each and speed but im not sure how to get them on a repeating path after their there.

3. i need a way for the hittest to register once then stop to allow me to play to death animation and get a count of how many have been killed to trigger the clicktag.(i dont have an animation for that so the currently turn black to show their out.)

4.i dont know how to do the hittest on the spawned zombies and they are also ontop of the saw. im sure there are more problems i havent found yet but these are the ones i could think of right now. also i may be adding alot of info you dont need but im trying to be thorough.

[Code]...

View 2 Replies

ActionScript 3.0 :: Moving A Sprite In Both Directions Of X-axis?

Jul 27, 2009

am trying to make a game whre i want the sprite to move from positive x-axis to negetive x-axis for 30 seconds and after dat it has to down along y-axis one step.

View 1 Replies

ActionScript 2.0 :: Shooting Game Bullet Removal?

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

ActionScript 2.0 :: CS3 Shooting Game Missile Flaw

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

ActionScript 1/2 :: Shooting Works Only When Jumping Not Standing?

Jan 23, 2012

I'm having trouble getting my character to fire. it seems to fire when he jumps, but not while standing. I have attached my code to the zip file below:This is the code I used:

onClipEvent (load) {
var gravity:Number = 0;
var speed:Number = 5;

[code]....

View 1 Replies

Flash :: Shooting One Arrow Per Click Towards The Mouse

Aug 23, 2011

i am looking for a tutorial to help me with shooting one arrow per click towards the mouse. this is my code:

[Code]...

View 1 Replies

Actionscript 3 :: Shooting Projectiles Given An Angle And Power?

Dec 31, 2011

I'm doing a prototype game like Worms and I would like not only to shot, but also see the whole projection curve where my shot will travel before it hit the ground. The only information given by the player is an angle and a power. There is also some level elements like wind and gravity.

Can I have a code for the projection curve? its like a parabola I think. I research about parabola but I had some difficult to apply these math formulas into the programming code.

View 1 Replies

ActionScript 2.0 :: Create 2d Platform Shooting Game?

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

ActionScript 2.0 :: Shooting In A Game-megaman Style

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

Flex :: State Transition Doesn't Resize In Both Directions?

Apr 5, 2011

I already had another question on this issue which was successfully resolved. But now, with a slightly different example, I'm stuck again.I have two states. When I switch from A to B, it resizes correctly, but when I switch from B back to A it happens without the smooth resize transition. What am I doing wrong?Here's my code:

<fx:Script>
<![CDATA[
protected function rollOverHandler(event:MouseEvent):void[code].............

View 1 Replies

ActionScript 2.0 :: Flash5.5 Character Flip Over When Changing Directions?

Dec 24, 2011

am a day 2 flash user and I have been trying to make a game, but for starters i want to make my character be able to move using arrow keys that includes showing the legs movement instead of a fixed image drifting across.There is one problem, when I press RIGHT arrow key , it goes fine, but when I press LEFT arrow key (rever direction) my character flips from point A to point B instead of facing left, i have been thinking maybe it's the frame problem, is it possible to tell flash to play the REVERSE moveclip

View 14 Replies

ActionScript 3.0 :: Target Shooting Game - HitTestObject Not Working

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

ActionScript 3 :: Object Flying Around And Shooting - Rotation Values?

Apr 6, 2012

I got an object (called tempEnemy) which is flying around and shooting. The problem is that I can't keep the value tempEnemy.rotateTo positive, i.e. It shall be between 0 and 359 degrees. Currently rotateTo ranges from:
rotateTo < 0 (bug) && rotateTo > 0 && rotateTo > 359 (bug).
tempEnemy.dX = tempEnemy.destX - tempEnemy.x;
tempEnemy.dY = tempEnemy.destY - tempEnemy.y;

//I added 180 because my tempEnemy object was looking and shooting to the wrong direction
tempEnemy.rotateTo = (toDegrees(getRadians(tempEnemy.dX, tempEnemy.dY))) + 180;
if (tempEnemy.rotateTo > tempEnemy.frame + 180) tempEnemy.rotateTo -= 360;
if (tempEnemy.rotateTo < tempEnemy.frame - 180) tempEnemy.rotateTo += 360;
tempEnemy.incFrame = int((tempEnemy.rotateTo - tempEnemy.frame) / tempEnemy.rotateSpeed);

View 2 Replies

ActionScript 2.0 :: Bullet Shooting Thing Which Shoots Bullets

Apr 2, 2007

I have like a bullet shooting thing which shoots bullets (obviously), and it sorta rotates around a point and fires at a movie clip. At the moment the bullets move outwards because of a animation in side the bullet movie clip, but how can I make them move outwards and away from the thing that fired them using actionscript?

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved