ActionScript 2.0 :: Game Walking Function ?

Jun 10, 2004

I'm on a very big scale project and it is a game. What I need done is a walking version, but not just some easy script for it. It's like there are 545 diffrent buttons in my game, and each other has a diffrent location. Now what I want to do is to use a function for moving between them. Here is an example screenshot of the location where you can move: http:[url].....The numbers aren't there in the real game off course, it's for the button number. Now what I want to do is that you click the button, and the move function is called. The function should be like:

- The movieclip that should move is a player, instance name is 'character'

- You move to the x and y positions of the button you've clicked.

- The movement speed should be a variable, you make the name up, just be sure I can edit it by changing 1 value

- The character must move through a good line, meaning if you are at position #16 and you want to go to 31, it first goes to 32 and then to 31 and not directly to 31

- There's a big Array (its called _root.takenArray ) and it checks Every spot where you have to move to (if you move from 16 to 31 it checks 31 and 32) it checks if the values of _root.takenArray[31] and _root.takenArray[32] are not bigger than 1
- If you're moving to 31 from 16 and _root.takenArray[32] (in other words, spot 32) is taken, it tries to find another route, like through 15 and then to 31. If there is one, it follows that route.

- If they are bigger than 1, The moving action shouldn't be done, if they aren't bigger than 1, move the player

All the spots of above are positioned like in http://vert.2webh.com/all.jpg

That's all. Sounds complicated doesn't it? Well I'm pretty advanced at actionscript and I couldn't manage to make it work.

View 4 Replies


Similar Posts:


ActionScript 2.0 :: Flash Game - How To Get Walking Animation For Character

Apr 4, 2011

I am currently making a platformer game but I can't seem to get a walking animation for my character. So far I have made a character which can move fine. Inside the characters movie clip are 2 frames (one standing and one walking) Now my problem is that I can get my character to move right and play the walking animation but when I walk left the walking animation doesn't play but the character still moves. I am using action script 2 and flash pro 8

onClipEvent (load) {
var ground:MovieClip = _root.ground;
var grav:Number = 0;
var gravity:Number = 2;
var speed:Number = 7;
[Code] .....

View 6 Replies

ActionScript 3.0 :: Game: Character Walks Around And Stops Walking When Hits A Hole?

Jul 7, 2011

I have a game where the character walks around the screen and stops if she hits a wall or a hole etc... - typical. HOWEVER - I coudn't get her to stop walking. Is there any standard code for this. If you tell to stop walking then she can't walk back out either etc... Also, she walked into the hole a little so being in the hole she definately couldn't walk any more not even back out as she would be walking inside the prohibited zone.

View 3 Replies

Flash :: Walking Animation While Moving

Feb 17, 2012

i have an movie clip instanced as "man" I have made him so that he has a Idle and Walk frame like this. He can also move left/right. (I also made him attack but that is irrelevant);[code]I need it to loop through the "walk" frames until i lift up the left/right key then go back to "idle" position. What happens is that it will go through the loop once and than go to idle even if I haven't lifted the key.[code]

View 3 Replies

ActionScript 2.0 :: Character Walking, Without _rotation?

Jul 29, 2006

I am trying to make my character look as he is walking around on the stage. I can make him, but what do I to make move his arms and legs? Also, I want the character walking animation when one of the keys is pressed, and stop walking when that same key is released. I have looked and looked with google and I can't seem to find the answer

View 3 Replies

ActionScript 2.0 :: Walking Inside A Specified Area?

Apr 24, 2008

I have 2 MC's - one of my main character, and one of a specific area, I wish to confine my MC in. My main character has the ability to move (lol) and I do not wish for him to move outside of the boundaries of the second movie clip. Now this would be very easy if the second movie clip would be rectangulary (sp?) shaped - but it's not unfortunately. I was wondering if there is some kind of function similar to hitTest that compares the two MC's pixel by pixel, rather than setting the second MC's boundaries as a rectangle around it.

For example, what if my second MC is oval shaped, with no filling - like the '0' symbol for example...If it that is impossible (i doubt it is but w/e), then this is a approximately what my second MC looks like:[URL]

View 3 Replies

ActionScript 2.0 :: Character Walking With Keys And By Mouse?

Sep 23, 2010

Wanting to be able to move multiple characters around a map (one at a time)First selecting them either by keyboard shortcut of by clicking them.then being able to move them with WASD of by clicking the mouse to a certain position on the map and the character would move in that direction.

View 1 Replies

CS4 - Trying To Make A Simple Walking Animation Symbol?

Aug 12, 2009

I've searched everywhere online, and can't find the help for this!
 
I've found some videos, but they did not seem to offer any sort of help for me.
 
I still cannot for the life of me figure out how to take 3 images, and make them into a simple walking animation and to convert that to one symbol.
 
Can anyone offer their help to me please so I can get my project going?
 
I'm using CS4, and all articles I can find are of the older versions of flash.

View 2 Replies

ActionScript 3.0 :: Animate A Dog Runing/walking Over The Screen?

Jul 14, 2011

I'm trying to animate a dog runing/walking over the screen. I asked someone to draw 8 directions of walking/running plus two transitions with 360 degree running/walking. is it enough to let me freely move the dog and change actions (walk->run, run->walk) too?

View 1 Replies

Actionscript :: Use Flash And It To Animate Human Walking?

Mar 11, 2011

I want to write a small game using flash and actionscript but I am not sure how to start. The basic element may be a man walking on a surface which I suppose is the fundamental elements for my application. However, as I am new to flash and such a project is just a test for whether I can learn from the internet quickly to master a new language, I suppose that examples are the best. So how can I get a human walking on the ground in 3D example using flash?

View 2 Replies

Walking Animation (MovieClip Control By Keyboard Events)

May 2, 2009

I have two MovieClips, and both are controlled by keyboard events. One is a globe that I want to rotate in one direction or the other. The second is a walking animation that should change direction or stand still depending on which key is pressed or if none are.

Here is the AS Code:
/*var rightDown:Boolean = false;
var leftDown:Boolean = false;
var upDown:Boolean = false;
var downDown:Boolean = false;*/
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
[Code] .....

You can see that I've tried a few different methods, but neither has worked correctly. Using the timer came close, but then the globe kept speeding up, and I couldn't get the walking animation to default back to the standing animation. Here is the .fla [URL].

View 1 Replies

ActionScript 3.0 :: Play The Walking Animation Inside The Movieclip?

May 21, 2011

how to move a movieclip with arrow keys. What I want to learn is how to play the walking animation inside the movieclip?

View 2 Replies

IDE :: Animate The Human Walk In Flash From Plain Walking To Running?

Aug 6, 2004

I want to animate the human walk in flash from plain walking to running. Is there any location from where I could pick up the animation sequence either directly or for modification in photoshop etc.?

View 1 Replies

ActionScript 3.0 :: GotoAndStop() - Make A Walking Animation For A Character With Customizable Parts

Oct 19, 2011

I am trying to make a walking animation for a character with customizable parts. I can't seem to get this code to work correctly:

[Code]...

playerStance defines if the character is idle or walking, in this case walkingchar is a MC containing 2 frames : idle and walk (the frames contain MC:s for the current animation, in this case charwalk)charwalk contains 2 keyframes and the others are filler frames, the keyframes in this case are 1 and 16charwalk contains layers for all of the character parts, for example bottom1 (is located in frame 1)all of the parts contain frames for every variation of that partin every frame of the parts is a code : stop(); to prevent them from playing when I gotoAndPlay charwalkWhen I play this and update the parts after changing parameters, the algorithm returns a right value, but the parts don't go to the correct frames. Instead they are kept in the first frame.

View 3 Replies

ActionScript 2.0 :: Stop Character Walking From When Road Scrolling Reach The Edge Of Screen?

Mar 1, 2008

here i have a zipped fla file where i have problem with the character still wallking when road scrolling reach the end of the screen.how would i stop that?heres script:

Code:
//road scrolling
road.onEnterFrame = function() {

[code]......

View 7 Replies

ActionScript 2.0 :: Correct Function/xml Game?

Dec 6, 2006

I am making a matching game for my company. I created an xml document to load in flash of medications and their descriptions. I used a dropdown menu component to load the categories the user can choose from and randomly load a med from that category. If they match it correctly, I want that item to disappear from the list to randomly load in that category.

However, the way it is working is...it does not randomly load a med (it loads the first item in the list [0]), it does not keep looping through the categories, nor does it remove an item from the list. I imagine if I can get direction to properly/initially load and randomize the data, that I can figure out the rest from there. I have been working on this for a long time...and I am stumped.

var Answer:Array;
var checkAnswer:Array;
//------------------Load the XML,populate the combo box and load med info into categories---------------------------------
import mx.utils.Delegate;

[code].....

View 1 Replies

ActionScript 3.0 :: Ending Level Game Function?

Jul 13, 2009

i have been trying to work out a way to have a endlevel function on my game....this function would, remove all event listeners, reset the cursor and most importantly clear all dynamically created movie clips(this is the part im having problems with).the first thing i tried was this:

[Code]...

View 2 Replies

ActionScript 3.0 :: Memory Game Random Function?

Feb 11, 2010

I made a memory game with a tutorial. My knowledge of AS3 is not that good so I have to following question.There is a function like Math.Random to random generate number and put them on stage. I made a memory game and the cards are on the same place every time I play the "movie".I want them to shuffle every time I restart the game. How can I write a good random function in AS3?

View 10 Replies

ActionScript 3.0 :: Implementing Pause Function In Game?

Jun 8, 2011

I'm implementing a pause function in a game, it stops the main game timer and then dispatches an event ("Game_Paused") to stop a second timer. Both timers stop (and start) correctly but the second one throws a null object reference error.

Here's the ActionScript Code:
private function onAddedToStage(e:Event):void{
_timerD = new Timer(100);
_timerD.start();
_timerD.addEventListener(TimerEvent.TIMER, onUpdateTime);
stage.addEventListener("Game_Paused", onPauseGame);
[Code] .....

And this is the output:
Code:
Paused Timer=null
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.rtr.game.UI::timer_display/onPauseGame()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.display::Stage/dispatchEvent()
at com.rtr.game::Game_Timer/onKeyDown()
Paused Timer=[object Timer]

What's really confusing me is that the timer is still getting paused correctly, and the trace is showing up in the output before and after the error with two different objects.

View 2 Replies

ActionScript 3.0 :: Platform Game Fall To Ground Function?

Feb 16, 2010

I have gotten to a point with my platform game where I am completely stuck. I have the player movement working fine but the only thing is, it doesn't fall off the blocks.

I have a Floor class which references the Character class and tells it to stop jumping when it is on a block through a hitTestObject. I have tried to research how other games have added functions but can't seem to find one which will work in mine.

View 1 Replies

ActionScript 3.0 :: A Function To Freeze The Timer After Finish The Game?

Feb 17, 2010

I have a little game with a timer in it. What I want is to stop the timer when you pass the finish.I wrote the if function with timer.stop();The timer stops but it is gone too. I want to see the time you have left to make it into a score.Is there a function to freeze the timer after finish the game?

View 3 Replies

ActionScript 2.0 :: Stopping Function Calls In Game Project?

Mar 5, 2010

I am developing a game project, in which I have many functions on it. I have all the major functions on the frame 50. And I don't want these functions on the next frame. Indeed I didn't have these functions on the 51st frame, the 51st frame only contains a stop action. But flash calls all the major function on the 51st frame also, I don't want these function to call on the 51st frame. Is there any way to stop this? Or else my program contains error?

Here is the program...
= The 50th Frame =
stop();
fscommand("allowscale",false);
fscommand("fullscreen",false);
var die:Boolean = false;
var currGun:String="hd_gun";
[Code] .....

View 3 Replies

ActionScript 3.0 :: Function Progress - Schedule The Game For Loading?

Feb 19, 2009

I'm making this game with complex visual effects (some rendered lighting using bitmaps), so it takes about 1 second or so generating a level with 3 big lights, so it may take a little more using more lights. The map is built when the player clicks to play the level. The thing is I can't show him the game is busy processing the level elements, because the graphic elements won't refresh until the start level function returns, which would make some sort of info sign while the map is loading useless. How would I make it so this information is visible right after I click Start level and disappear as soon as the level is built? I'm assuming the event handler from clicking Start level has to return before the level starts loading, but how can I schedule the game for loading?

View 4 Replies

ActionScript 3.0 :: Passing Function Parameters: Shooting Game 85% Done?

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

ActionScript 3.0 :: Flash Card Game Draw Function?

Apr 23, 2012

I am experimenting with a card game. In what I have been working on, I got a button to be able to be click and "draw" a card into the players hand. This is all done through the use of arrays and tracing. I have set it up in a class file called drawClass.This, however, is where I am beginning to have trouble. I want it to take a random array value from the array called currentDeck and then place it in the players hand when the player clicks on the draw button. I am using a for loop to try and get a random array value and push it into the playerHand array.

Code:
for(i = 0; i < currentHand.length; i++)
{
if(currentDeck.length == 0) break;[code]....

In addition I have another question in regards to class files. I am relatively new to Actionscript 3. Making the change from Actionscript 2 to 3. It seems that most things should be done in classes and code should be kept out of the main flash file. However, it seems that you have to manually attach a singular class file to the main flash file, through the use of the properties tab in Flash CS5. Meaning it doesn't seem like you can have multiple class files attached.My question is, is there a way to have multiple class files and would that way be to just have them in the same file destination has the main flash file or can you actually only have one class file attached at any given time?

View 3 Replies

ActionScript 3.0 :: Calling MovieClips Function For Interactive Video Game?

Mar 13, 2010

i'm Currently creating an interactive video game. There are 66 movies. I'm new to AS3, and have little experience in AS2.

The game in short:
You choose from 5 ingredients, each has this product provides a number of calories:Rice R = <- for all standard!

[code].....

View 6 Replies

ActionScript 2.0 :: A Mouse-focus Based Pause Function For A Game?

Mar 4, 2008

So your playing a flash game that's fast paced and mouse-based (hey that rhymes somewhat)... And then you accidentally move your mouse outside of the area of the swf... And then it pauses automatically with a "Continue" button, instead of you just dying or whatever. I've thought you could have a huge button the size of the stage and make it do something when the frame isn't 'mouseover' or whatever, but there's gotta be a better way. Also setting limits on the _xmouse and _ymouse wouldn't work cos sometimes the mouse moves too fast for them to accurately get the last mouseposition...

View 8 Replies

ActionScript 2.0 :: SetInterval Function - Setting Time Limit In Game App

Feb 9, 2009

I have problem with the setInterval function. I have a game application that sets a time limit of 3 minutes. From 3 minutes counting down by 1 second up to zero. The problem is, the counting of the timer is by 2 seconds and sometimes by 4 seconds. I tested the movie in my local computer and looks fine but when I upload it to a server and it is embeded in a website. And by the time the user clicks the link to play the game application and starts playing the problem about the timer occurs.

View 6 Replies

ActionScript 3.0 :: Calling MovieClips Function For Interactive Video Game

Mar 13, 2010

I'm Currently creating an interactive video game. There are 66 movies. I'm new to AS3 and have a little experience with AS2. I will try to explain the game! You choose from 5 ingredients, each has this product provides a number of calories:

Rice R = <- standard value!
Mais =-C
Roots =-W
Tofu =-T
Onions =-U
Champions =-M
Each ingredient can be added only 1 once.

Good combinations:
R-U-T-CR-U-C-TR-T-U-CR-T-U-CR-C-U-TR-C-T-U
Each movie is in a movie clip. And the frame where the movieclip is on, is labeled with the combination. For this I wrote the following script:

ActionScript 3 Code:
stop ();
var caloriesVar: Number = 10, / / default Rice
var inpanVar: String = "R", / / R = Rice
iLabel.info_txt.text = (caloriesVar);
iLabel.info_txt2.text = (inpanVar) / / idem
[Code] .....

But this does not work. When you click a button, the script doesn't do anything. Do not know where it goes wrong because he does not update the text fields.

View 2 Replies

ActionScript 2.0 :: Global Variable - Enable / Disable Function Within Game

Oct 23, 2004

I have a button that I would like to enable and disable a function within my game. The button is called "flashBang". I'm thinking this may need to be done with global variables to make the switch do this procedure. How would I go about scripting this variable? Also I want to be able to target this function during gameplay, if this function is enabled do this line of code - _root.gotoAndPlay("flash");

The code needs to fit somewhere in here i guess.
//hitTest top + bottom wall
if (_root.ball.hitTest(_root.topwall) or _root.ball.hitTest(
_root.bottomwall)) {
_root.yspeed = -_root.yspeed;
_root.audio.gotoAndPlay("flash_bang");

View 3 Replies







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