Make An Enemy Bullet Go Towards The Main Character?

Oct 12, 2008

How would i make an enemy bullet go towards the main character?

View 7 Replies


Similar Posts:


ActionScript 3.0 :: Enemy Character To Fire A Bullet Every Second?

Jul 21, 2010

I am trying to program a game and I want the enemy character to fire a bullet every second, but instead he is firing an infinite amount of bullets right after the other. Here's the code with the timer:
 
if (k == 0){
var shootRight1 = new Timer(1000,1);
shootRight1.addEventListener(TimerEvent.TIMER_COMPLETE, enemy1shoot);
shootRight1.start();

[code]....

View 5 Replies

ActionScript 2.0 :: Enemy Attack - Make The Enemy Pause When It Reaches The Character, Then Choose An Attack To Use?

Mar 18, 2006

I am currently making a game, similar to StreetFighter,where enemies will come on from the side and you fight them. Now i have the character movement and attacks fully scripted, and have made an enemy, and i make it move towards the character using:

onClipEvent(load){
movethy = 7;
scale = _xscale;[code].....

Now this works quite well and the enemy stops when it hits the character, but the problem is, it wont complete a full attack, instead it plays a few frames of the attack MC. Now i have every attack in a different MC (Frames 2-5) inside the Enemy MC. How can i make the enemy pause when it reaches the character, then choose an attack to use? From there i'll be on my way and can script the hittest and so forth.

View 2 Replies

Way To Remove 'Enemy' When It Comes Into Contact With 'bullet'

Jan 18, 2010

Basically i just need a simple way to remove the "Enemy" when it comes into contact with "bullet".Ive been looking on the internet but its just really confusing me at the moment. And im not sure how easy its gonna be with the way i have set it up.

View 1 Replies

ActionScript 2.0 :: Can't Get Character To Die When He Touches The Enemy

Oct 25, 2009

I added attack to my character in the game and he attacks and the enemy dissapears, the problem if I can't get my character to die when he touches the enemy. I got it to work once but what happened was that even if I hit the enemy, as soon as I hit it I got to the game over screen and got stuck on a loop between the gameover screen and the moment I defeat the monster.

View 2 Replies

ActionScript 3.0 :: Way Of Removing Enemy Character Permanently

Jul 9, 2011

I am trying to remove an enemy after I kill them and I just started working with code in .as files. The enemy has it's own logic in a .as file and when I use removeChild, the movieclip is removed, but the logic continues to attack the main character (invisible).Is there a better way of removing the enemy character permanently. It kind of scares me that the method I use could just be leaving invisible movieclips on the screen as well.I've tried everything that I have used in previous games: removeChild(EnemyArray[i]);And this, which causes other problems with my code but removes the logic: EnemyArray[i] = null;But these still cause the problem.

View 4 Replies

ActionScript 3 :: Initiating A Bullet Changes Direction With Character

Mar 2, 2012

I'm working on a side scroller that has a character that fires a bullet every time you hit spacebar, the problem I'm having is moving the bullet in the direction the character is facing (left or right).

I have a few of boolean variables to tell me which direction my character is facing: walkingRight | walkingLeft, so if my walkingRight == true, I want the bullet to travel +=10, and walkingLeft == true, bullet -= 10.

The problem is, when I fire facing left, the bullet moves left, but as soon as I turn right, that same bullets starts moving right.

Here is a snippet of AS3 code (Every Frame):

if(gamepad.fire2.isPressed){
// initiate bullet
var bullet = new Bullet();

[Code]....

View 1 Replies

ActionScript 3.0 :: Random Character Instead Of Bullet With Embedded Font?

Jul 10, 2011

I have a text field (old-style, non-TLF) with the following HTML text:[code].....

The font Optima is embedded, and I've selected embed all glyphs.What I'm getting rendered to the screen is as the image below, with a random i + umlaut character in place of the bullet.Is this a problem with Flash or is the font file somehow missing the bullet character, and does anyone know how I can fix this issue, preferably without having to move across to TLF text.?

View 1 Replies

ActionScript 3.0 :: Stop Bullet To Move With Character Body In Shooter?

May 28, 2009

I'm making a shooter. Whenever my bullet starts flying and I move my character the bullet keeps moving with it. The rotating gun is in the body movieclip layer so it follows the body around and I can move the gun is there anyway to disconnect the bullet from also moving around with the body ?

Code:
stage.frameRate = 30;
var angle:Number = 0;
var radiansToDegrees:Number = 180/Math.PI;
var degreesToRadians:Number = Math.PI/180;
var currentGeweer_mcRotation:Number;
var Bullet_mcHolder:MovieClip = new MovieClip();
addChild(Bullet_mcHolder);
[Code] .....

View 18 Replies

ActionScript 2.0 :: Movieclip - When It Hits The Enemy, It Goes To The Enemy's Second Frame?

May 31, 2004

i have one movieclip and i have another movieclip>enemy...okay so when the first movieclip goes over the enemy, nothing happens until i roll out! all i want to do is the movieclip, when it hits the enemy, it goes to the enemy's second frame and that's it ! there are no syntax error in this script, just something i want to do that apparently doesn't work right.here is my code:

Code:
onClipEvent (load) {
speed = 2;[code]...

View 14 Replies

ActionScript 3.0 :: Setup Bullet Factory/bullet Switch For The Same Player Object?

Mar 25, 2011

I'm currently making my own shoot'em up game where the player can switch  between two player types which will fire their own bullet type in this  case, squares and circles. I've setup the player switch function via  pressing "space" button (switching between the two player types) and the  default bullet type is "squares" and I'm not sure to approach the  coding with changing the bullet type to "circles".I've written 2 classes for the bullet and player setup:Player Class: Creates instance of bullet on screen and enables the switch player type function

Bullet Class: Enables bullet properies and bullet types Player Class: Code:function onKeyDown(event:KeyboardEvent):void {if (event.keyCode == 32) //// pressing/holding "space bar" to function

[code]....

View 5 Replies

ActionScript 3.0 :: Shooting Multiple Bullets - Press The Space Bar The First Bullet Disappears And The Bullet Animation Starts Again

Nov 24, 2008

I'm trying to make my platform game character shoot a gun, my character and gun are one movieclip and the bullet is another. The bullet mc starts on a blank frame with a stop() function, when I press the space bar the bullet mc plays from frame 2 which is a motion tween of the bullet quickly moving across the page. I've set the bullet's y and x values relative to the character mc so that the bullet always comes from the gun.

My issue is that if I press the space bar a bullet will fly out of the gun (great!) but if I press the space bar again, the first bullet disappears and the bullet animation starts again. I want to be able to shoot a new bullet every time I press the space bar without effecting the bullets that have already been shot.

[Code]....

View 3 Replies

ActionScript 2.0 :: Make A Movieclip Of A Character And When The Character Is Dragg?

Aug 11, 2009

i was wondering if any of you out there could tell me how it is possible to make a movieclip of a character and when the character is dragged about the screen by the curser, how do you make the characters arms and legs swing about in a realistic fashion.

View 2 Replies

ActionScript 3.0 :: Set The Bullet.x To Ship.x In The Bullet Class?

Oct 4, 2009

i have 2 classes, one for ship one for bullet.i was trying to set the bullet.x to ship.x in the bullet class but it keeps telling me undefined. but clearly it is in my ship class.

View 10 Replies

Flash :: Make Enemy Move Towards Mouse

Oct 1, 2011

package {
import enemies.Enemy;
import flash.display.Sprite;
import flash.events.*;

public class Main extends Sprite {

[Code]...

The enemy class has a bitmapped embeded into it. I am using FlashDevelop to program. When I do something like enemy.x+=1 it works, but when I try using my tween it script the enemy stands still no matter what the position of the mouse.

View 3 Replies

ActionScript 3.0 :: Make Enemy Array That All Follow Player?

Feb 12, 2012

I am working on a first person shooter game, however i dont know how to make all the enemies that get created, to all move towards the character every few seconds then moving randomly for a few seconds, with the frequency increasing as the enemies move closer to the player. Getting that part is easy enough, the problem is i dont know how to make each enemy be able to do anything really independantly. Since my game works in a an external AS file, i cant access any of the class variables from within the movieclip of the enemies. Is there a way i can do this?

i already have code which rotates and moves the enemy towards a given point, as well as random movement, what i dont know how to is access the variables of the main class from the movieclips of the enemies, and vice versa ive found a way to do this, however it means i have to out the movement code within the enemies, as well as collision code, and that just laggs the hell out of the game when there is 5 or more enemies.

View 0 Replies

ActionScript 3.0 :: Make A Bullet Disappear When It Hits A Target?

Jul 30, 2011

I have created a class named Bullet() and I create a child named bullet_mc every second.This bullet_mc moves to a direction on the stage.I also created a class named Plane() and I create a child named myPlane_mc every two seconds. Also, every myPlane_mc moves to a direction on the stage.

View 5 Replies

ActionScript 2.0 :: Make A Bullet Hole Appear When Shoot An Object

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

ActionScript 2.0 :: If Hit The Enemy Ball (instance Name Is "enemy") It'll Disappear?

Mar 28, 2008

I have a ball (instance name is "ball") and if I hit the enemy ball (instance name is "enemy") it'll dissappear, and add 100 points. At the same time, I want them to multiply and get faster.The enemy has a follower code:

onClipEvent (enterFrame) {
if (_root.ball._x>_x) {
_x += 2;[code]....

And the ball has a code that is secret because if I give it to you it'll spoil the game idea.The dynamic text box has an instance of "points".I have my mute sound control done and the ball you control done.

View 2 Replies

ActionScript 3.0 :: Make A Bullet Launch At Different Degrees (anywhere From 1-360) From A Specific Point Towards The Mouse

Jul 30, 2009

I need to make a bullet launch at different degrees (anywhere from 1-360) from a specific point towards the mouse.

View 3 Replies

ActionScript 3.0 :: Make The Character In Flash Game Make A Jump When The Player Presses A Key?

Dec 19, 2009

i want to make the character in my flash game make a jump when the player presses a key,e.g. 'space',even the player release the key instantly,the character will still finish the complete jump process.

View 1 Replies

ActionScript 2.0 ::make A Third-person Shooter Game - "hide" Clip Does Not Receive Any Commands From The Enemy Clip?

Feb 19, 2005

im trying to make a third-person shooter game similiar to those "hide" when you press Down and "attack mode" when you stand Up, sort of like Time Crisis.I've done first person shooter games before.The hero character's move clip contains three clips, one of him in hiding, one in attack mode, and the last being hit. How do I script it such that the "hide" clip does not receive any commands from the enemy clip (which tells the hero clip to advance to "hit" clip and lose a health").

View 3 Replies

ActionScript 2.0 :: Make Character Have A Different Animation

Jun 26, 2010

So I'm making a platforming game, how do I make my character have a different animation for when he runs or jumps?

View 4 Replies

ActionScript 3.0 :: Make A Level That Follows The Character?

Jul 31, 2011

how would i make a level that follows the character? would it be a on enter frame event?

View 13 Replies

ActionScript 3.0 :: Make Character Go By Curve?

Feb 5, 2011

I got a curve(e.g. movieclip) which i want my character to go on when i press left/right arrow. How to make that?

View 2 Replies

Make Character Move Across Screen?

May 12, 2010

I've created a walk cycle using bone tool on a character but i don't know how to make it move from one part of the screen to the other. The character is made up of 6 layers, 4 of which are armatures and 2 have motion tweens.

View 1 Replies

ActionScript 2.0 :: Can't Make Character Jump?

Nov 14, 2006

I am creating a game in flash using spirte sheets of megaman and I have a problem setting up script to make him jump. I am able to have megaman run side to side and also shoot but I can not get him to jump. Here is a sample of my code:

var hspeed = 0;
var vspeed = 0;
var i = 0;

[code].....

View 3 Replies

ActionScript 2.0 :: F8 - Make The Camera Follow A Character?

Feb 16, 2009

im making a platform game at the moment and i need for the screen to follow the character, at the moment i've got the code on the background symbol and all the baddies in that symbol so when you press the arrow key the symbol moves to the side the code i have on this is

onClipEvent (load) {
walkSpeed = 2;
}
onClipEvent (enterFrame) {
if (air == true) {
[Code]....

if anyone knows a way to put this on the camera

View 1 Replies

ActionScript 2.0 :: How To Make Character Attack In Game

Jun 8, 2011

I want to know how to make a character attack in a game. I've made a platformer game in which a character moves and jumps and collects the score balls, but the only thing I can't do is make him hit enemies.

View 1 Replies

ActionScript 2.0 :: Make Character Face Mouse?

Dec 24, 2011

How would I go about doing this but not directly like 360. like lets say my mouse is to the left of the character the character would than face its left frame I made for him like lets say his left frame is frame 2.

View 8 Replies







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