| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
|
I'm working on making a side-scrolling game that has this ninja guy that runs around fighting enemies. I have the moving and background scrolling scripts complete, but I don't know how to make it show his walk animation while he moves, the idle animation while he's not moving, and how to show the sword animation when you hit enter. Any ideas? Thanks
|
|
|
|
|
|
#2 |
|
Meuh? MMeuh!
|
Your controler is on a MC isn't it... If not it should be on it... In that case you can at every frame do an action...
Then you have your dummy... Only put on this dummy Mc all the states it have (up, crouch, walking, sword, and so on ...). Then from the controler, gotoAndPlay() them... I've made this before (and never finish it)... Look for it and send it to you...
__________________
I'm a froggy, so excuse me for my poor english Blog - Dev By MX For any jobs go on my blog on the contact page... Last edited by xxlm; 07-23-2002 at 07:59 AM.. |
|
|
|
|
|
|
|
|
#3 |
|
Meuh? MMeuh!
|
here is the link to the zip file of my old old old dummy
http://www.lagoon.nc/xavier/fight/chunli_zero.zip (1mb) The char is only for the example... Don't forget to look in your controler if your oldstate == the state you want. In that case don't gotoAndplay.yourdummy.("yourstate"); And only do the move function (or else); PS:import the chunli_zero.swf into a enmptyMC Ok? ![]()
__________________
I'm a froggy, so excuse me for my poor english Blog - Dev By MX For any jobs go on my blog on the contact page... Last edited by xxlm; 07-23-2002 at 08:09 AM.. |
|
|
|
|
|
#4 |
|
Registered User
|
Um...? I think I got most of what you said, thanks for the file, I'll check it out.
|
|
|
|
|
|
#5 |
|
Registered User
|
Yeah, I looked that .fla file over and that's exactly what I had done, but what is the actionscript for it? EXAMPLE:
you press control, and it shows the punch animation. I tried this: Code:
if (keyDown(CONTROL)) {
guy.gotoAndPlay(2);
}
|
|
|
|
|
|
#6 |
|
Meuh? MMeuh!
|
In your main scene you have,
A MC called "CONTROLER". Then on it ActionScript Code:
and for your code, it should be ActionScript Code:
Is it what you're looking for ? ![]()
__________________
I'm a froggy, so excuse me for my poor english Blog - Dev By MX For any jobs go on my blog on the contact page... Last edited by xxlm; 07-23-2002 at 03:53 PM.. |
|
|
|
|
|
#7 |
|
Registered User
|
Yes I believe it is...what is the "yourpath" part of this though?
I put in the script you showed for a controller MC and modified it to this: Code:
onClipEvent (enterFrame) {
if (key.isDown(CONTROL)) {
if (_root.state<>"RIGHT") {
_root.guy.gotoAndPlay("jump");
_root.state = "jump";
}
_root.guy._x+=5;
}
}
Last edited by MuRkYsLaYeR; 07-23-2002 at 03:51 PM.. |
|
|
|
|
|
#8 |
|
Meuh? MMeuh!
|
Ok man, i'll explain all the line of the code...
ActionScript Code:
The yourpath is where you dummy is. Look at the dummy you've got in my example... When you play the first frame of a state then it loops... That's why I look in the controler if the state I want is already played... See what I mean ? ![]()
__________________
I'm a froggy, so excuse me for my poor english Blog - Dev By MX For any jobs go on my blog on the contact page... |
|
|
|
|
|
#9 |
|
(@_@) -("pretty lights")
Join Date: Sep 2001
Location: the Netherlands
Posts: 3,988
|
the yourpath refers to your path. Since its not known to us ... lets say your path is _root.myGame.myGuy.Guy; well, that be your path, but since we don't know that ...
did u check _root.state ? Is there a label "jump" in _root.guy ? Are both the guy as the control mc in the same _level ?
__________________
RicoD Link ? |
|
|
|
|
|
#10 |
|
Registered User
|
Alright I have the jump part working now. One problem though, the jump only works the first time I hit control, after that it doesn't work anymore.
here's how I have the "guy" MC set up: =FRAME ONE= standing still -actions- stop(); =FRAMES TWO THRU EIGHT= jumping -actions- on frame eight- gotoAndPlay(1); |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 2 Player Game Question | JayDuck12 | ActionScript 1.0 (and below) | 9 | 04-27-2004 03:41 AM |
| The good ol' "Yugop" side scrolling Menu! | Deadhands | ActionScript 1.0 (and below) | 2 | 12-18-2003 06:04 AM |
| Vertical Scrolling in a Art Based Platform Game | Ninfoxwoods | Gaming and Game Development | 20 | 11-08-2003 11:24 PM |
| question re:continuously scrolling text field tutorial | holdaway | ActionScript 1.0 (and below) | 0 | 08-09-2001 09:16 AM |
| JESSE - QUESTION relative content scrolling | udminc | ActionScript 1.0 (and below) | 4 | 01-16-2001 04:00 PM |