ActionScript 3.0 :: Making Beat Em Up - Character Stop Moving If The Attack Is Pressed And Once It Is Released Start Moving Again?

Nov 2, 2010

im currently making an "AS3 beat em up" ala streets of rage or double dragon.Currently i have my character moving and a few animations done and i am trying to figure out how to make attacks work.I have some "basic" animation for his attack, but im not sure how to get it to work correctley.What happens is, if you press control (the attack button) whilst the character is walking he just keeps moving and is stopped on the attack frame.I want the character to stop moving if the attack is pressed and once it is released start moving again.

hero.gotoAndStop('still');
var left:Boolean = false;
var right:Boolean = false;[code].......

View 2 Replies


Similar Posts:


ActionScript 1/2 :: Making Character Attack If SPACE Is Pressed

Sep 30, 2011

Im trying to make my character attack, the attack animation is inside the character movie clip on frame 4. But i dont understand how to do it? I want him to attack once, if SPACE is pressed. I have tried this:

[Code]...

View 1 Replies

AS3 :: Flash - Stop Character From Moving Through Walls?

Oct 9, 2011

I want to stop the movieclips movement when it hits a wall (another movieclip). The example below works, but after the collision the movieclip 'blocks' all movement to the left...

For now the example with the leftArrow key;

variables to check the key, if it's hitting the walls and if it's moving or not:

var leftArrow:Boolean;
var speed:int = 10;
var hitting:Boolean;

[Code]....

View 2 Replies

ActionScript 2.0 :: Stop Playable Character From Moving

Jun 6, 2011

I am trying to limit the area in which the character (mcMain) can move I want to be able to keep it in an area (mcBuilding) I also have another area (inwhich the character is not supposed to get to) (mcBackground). (Also I want to be able to to make a dynamic text box that starts at 100 then decreases by 5 when the enemy (mcEnemy) hits mcBuilding and also that it gets removed)

View 1 Replies

ActionScript 3.0 :: Moving Character - Unable To Use "Key" To Identify A Pressed Key

Aug 2, 2011

So I'm new to Flash, and I've found most people make player controlled characters in Flash move through

[Code]...

Since these are ActionScript 2.0 source codes, I think ActionScript 3.0 won't let me use "Key" to identify a pressed key.

View 1 Replies

ActionScript 2.0 :: Moving Image When Button Released?

Jul 17, 2004

this is old and I used to know but forgotten over time. How do you scroll an image across to a certain point when a button is released?

Preferably with easing.

View 1 Replies

ActionScript 3.0 :: "TweenEvent.MOTION_START" - Start Moving The Second Movie Clip At The Same Time When The 1st Starts Moving

Nov 28, 2010

I have some simple script that has 2 "movie clips". What I want to do is to start moving the second movie clip at the same time when the 1st starts moving. (both start moving at the same time) I tried the following script but it never works:

[Code]...

View 3 Replies

ActionScript 3.0 :: Stop Moving MC - Fish To Stop Swimming After Clicked It And Start Swimming After Another Click

Jan 1, 2012

what wrong with the functin 'stopFish' Without this function the fish in the tank swims but when I add it, it doesnt anymore. I just want the fish to stop swimming after I clicked it and start swimming after another click.

View 1 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

ActionScript 2.0 :: Drunk Moving Character To Be Able To Catch Character And Play A Scene From Within The Drunk Characters Movie Clip

Jan 13, 2004

I would like my character to move as if he was drunk I am unsure how to do that I am using the keyboard for his movement. I also have a character that moves at random I would like the drunk moving character to be able to catch this character and play a scene from within the drunk characters movie clip but I want this character to try and escape the idea is the drunk character gets points for how long he is able to hang on to this character

View 2 Replies

ActionScript 2.0 :: Moving Map When Keyboard Keys Pressed

Jun 21, 2006

I want this code to move my map i.e map_mc when the keyboard keys are pressed. When I add it to the map_mc, I see no effect what do u think I am messing with.

Code:
on (keyPress "<Left>") {
currentX = this._x;
this._x = currentX - 2;
} on (keyPress "<Right>") {
currentX = this._x;
this._x = currentX + 2;
} on (keyPress "<Up>") {
currentY = this._y;
this._y = currentY - 2;
} on (keyPress "<Down>") {
currentY = this._y;
this._y = currentY + 2; }

View 3 Replies

ActionScript 2.0 :: Moving Background With Character?

Sep 12, 2004

what i am trying to do is get the background to move with the characteri checked out a few tutorials.but not enufheres the deal..i have a character that can fly...and when the character goes upward...thebackground moves down to expose sky..then eventually black space with stars...does that make sense?

View 2 Replies

ActionScript 2.0 :: Character To Stand Still When Not Moving

Apr 15, 2002

i posted up lookin for flash tutes to make my game in flash 4 but i guess it's virtually impossible to do so..... well, now i decided to do it in flash 5. here's my concept >

it's basically a game controllling a character to move in grid filled with objects like so >

1 0 1 0 1 0 1 0 1
0 0 0 0 0 0 0 0 0
1 0 1 0 1 0 1 0 1

where 0 (path) is passable n 1 (objects)not....

n i want d character to stand still when not moving and get to an animated frame of it moving when moved in whichever direction. i guess dat's all i need for now. please help me with this as like i've said, i kinda new to actionscripting.

View 14 Replies

ActionScript 2.0 :: Character Keeps Moving While Being Ible

Jul 26, 2011

At the first scene of the game My hero character stands still when he's idle but at the second scene he keeps walking in one spot when he's idle. What's going on? Why are the scenes messing with the hero character?

View 2 Replies

ActionScript 2.0 :: Moving Background With Character

Sep 12, 2004

what i am trying to do is get the background to move with the character.i have a character that can fly...and when the character goes upward the background moves down to expose sky..then eventually black space with stars also i want the background to stop..like when the background ends.

View 2 Replies

Moving Character On X (left And Right) Only With Arrow Keys?

Aug 17, 2009

i got my character to move left, right, down and up wit this code:

[Code]....

My question is, how can i block the up and down movement? I tried simply deleting some part of the script to block does movement from the user. But then the script would not work properly : s Here is the uploaded page i'm working on: link.

View 2 Replies

Professional :: Create A Character With Moving Legs?

Apr 8, 2011

I'm brand new to flash and want to create a character with moving legs. I've created the character with legs, but don't know how to get them moving properly. Does anyone know a good tutorial?

View 2 Replies

ActionScript 2.0 :: Key.isDown Function - Moving Character

Jan 3, 2010

I have a character with multiple animations by way of movieclips, and I'm trying to have it move using the Key.isDown function. Now, my character is moving correctly, but when the key is released, the animation keeps playing. I tried adding a stop command at the end of the walkcycle animation, but that just causes the character to stay frozen on the last frame of the cycle.

Here is the ActionScript Code:
onClipEvent(load) {
var direction = "left";
var speed = 2;
} onClipEvent(enterFrame) {
[Code] .....

View 3 Replies

ActionScript 2.0 :: How To Get Character To Follow Moving Object

Mar 1, 2011

I need to get my character to follow an moving object. I've got an object that's moving around in different directions and I'm wondering how do I get my character to follow the movements when standing on the object ?

View 0 Replies

ActionScript 3.0 :: Flash - How To Flip 2D Character When Moving

Mar 15, 2011

I have a mc called boy and I have an instance of that mc called boy_mc. I have figured out how to make his position change on the stage, but I cannot figure out how to do some other things.

Here is the code that I have so far:
import flash.events.KeyboardEvent;
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
function keyPressed(evt:KeyboardEvent):void{
switch(evt.keyCode) {
[Code] .....

I am trying to learn 3 things.

1. How do I make him be facing left when I push left and facing right when I push to right?
2. How to I restrict him to a certain area of the stage? I am going to have some buildings on the top and I don't want him to be able to walk past the street level. So basically I don't want him to be able to go off the stage or up some to be determined height.
3. When he walks up and touches a door on my stage, I want to jump to another place in the timeline.

View 7 Replies

ActionScript 2.0 :: Game Boundaries - Character Not Moving Across Border

Dec 13, 2009

I've been struggling with making boundaries with my game. I've managed to make boundaries, but in stead of my game character not moving across that border it just bounces back. Which is not the effect I want.

Here's my code
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
xspeed -= power;
} if (Key.isDown(Key.RIGHT)) {
xspeed += power;
[Code] .....

View 3 Replies

ActionScript 3.0 :: Platformer - Moving Character And Loading Levels

Jan 28, 2012

I am currently working on a platformer using accelerometer to move the character and xml to load levels as so..
[as]
level.x += (e.accelerationX*40);
if (e.accelerationX > 5) {
e.accelerationX = 5;
} if (e.accelerationX * 40 < 3 && e.accelerationX * 40 > -3) {
player.gotoAndStop(1);
[Code] .....
And it is all added into one movieclip called level. My problem is when the character hits under a platform it will go up it which I don't want it too, I don't know how to fix it heres the gravity code.

View 11 Replies

Flash / AS3 Gaming - Character Moving Along Curved Terrain

Dec 3, 2011

I'm trying to create simple 2D action game, something similar to well known Fancy Pants Adventures :) I've been looking for answer for more than week and all I've found is [URL] which not answers the question. (I've found also moving on platforms that are rotated but that's not I'm looking for). I have also found great (and free!) flash game engine - CitrusEngine which I'm currently using, but, it doesn't provide moving hero along curved terrain. How to make hero moving along curved terrain like this one: [URL]. There are plenty of games like this (for ex. Fancy Pants or Robot Unicorn Attack) where main character moves along the curved terrain but I can't find answer how can I do that.

View 2 Replies

ActionScript 2.0 :: Moving X Position From Start To End State

Sep 12, 2007

I have this script, that zooms and fades the movieclip but I also need to shift the position slightly from the start state to the end state. For example var startX = 60 var endX = 70 so when the zoom start it starts at x = 60 and slowly moves as it zooms out to x = 70.

View 1 Replies

ActionScript 2.0 :: Mc Will Smoothly Stop When Stop Moving The Mouse

Aug 1, 2004

I have a MC that follows the mouse. I want to do so the MC will smoothly/softly stop when i stop moving the mouse. Is it hard to code, And it would be very nice if someone could do some code for it

View 2 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 1/2 :: Associate Buttons With A Moving Moving Clip?

Jan 30, 2012

what i have is a tween on a movie clip of a popcorn kernel on one layer and a tween on a button on another layer to follow the movie clip. i want to be able to roll over the kernel and make it "pop". i changed my over on the button to popped corn (this works) but i want it to stay popped for the rest of the tween.

View 11 Replies

ActionScript 2.0 :: Press Any Other Link To Start Moving Over The Scene To Different Pages

Jan 7, 2007

I've in my flash scene main page and sub pages scattered in different ereas at the scene, but the scene start from main page and that what will show only, now if I clicked any link the scene carry us to the link page in the same scene, and from that page I can press any other link to start moving over the scene to different pages.

View 6 Replies

ActionScript 2.0 :: When Click On The Door On The Right Side, The Object Will Start Moving

Feb 13, 2008

I have a picture and I want the object to be on the left side. When I click on the door on the right side, the object will start moving ( with motion tween ) to the door and when it reaches the door, Scene 2 will appear.

View 8 Replies

ActionScript 2.0 :: Making Object Moving To Left And Right?

Jun 26, 2011

I'm newbie in Flash and action script, just start learning T__T...
onClipEvent (load) {
speed=10;
} onClipEvent (enterFrame) {
if (key.isDown(key.RIGHT)) {
_x+=speed;
} else if (key.isDown(key.LEFT)) {
_x-=speed;
} if (key.isDown(key.UP)) {
_y-=speed;
} else if (key.isDown(key.DOWN)) {
_y+=speed;
}}
Is that making the object moving to left and right?

View 3 Replies







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