The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.38 / 5.00 36,385 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.07 / 5.00 13,902 Viewswell if it was written for As3 then im fine thank you
im using AS3 so u know would any of that be different from AS2 to AS3?
alright so for this time i havnt been working with classes and packages and now that ive read more about them i think ima start seeing what i can do with the...now just a few questions about them that i couldnt really find absolute answers about them....
now i understand that a class it able to hold lots of informations and such but now god honestly how to i call upon them to use them in my source file? like do i call on the function within the class? or can they only b correlated to objects in my source file?
idk just some steady handed guidance about this to me would b great.
alright so basicly this is my code
now what im going for a by pressing the P key i can stop my functions from working...HOWEVER it pops up with a
"
incorrect number of arguments expected 1 - checkKeysDown
incorrect number of arguments expected 1 - checkKeysUp
incorrect number of arguments expected 1 - movement
"
var jumping:Boolean=false;
var leftKeyDown:Boolean=false;
var rightKeyDown:Boolean=false;
var running:Boolean=false;
var sneaking:Boolean=false;
var walking:Boolean=false;
var idle:Boolean=true;
var pause:Boolean=false;
var speed=0;
var sneak=1;
var walk=5;
var run=15;
if (!pause) {
checkKeysDown();
checkKeysUp();
movement();
}
stage.addEventListener(KeyboardEvent.KEY_DOWN, checkKeysDown);
function checkKeysDown(event:KeyboardEvent):void {
if (event.keyCode==80){
pause=true;
}
if (event.keyCode==87) {
jumping=true;
} else if (event.keyCode==16) {
running=true;
} else if (event.keyCode==65) {
leftKeyDown=true;
walking=true;
} else if (event.keyCode==68) {
rightKeyDown=true;
walking=true;
} else if (event.keyCode==83) {
sneaking=true;
} else {
idle=true;
}
}
stage.addEventListener(KeyboardEvent.KEY_UP, checkKeysUp);
function checkKeysUp(event:KeyboardEvent):void {
if (event.keyCode==87) {
jumping=false;
} else if (event.keyCode==16) {
running=false;
} else if (event.keyCode==65) {
leftKeyDown=false;
walking=false;
} else if (event.keyCode==68) {
rightKeyDown=false;
walking=false;
} else if (event.keyCode==83) {
sneaking=false;
} else {
idle=false;
}
}
player.addEventListener(Event.ENTER_FRAME, movement);
function movement(event:Event):void {
if (leftKeyDown) {
player.x-=speed;
player.scaleX=-1;
}
if (rightKeyDown) {
player.x+=speed;
player.scaleX=+1;
}
if (jumping) {
this.player.gotoAndStop(5);
} else if (running) {
speed=run;
this.player.gotoAndStop(4);
} else if (sneaking) {
speed=sneak;
this.player.gotoAndStop(2);
} else if (walking) {
speed=walk;
this.player.gotoAndStop(3);
} else if (idle) {
speed=walk;
this.player.gotoAndStop(1);
}
}
now i tried that and the other way and i came up with the same error both ways it said
incorrect number of arguments expecting 1
and it said that for each of my funtions
alright so i need to make my game able to pause so how can i stop my functions from running?
like someone proposed
if (!paused){funtion()}}
and idk or see how thos lil line of code can stop by functions -_-
lolz alright i got it xD ill keep my achievements to myself
okay 1st idk how my profile has anything to do with this...
and second i did it in AS3 but i coulda swore AS2 is easier to use than AS3?
and i really am proud of it xD
Alright i am absolutely so proud of getting my player to move in the right direction and sneak walk and run when commanded xD
enjoy i know its just a Dot but hey tomorrow after school it will be an animated character
yeah i tried that exactly before you posted that and this is what i came up with
var speed:Number=0;
var walk:Number=1;
var sneak:Number=1;
var run:Number=20;
var jumping:Boolean=false;
var stance:Boolean=false;
stage.addEventListener(KeyboardEvent.KEY_DOWN, myKeyDown);
function myKeyDown(e:KeyboardEvent):void {
if (e.keyCode==65) {
my_mc.x-=speed;
}
if (e.keyCode==68) {
my_mc.x+=speed;
}
if (e.keyCode==16) {
speed=run;
} else {
speed=walk;
}
if (e.keyCode==83) {
speed=sneak;
} else {
speed=walk;
}
}
alright so i hate to post yet another forum xD but hellz i needz some help
now i have a character setup to move with the WASD keys i defined a few variables
walkSpeed = 5
runSpeed = 10
sneakSpeed = 3
now i am trying to make it so that u can walk with just A & D and that works perfectly
now i want to be able to hold Shift and then hit either A or D to RUN
and then i want to b able to hole S and then hit either A or D to sneak
so im pretty sure its just something as simple as telling it it that if Both keys are down then to do what i want but i just dont know how to code multiple keys into an action
yeah i was going to "highlight" hallways and door ways that will b accesible with the action key. as well as when u want to go back to a previous "level" a small portion of the surounding doorway / hallways will alpha in but only enough to notice it.
but the main thing that im worries about is if the other layers are invisible with they b active to the user even while invisible or do i have to point out that they are inacctive in the Varriable n such?
umm ive never seen any flash game or animation that suports right clicking...like if you want the camera to say zoom in on a character or something or zoom out i figure you would either make a slider for it on the User Interface of you movie or just bind a Vcam to some buttons on the keyboard and tell it...ifZkeydown Zoom+=150% or something along those lines
alright...so here is my newest question to add a spin into my game...
now say ur the Main Character and its a 2D platforming view and you walking in a tight hallway...
now you come to an opening in the hallway that leads to another hallway...and when u get to that new hallway entrance u press say UP on you key board to go down it to the next parrellel hallway with the first hallway...
is there a way in flash to tell your current "level" area that you want to go from that area to another area say behind it and make the front one "Innactive"?
so i was thinking about this and i think they way i would think it would be done is by setting true and false statments for each hallway and then have Hallway1 b true onEnterFrame and hallway2 be false onEnterFrame and then when u get to the designated area that will allow you to switch the statments vice versa thus through the previous statements allowing one to become innactive and Alpha out while the other alphas in and becomes active for the user?
correct me if im wrong or right on the ball please
thank you for the help and i think i may have found a way for my character animations to work now
simply by placing some animation names where they go and setting up which animation names should b playing when i hit certain keys
not really awesome...thats actually bad...cuz its pretty much the exact oposite on what i want it to do
yeah as i stared at it moving some more i realised that i need his arm placements to switch on every frame and i noticed that i need to double the frames and then smooth the inbetween ones
but im just having trouble Programing it...
like i can get it to move with the Arrows and the WASD keys i just cant get it to recognize if the Right key is down then it should play the walking portion and etc like that
i did that and now when i hit the right key it doesnt start playing the walking portion until i let go and it keeps playing it until i hit the right key but then starts back up again once i release the key again
alright so i have my character programed to where he moves with the WASD keys and the Arrows now how can exactly tell it to goto and play the walking portion within the MC that is the main character?
like ive been putting
if (rightKeyDown) { gotoandPlay(3:this.hero)}
and it refects this code
im actually not puting shoes on him since his legs r kinda just nubs xD but ive actually finished his arms and his sword that he carries
sorry i forgot the link
Hey let me know what you think...this is a Walking animations test for a Main Character in a game i am designing
yeah ive been reading through and following a few tutorials on AS3 and i can see how AS3 can be Neater since you wont lose track of your code withing the entire file and such but now i know this is probably a scrub of a question but
can i set say all of my Main Character AS on one AS layer and then say all of my "Level" AS on another AS layer so that i myself can keep track of this? or no?
and now this tutorial im following is using a lvlarray to make the platform level? do you guyz suggest this method to or just create the entire level myself and use Vcam linked to the MC and thus move around the entire level?
ever mind i found an answer to that previous post xD
...okay thats bad programming? but now doesnt Vcam not work in AS3? cuz isnt that vital for camera movements in Platform games?
well idk about AS3 cuz like ive messed around with it and i cant apply AS directly to Movie clips in it and in a Flash game isnt that what you really do need?
yeah it was Vcam and i think there is a Vcam that is compatable with AS3 and like i said thats just an i think
cuz as far as i know everyone still just uses AS2 for flash games n such
you will notice that alot of people will do that on NG...
but the Tut's on NG are actually up to date very well like the main thing you wanna concern yourself with is whether you wanna work with Action Script 2.0 or 3.0 its up to you
haha yeah i have trouble with art myself but once i find a nice idea that my mind can concentrate on i just cant stop drawing
but my huge weak point is sound -_-
yeah i get what u mean by its all been done before but i totally agree with CrazyChihuahua because people are always coming out with newer better ways to make already existing genre's even better
and overall as an "Animator, Programer, Designer ETC" its your job to put ur spin/twist onto already existing ideas. like honestly ive always wanted to see a star fighter RTS game where you have free control and movement of your HQ / Starship