PDA

View Full Version : Game controls



daveeed
April 9th, 2002, 10:55 AM
I want to make a game using flash 6...I want tha person who is playing tha game to control a man/woman,this is where i have got stuck.
I have created a character and i want the movement of him/her to be controlled by the cursor keys.
When the game starts tha character will be standing still,when the player presses tha right cursor i want it to load an animation showing tha character walking right.When the cursor is released,i want it to go back to tha standing still movie clip.

I hope this makes sense.....

How do i do this?

thoriphes
April 9th, 2002, 01:14 PM
now instead of moving the dude with frames, why don't you just move him using actionscript. it's fairly simple and easier to control. if you can post your current code, i'll be glad to walk you through it.

daveeed
April 9th, 2002, 04:03 PM
Thats tha problem...I've everything i could think of with actionscript and frames and none of it works!!(im fairly ****e at using actionscript by tha way)....

Tha only other thing i could think of doing was to come on this site and get some help from people who know what they are doing...

I know how to control 'ONE' movieclip using actionscript but thats about it...

cheers in advanced...(hope im not being to cheeky...lol!!)

thoriphes
April 9th, 2002, 05:21 PM
well, i've never made a game in flash (well, i did make a bonk-the-mole game once...), but hell, you have to try new things sometimes, right? anyway, display what you have and i'll try to beef it up a bit.

daveeed
April 10th, 2002, 06:03 AM
This is all i can come up with so far....

onClipEvent (enterFrame) {
&nbsp &nbsp &nbsp &nbsp with (_root.standstill) {
&nbsp &nbsp &nbsp &nbsp }
&nbsp &nbsp &nbsp &nbsp with (_root.walkleft) {
&nbsp &nbsp &nbsp &nbsp }
}
on (keyPress "<Left>") {
&nbsp &nbsp &nbsp &nbsp _root.standstill._visible = false;
&nbsp &nbsp &nbsp &nbsp with (_root.walkleft) {
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp _x -= 10;
&nbsp &nbsp &nbsp &nbsp }
}

As I have said before,im not that good at using actionscript.....

daveeed
April 14th, 2002, 05:51 AM
I suppose no-one knows how to do this then...

boooger!!

ilyaslamasse
April 14th, 2002, 07:06 AM
What are you trying to do exactly ?
pom 0] , not exactly the game master...

daveeed
April 17th, 2002, 06:17 AM
I want to create a game in which the player controls a character with the cursor keys.When the game starts there will be a movie clip of the character standing still,when the player presses the right or left cursor i want a movieclip(which moves aslong as the player presses the right cursor) of the character walking right to load.
When the cursor key has been released,i wnat tha animated right walking movie clip to vanish and the standstill movie clip to appear in the exact place of the other.

Im finding it really hard to explain....

thanks in advanced if u can help...

I am not Jubba
April 17th, 2002, 07:32 AM
well its not that difficult i don't think, but I'm really sure how to do it :) What you have to do is make a MC w/ 2 frames. in frame 1 have the character standing still. in the secondframe have a MC that animates the character moving. And then just use a button to say

on (keyPress "<Right>"){
_root.CharacterDude.gotoAndPlay(2)
}

make sure you have a stop action in the second frame.

As far as holding the button down and have him continue moving, I'm not sure how to do that.