Making A Game: Help Needed :P
first thing, I wanted to make my game like supermario, (well, only where if i jump on my enemys head they die), Would hittest do the trick for that problem? Also,then I started to mix my game with madness interactive. How do I make it so that my characters hand follows my mouse, but dosent leave the body? kinda confsing
KirupaForum > Flash > Game/AI Programming
Posted on: 10-06-2006, 08:08 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Help Needed With A Game I Am Making--Its About HitTest/duplicateMovieClip
Hello...
I'm making a game with lots and lots of the same movie clips and I don't want to give thousands of items the same actionscript. So logically I thought I should use actions on frames (makes sense...to me at least) but when I used that, nothing happened. can anyone explain what went wrong/how to fix it? I only need a little help. Heres the description:
I have a guy that when he hits a coin, the coin needs to disappear (I will use removeMovieClip later, but for now I want this) and change the dynamic text box to +1. The var name for the text box is "_root.money". The instance name of the coin(s) is "coin_mc". I put this code on the frame:
money = 00;
if (_root.guy.hitTest (_root.coin_mc)) {
_root.money++;
_root.coin_mc._x = -50;
_root.coin_mc._y = -50;
}
I know changing the x & y is "cheating", but this is temporary. thank you for helping if you reply. Posting your name/answer to my problem will earn you a place in the credits of the game!!!! (if it works)
PS-- I am currently toying with the code to get it to work.
AS Help Needed In Game(i Will Give Credit In Game If You Help)
ok so basicly this is my game so far
23.swf
my probelm is that i want to make my charcter a flame and the tips of his head will move depending on the direction you are going.
So here is basicly this what its like
Moving left-Flames bend to right
Moving left and down-Flames bend at an angle between the left and down
Moving Down-Shorter Flames
Moving Up-Stretched Flames
etc...
ill put borders on after i get the flames down
Help Needed For My Fun Game
ok this may sound a bit weird but can u help..
i have a pink bar on screen and a hand.
i want to press two key simutateously to move the hand up and down the bar which will gradually move a progress bar to the top and the player wins...
also i want a powerbar showing how fast the keys are getting pressed (i have a small gradient box yellow to red, red = fastest) if u know what i mean
also, if the keys stop getting pressed then the hand falls to the bottom of the bar
please help
Game Help Needed?
Does anyone know ehere i can find a good sample or tutorial on how to make a pool game? Please help ME!?
Help With Name Game Needed
Hi,
I am trying to make a simple game that does this:
There is an input box called firstname. Next to it there is an enter button and when they click it it shows them their new name. This is the way it is now, but its not working:
On the frame that has the enter button in it I have this code:
Code:
//These are defined arrays of different "nicknames"
_root["a"] = ["Awesome","Annoying","A-word-here"];
_root["b"] = ["Behemoth","Boring","Big"];
//And so on...
function changeName(s){//create a function for your cause
s2 = _root[s.substr(0,1).toLowerCase()];//get the array to open
r = random(s2.length);//Choose a random nickname number
_root.outputbox = s2[r]+s; // Take the nickname number from the array and add it onto the string
}
On the enter button itself I have this code:
Code:
on (release) {
gotoandplay(123);
changeName(_root.firstname);//name of input text box
}
On frame 123 I have a some animations that play, then the dynamic text box for the output is at frame 196, but it doesn't display anything.
Does anyone know what I am doing wrong?
Thanks, Matt
Im Making A Game (hopefully)
hello peeps, i need to know how to make a game like...uh, itl be in space k? and ur in a spaceship (the mouse is a spaceship) , i need to know what it is that i have to do to make it so when a big astroid comes along and if i touch it i die! but i dont wanna know how to make the dumb rollover button thing, iv already tried that a bunch of times and ppl just cheat by clicking the mouse! i also wanna know how to make it so when u click it shoots, and when the bullit or whatever hits the badguy he dies! im not asking that some1 goes and tells me how to do all these things! thatd be too hard! i just wanna know where i can find an fla. , code, turourial or SOMETHING that will help me....thanks
Making A Game
I've figured out how to move my ship using the arrow keys, but how do I make Actionscript play a missle movie clip when the user presses the Space key? I've tried attach movie but I cannot set the any x y position values.
My Question:
How do I make my ship shoot a fireball when the user presses Spacebar?
Making A Game..... Help Pls
Hey,
I'm currently in the process of making a game...
Its a mix of "Jumanjai..... or however u spell it... that movie that makes stuff come to life with the game... u know..." and... "monopoly"... I have my dice randomizing....
My game board created......
and now i need to add the "Jumanjai effect"... with randomizing questions in the center....
Whats the best way to go about doing this?
I want it to pop up after the dice have rolled....
and the variable name for the Dynamic box i want it to pop up in....
is... "questionfield"
help pls...
Thanks,
-BriceH
Attached: The .fla of my movie in .zip...
Making A Game.. Help?
Hey,
I'm currently in the process of making a game...
Its a mix of "Jumanjai..... or however u spell it... that movie that makes stuff come to life with the game... u know..." and... "monopoly"... I have my dice randomizing....
My game board created......
and now i need to add the "Jumanjai effect"... with randomizing questions in the center....
Whats the best way to go about doing this?
I want it to pop up after the dice have rolled....
and the variable name for the Dynamic box i want it to pop up in....
is... "questionfield"
help pls...
Thanks,
-BriceH
Attached: The .fla of my movie in .zip...
Im Making Car Game.....
I need a script, when my car goes in to my movie clip it he goes to other frame....
.....can you help me
Making A Game
I am making a game on flash mx 2004.
I have a movie clip that you can move left,right,up, and down
how do I make it so the movie clip doesn't go outside the edges of the background?
thanks
Help Making A Game
Hi,
I would like to make a basketball game similar to this one:
http://www.colorpilot.com/basketball.html
I was wondering if someone could provide me with some details on where to start and how to go about it. I am using Flash MX 2004.
Thanks.
Making A FPS Game
Hi! I´m making a fps(first person shooting) game on flash MX and my only problem is:
1.how to do it?
2.I don´t just got it...I know how to use flash and scripting....I have done many platform games etc. but this...
COULD ANYONE HELP? IS IT EVEN POSSIBLE TO DO FPS GAME ON FLASH? IF ANYONE KNOWS HOW TO DO IT, GIVE ME A LINK OR AN EXAMPLE...!!! I REALLY WANT TO DO IT....BUT I DON´T JUST KNOW HOW TO DO THE FPS ENGINE?!
and I don´t mean a stand - shoot - game...I mean...like DOOM...you can MOVE!!! I don´t want to make a game, where you are clicking a mouse...I wanna make a fps game, where you are moving using KEYS!!!
Help On Making A Game.
Sorry about the lame subject,
what i am trying to do is make my frame change when my man touchs
the exit. Could somebody help me do this?
Thank you in advance!
I am using flash MX
Game In The Making
I am currently attempting to make my first game. It is a spoof on the Gran Theft Auto series and I need help.
I was wondering if someone could give me some very simple actrionscript codes for the following:
Character movement
how to make cars that you can highjack drive in the street randomly
the ability to highjack a car
thanks for the help
I Am Making A Game... :D
Hello,
I'm making a game. In this game you hit the enemy and that makes him lose life. I would just like to now how you can show the difference between the life variable before and after the enemy gets hit. Here's the script:
The enemy's life : r = 50
Random damage when the enemy is hit : _root.r = _root.r-random(10)-5;
Do you know how it can show(on the screen) how much damage is caused?
Making My First Game
i need help at making my first game. I don't know any thing about action script but i can manover around the program pretty good and i know how to import video and music. so the object of the game is to protect a cat (Im ganna import the video of my cat) from little stick men or monsters. how you kill them is by clicking on them a certent amount of time and at the end of each level you can by items like up attack and cat health and a boss at the end of each level. and theres a score counter. so who ever can help me make this it will be greatly appreciated. THANX
[F8] Making A Game?
hey everyone!
im pretty new to using actionscript (2.0) and was wondering if anyone could help! Basically i'm trying to make a game that involves swapping adjacent tiles to make a set - like the game bejewelled.
How would i go about making the tiles swap when they are both clicked on??
thanks in advance to anyone offer any tips!
Making A Game
I'm not really great at Actionscript and I need help to make a game of some sort for a group of kids aged around 7-12. Anyone wanna help me?
First Try At Making A Game
Hey all
I'm currently working on my first attempt at making a game.
It's supposed to be a interrogation-game.
This is how it's supposed to work:
You find yourself in a interrogationroom. The police ask you questions about a murder.
For each question you will have a choice between different answers.
At the end, depending on how you answered you will either be deemed innocent or guilty.
I was thinking of using variables.
For example:
Question 1:
Do you like apples?
Answer a: Yes. (+1 at the main variable)
Answer b: No. (-1)
The problem is that I don't know how to use variables. The methods I've tried does not seem to work.
Can anyone be kind enough to be willing to help?
Thanks.
Making A Game
Hey!
I have done some games in other language before like, C#, C++/C, Visual Basic.
The most resently game i did was a Client Server application in C#, the problem with this is that the players have to donwload the game and then run it them selfs, and in some cases thay even have to get the framework of .net.
I want to have a page that the players logon to and then starts to chat, play and build teams right away.
This game needs to be a interactive application in a browser, so it simes like there is two language to choose from, Java och Flash MX.
I will not use Java, its hard to get a good design in it.
this leves me with Flash MX. I have lookt att the program, but i cant find how to realy program a game in it, but if i would do a wild gess i think that Action Script is the way to go?
The Flash MX program dont simes hard, but i think i will need some information on the Action Script, maby you could sugest some good "get started" articles or maby some good book, or best of all Action Scripts for programmers(not beginners)
//Jimmy
Help Making A Game
I'm making a game. It works pretty well. Problem is that I want to create more levels. The variables (my life, health, score) don't carry over to a new frame however. I don't know how to fix it.
Help With Making A Game
I am making a game that is basicallly snake. I want it to act just like snake, only haing different things for the food and the snake. I had the entire code working, and then i added other frames and buttons. i have a main page, with a link to the game and one to the instructions. The instructions is a 3-page long set, and have "next" buttons connecting them. then i play the game. I have a couple of problems. I play it the first time, and it does not distribute the food the way that it is supposed to. There is no food on the screen. The screen is also off-set from the stage where i created it, and the boundaries have changed, so not all of the screen shows the boundaries and what-not. The next problem that i have is that after i get to the end, i click the "Play again" button, and it goes to the beginning. Then i go and try to play again, and it comes up with the screen, but nothing else. What did i do wrong with the code/how do i fix it? the codes are attached. The other questoion that i ahve is one about attaching sound. After the snake takes the food, iw ant a chomping sound. I have it and everything. I am wondering if i initialize the sound and then put it in as a seperate init() code after he takes the food, or just initialize it at the end, and have it make the sound when he bites it
Thank you in advance for helping me
Sincerely yours,
Confused AS Coder
Attach Code
Front Frame:
stop();
Play.onRelease = function() {
_root.gotoAndStop("Game");
};
// end play code
Instructions.onRelease = function() {
_root.gotoAndStop("Instructions");
};
// end instructions code
Main Code:
blockSize = 40; // the block width/height in number of pixels
gameHeight = 15; // the game height in number of blocks
gameWidth = 15; // the game width in number of blocks
SNAKE_BLOCK = 1; // holds the number used to mark snake blocks in the map
keyListener = new Object(); // key listener
keyListener.onKeyDown = function() {
var keyCode = Key.getCode(); // get key code
if (keyCode > 36 && keyCode < 41) { // arrow keys pressed (37 = left, 38 = up, 39 = right, 40 = down)...
if (game.onEnterFrame != undefined) { // only allow moves if the game is running, and is not paused
if (keyCode-37 != turnQueue[0]) { // ...and it's different from the last key pressed
turnQueue.unshift(keyCode-37); // save the key (or rather direction) in the turnQueue
}
}
} else if (keyCode == 32) { // start the game if it's not started (32 = SPACE)
if (!gameRunning) {
startGame();
}
} else if (keyCode == 80) { // pause/unpause (80 = 'P')
if (gameRunning) {
if (game.onEnterFrame) { // pause
delete game.onEnterFrame; // remove main loop
textMC.gotoAndStop("paused");
} else { // exit pause mode
game.onEnterFrame = main; // start main loop
textMC.gotoAndStop("hide");
}
}
}
};
Key.addListener(keyListener);
mouseListener = new Object();
mouseListener.onMouseDown = function() {
if (!gameRunning) { // we want to be able to start the game by clicking
startGame();
}
};
Mouse.addListener(mouseListener);
function startGame() {
x = int(gameWidth/2); // x start position in the middle
y = gameHeight-2; // y start position near the bottom
xVelocity = [-1, 0, 1, 0]; // x velocity when moving left, up, right, down
yVelocity = [0, -1, 0, 1]; // y velocity when moving left, up, right, down
map = new Array(); // create an array to store food and snake
for (var n=0;n<gameWidth;n++) { // make map a 2 dimensional array
map[n] = new Array();
}
turnQueue = new Array(); // a queue to store key presses (so that x number of key presses during one frame are spread over x number of frames)
game.createEmptyMovieClip("food", 1); // create MC to store the food
game.createEmptyMovieClip("s", 2); // create MC to store the snake
scoreTextField.text = "Score: 0"; // type out score info
foodCounter = 0; // keeps track of the number of food movie clips
snakeBlockCounter = 0; // keeps track of the snake blocks, increased on every frame
currentDirection = 1; // holds the direction of movement (0 = left, 1 = up, 2 = right, 3 = down)
snakeEraseCounter = -1; // increased on every frame, erases the snake tail (setting this to -3 will result in a 3 block long snake at the beginning)
score = 0; // keeps track of the score
placeFood("new"); // place a new food block
textMC.gotoAndStop("hide"); // make sure no text is visible (like "game over ")
game.onEnterFrame = main; // start the main loop
gameRunning = true; // flag telling if the game is running. If true it does not necessarily mean that main is called (the game could be paused)
}
function main() { // called on every frame if the game is running and it's not paused
if (turnQueue.length > 0) { // if we have a turn to perform...
var dir = turnQueue.pop(); // ...pick the next turn in the queue...
if (dir % 2 != currentDirection % 2) { // not a 180 degree turn (annoying to be able to turn into the snake with one key press)
currentDirection = dir; // change current direction to the new value
}
}
x += xVelocity[currentDirection]; // move the snake position in x
y += yVelocity[currentDirection]; // move the snake position in y
if (map[x][y] != SNAKE_BLOCK && x > -1 && x < gameWidth && y > -1 && y < gameHeight) { // make sure we are not hitting the snake or leaving the game area
game.s.attachMovie("snakeMC", snakeBlockCounter, snakeBlockCounter, {_x: x*blockSize, _y: y*blockSize}); // attach a snake block movie clip
snakeBlockCounter++; // increase the snake counter
if (typeof(map[x][y]) == "movieclip") { // if it's a not a vacant block then there is a food block on the position
score += 10; // add points to score
scoreTextField.text = "Score: " + score; // type out score info
snakeEraseCounter -= 2; // make the snake not remove the tail for five loops
placeFood(map[x][y]); // place the food movie clip which is referenced in the map map[x][y]
}
map[x][y] = SNAKE_BLOCK; // set current position to occupied
var tailMC = game.s[snakeEraseCounter]; // get "last" MC according to snakeEraseCounter (may not exist)
if (tailMC) { // if the snake block exists
delete map[tailMC._x/blockSize][tailMC._y/blockSize]; // delete the value in the array m
tailMC.removeMovieClip(); // delete the MC
}
snakeEraseCounter++; // increase erase snake counter
} else { // GAME OVER if it is on a snake block or outside of the map
gameOver();
}
}
function gameOver() {
_root.gotoAndStop("End")
} //end game over code
Instructions page 1:
stop();
Next.onRelease = function(){
_root.gotoAndStop("Instructions2")
} // end next code
Instructions page 2:
Next.onRelease = function(){
_root.gotoAndStop("Instructions3")
} //end next code
Instructions page 3:
Play.onRelease = function(){
_root.gotoAndStop("Game")
} //end play code
game over frame:
PlayAgain.onRelease = function() {
_root.gotoAndStop("Start");
};
//end play again code
Send Score button:
on (release) {
getURL("http://www.net-petz.com/reg/GAMENAME.php", "_self", "POST");
}
Help Me (making A Game)
I want to make a game where the character is on bottom of the screen and can move left and right (with the respective arrow keys) while things from fall down from the top of the game randomly. I would like it so when the character collides with certain items falling from the sky, it gains points. While if it collides with other items, it loses lives. I have gotten the character to move but then in moves everything in the window, not just the character. If anyone has a way to make just the character move, could you please tell me. I also need a way to make things fall randomly from the sky... I couldn't find anything in the tutorials. I need help... this is my first game.
Making A Game
Hi i just wanted to know how to make sertain games give me sertain points and like buying something that cost x points decreseas my points by x thanx if you made a source send to me please
Im Making A Game And I Need Some Help
Hi i am now trying to make a complete rpg game i have already made some games but i am trying to make a very complete game.
On the begining of my game i though it would be nice to put a name on the character so there will be a box where you type your name and you press a button that says ok and it transferes the name to the character by this action script:on (release) {
_parent.textBox2.text = _parent.textBox.text;
_parent.scroll2._visible = (_parent.textBox2.maxscroll > 1);
}
is this action script ok or there are better ways on doing that?
So i want my character to move and im putting it this action script: onClipEvent (load) { moveSpeed = 10;}onClipEvent (enterFrame) { if (Key.isDown(Key.RIGHT)) { this._x += moveSpeed; } else if (Key.isDown(Key.UP)) { this._y -= 0; } else if (Key.isDown(Key.DOWN) && !fall) { this._y += 0; } else if (Key.isDown(Key.LEFT)) { this._x -= moveSpeed; }}onClipEvent (enterFrame) { if (Key.isDown(Key.SPACE) && !jumping) { vel_y = 36; jumping = true; } if (jumping == true) { vel_y -= 2; if (vel_y<=-15) { vel_y = -15; } this._y -= vel_y; } if (_root.ground.hitTest(this._x, this._y+35, true)) { vel_y = 0; jumping = false; }}onClipEvent (enterFrame) { this._y += 16; if (_root.ground.hitTest(this._x, this._y+1, true)) { this._y -= 16; }}
And i want my background to move too so i will put this action script:onClipEvent (load) {
movespeed = 7;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_x-= movespeed;
}
if (Key.isDown(Key.LEFT)) {
_x+= movespeed;
}
}
After that i would like to have some enemies that move and attack me so if my character would have 50 HP the enemy takes me off 1HP and if i get to 0 die, how would the action script be?
After that i would like to attack to the monster, i need an action script for that.
i would also like the enemy to drop a coin and put it on an itemslot( i tried alredy but i just can't understand it)
I also wanted to do this: if you step on a certain place you would go to another screen.
I would like to have a store where i can buy stuff and when i buy something the store takes the money the item costed and that item appears on some of my itemslots
Thanx guys sorry if it sounds like i want you to do all work but i been trying to find tutorials and the one on kirupa is horrible.
Thanx for the answers!!!!
Help Me (making A Game)
I want to make a game where the character is on bottom of the screen and can move left and right (with the respective arrow keys) while things from fall down from the top of the game randomly. I would like it so when the character collides with certain items falling from the sky, it gains points. While if it collides with other items, it loses lives. I have gotten the character to move but then in moves everything in the window, not just the character. If anyone has a way to make just the character move, could you please tell me. I also need a way to make things fall randomly from the sky... I couldn't find anything in the tutorials. I need help... this is my first game.
Making A Game
This is the game that I am trying to create.
http://blaklyon.emeraldtokyo.com/GSSFL.htm Can anyone give me the action scripting codes to get this working right?
Help Making A Game
Lets start from the begining. I Guess As I create the componets that build the game, we can move to the next challanges!
How do you make a cool life bar ?
I got a Idea of how to make a standard life bar but, how do you make a cool looking one, like the one shown here?
http://blaklyon.emeraldtokyo.com/GSSFL.htm
Making A Game.
Alright... I have an independant quarter project to do for school. I am making a single-player, side-scrolling, third-person 2D shooter.
I have gotten a character who moves, jumps, and shoots. Also have boundaries that prevent him from falling through the floor or running through walls or something similar.
How would I be able to make it so when the bullet hits the enemy, the enemy dies (or does an action to show it was hit). Both the bullet and enemy are movie clips. Heard something about using a hit test. Can anyone explain?
Also, if anyone knows of any places I can go to find more information on this sort of thing (making characters shoot, better actions, boundaries, side-scrolling, etc), I would appreciate a link or two. =)
Thanks.
Help Needed For Flash Game
i'm doing a game for uni, the focus being on actionscripting. Its a remake of teh game which has loads of blocks and a Bar at the bottom slides left and right and hits a ball.
everything is fine, but can i need flash to know when the last block has been hit!
is there a way to tell flash to move to another frame when a certain amount of objects appear in the one spot?
Pong Game Fla Needed
If any one has an FLA file for a simple pong game I REALLY REALLY need one for the coding.
Thanks for any help u can give me.
TiMo
Yet Again More Actionscript Help Needed W/ Game.
FLA:
http://cp1.myhostdns.org/~hellfusi/u...uraengine4.fla
===========
This is a action game I've been working on for a few weeks now with the help/advice of many from the Flashkit community: JTNX, ihoss, Marmotte, etc you guys know who you all are!
I'm still working on it and at a stump again because I can't figure out how to accomplish some things in my game right now so I'm here again asking for help.
Things I don't know how to do and want to find tutorials for:
- Teleport: Being able to have my character walk to the next screen when he approaches and exit or wants to walk towards the next room, for example.
- Spells: You might notice that animated tornado. Yep... I want to have enemies cast magic basically. The tornado would just move towards the middle point of the stage and go back. I'm also curious to figure out how to make something appear around the enemy to signify that he/she/it is casting a spell. Would you place an object, set the x-y coordinates to the enemy object? How would this be accomplished?
- Points: Being able to pick up a simple object on the ground that accumulates into the points box above.
As always, help is greatly appreciated. Thanks again.
Problem With Game - Help Needed
I'm currenlty developing a game and working on the code at the moment for all the different parts beforew I do most of the graphics. Heres what I have so far:
http://logicaloption.com/mckenna/g.htm
I have Level 1 and 2 working okay but when I get to level 3 (30 points) the new Nets no longer appear on the screen I don't want to post the .fla file here but I will expalin the main bits of code below:
Each Level in the game goes to the next frame and each next frame has another net on it. It progresses to each level with the following code:
Code:
onClipEvent (enterFrame) {
if (_root.score >= 20) {
_root.gotoAndStop("level02");
}
}
onClipEvent (enterFrame) {
if (_root.score >= 30) {
_root.gotoAndStop("level03");
}
}
onClipEvent (enterFrame) {
if (_root.score >= 40) {
_root.gotoAndStop("level04");
}
}
etc.
then each Net has this code applied:
Code:
onClipEvent (load) {
dx = Math.random()*5-2;
// set the initial momentum of the net
dy = Math.random()*5-2;
}
onClipEvent (enterFrame) {
_x += dx;
// Move the ball along dx and dy
_y += dy;
if (_x<25) {
_x = 25;
// move it back on screen
dx *= -1;
// reverse the horizontal momentum
} else if (_x>494) {
_x = 494;
// move it back on screen
dx *= -1;
// reverse the horizontal momentum
}
if (_y<25) {
_y = 25;
// move it back on screen
dy *= -1;
// reverse the vertical momentum
} else if (_y>205) {
_y = 205;
// move it back on screen
dy *= -1;
// reverse the vertical momentum
}
}
onClipEvent (load) {
function reset1() {
this._x = -90;
this._y = 0;
}
}
onClipEvent (load) {
if (this.hitTest(_root.character)) {
reset1();
}
}
Although when I get to level 3 the nets dont seem to appear and then once I go into the top left corner it triggers the goto game over frame. Any ideas what could be causing this to not work?
ActionScript Needed For A Game
Hello, i am going to make a game where your mouse is a mallet and you smash bunny rabbits. I already have the swinging mallet part down, but i don;t know how to do the bunny rabbits, i want it so they run around the screen and when they get clicked on they splatter everywhere.
Ne help i will greatly appreciate!
F8 - Code Needed Re Mc In Game
Hi,
I have a game with a stage size 600x350. I have the mc moving randomly left to right off the stage then right to left but the problem is it flies too high that the graphic is cut off at times. I would like the code to tell the object not fly higher than 130 pixels from the top of the stage. Any hints/tips would be appreciated (Using Flash 8, Actionscript 2, mc called "bee").
Thank you.
Game Control HELP NEEDED
Hi all!
I need some help from the forum please since I am a newbie!
I have two squares, one_mc and two_mc on the main timeline.
Beneath them I have three dots, a_mc, b_mc and c_mc, which reside on the main timeline as well. I also have on the main timeline an mc called”alphabet_mc” where I have the letters a,b,c under corresponding labels (label a inside alphabet_mc is where letter “a” resides, etc). The letters inside alphabet_mc are bitmap pictures, not textfields.
If the user presses one_mc and a_mc (or a_mc and one_mc)I want the letter “a” to appear at the corresponding label of alphabet_mc. Automaticaly I want the rest of the dots (b,c) to be disabled, since I do not want the user to press a second letter, but the corresponding number (for instance 1a).. However if the user presses two _mc I want the REST OF THE AVAILABLE DOTS of the previously pressed pair (in this case b,c) to be enabled so that the user can chose one of them along with two_mc ( for instance two_mc and b_mc so that b will appear on alphabet_mc).
My problem is that I can not control the disabling of mc’s. How can I control which button the user will press and their outcome?
Also, when I add the same code to two_mc (with some name changes corresponding to two_mc and not to one_mc) the code gets confused. So how do I control the two numbers since they are sharing common letters? Or perhaps, is there a better and easier way of achieving this that my own way?
Your help is so much appreciated, since I am very stuck.
This is the code so far placed on the main timeline:
function pressHandler() {
// disable if the user is already at the required label.
this.gotoAndStop("pressed");
this.enabled = false;
this.useHandCursor = false;
switch (true){
//--1A------------------------
case ( _root.a_mc.enabled == false) && ( _root.one_mc.enabled == false) :
_root.b_mc.enabled = false;
_root.c_mc.enabled = false;
_root.alphabet1_mc.gotoAndStop("a");
break;
//--A1--
case (_root.a_mc.enabled == false) && (_root.b_mc.enabled == true) && (_root.c_mc.enabled == true):
if (_root.one_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.one_mc.enabled = false;
_root.alphabet1_mc.gotoAndStop("a");
}
break;
//--1B-----------------------
case ( _root.one_mc.enabled == false) && ( _root.b_mc.enabled == false):
_root.a_mc.enabled = false;
_root.c_mc.enabled = false;
_root.alphabet1_mc.gotoAndStop("b");
break;
//--B1--
case (_root.a_mc.enabled == true) && (_root.b_mc.enabled == false) && (_root.c_mc.enabled == true):
if (_root.one_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.one_mc.enabled = false;
_root.alphabet1_mc.gotoAndStop("b");
}
break;
//--1C----------------------
case ( _root.one_mc.enabled == false) && ( _root.c_mc.enabled == false):
_root.a_mc.enabled = false;
_root.b_mc.enabled = false;
_root.alphabet1_mc.gotoAndStop("c");
break;
//--C1--
case (_root.a_mc.enabled == true) && (_root.b_mc.enabled == true) && (_root.c_mc.enabled == false):
if (_root.one_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.one_mc.enabled = false;
_root.alphabet1_mc.gotoAndStop("c");
}
break;
//--case "a" pressed ONLY then "b" and "c" enabled.FALSE--
case ( _root.one_mc.enabled == true) && ( _root.a_mc.enabled == false) && ( _root.b_mc.enabled == true) && ( _root.c_mc.enabled == true) :
_root.b_mc.enabled = false;
_root.c_mc.enabled = false;
_root.alphabet1_mc.gotoAndStop(1);
break;
//--case "b" pressed ONLY then "a" and "c" enabled.FALSE--
case ( _root.one_mc.enabled == true) && ( _root.a_mc.enabled == true) && ( _root.b_mc.enabled == false) && ( _root.c_mc.enabled == true) :
_root.a_mc.enabled = false;
_root.c_mc.enabled = false;
_root.alphabet1_mc.gotoAndStop(1);
break;
//--case "c" pressed ONLY then "b" and "a" enabled.FALSE--
case ( _root.one_mc.enabled == true) && ( _root.a_mc.enabled == true) && ( _root.b_mc.enabled == true) && ( _root.c_mc.enabled == false) :
_root.b_mc.enabled = false;
_root.a_mc.enabled = false;
_root.alphabet1_mc.gotoAndStop(1);
break;
}
}
a_mc.onRelease = pressHandler;
one_mc.onRelease = pressHandler;
c_mc.onRelease = pressHandler;
b_mc.onRelease = pressHandler;
//two_mc.onRelease = pressHandler2a;
stop();
Platform Game Help Needed
hi I'm making a platform game and I need to know how can I make him move
and play the running animation and so if he was running left it will stop and
he'll be standing left if hes running right it will stop and he'll be standing right
please help
Help Needed For This Lights Game
i have made an empty mc in the library and i'm putting it on root through scripting.
this empty mc is container for 25 other attached mc's (which can be clicked) which have been attached through script in a grid of 25 squares. these 25 mc's are instances of the same mc in the library. i want to know if there is any method through which i can make
out which mc is clicked and also the names of the adjacent mc ie. top, left, right, and bottom mc's. also i want the adjacent mc's to react to the clicked mc.
i have attached the .fla file(flash mx version)
thanks guys
vinay
Game Programming Help Needed
Hi,
I'm new to these forums just as i am fairly new to Flash Pro 8, anyway i was mid way through creating my first flash game when i encountered this error message...
**Error** Scene=Scene 2, layer=Layer 2, frame=25:Line 2: ')' or ',' expected
gotoAndPlay('scene 2',frame 1);
Total ActionScript Errors: 1 Reported Errors: 1
it asks me to put an ')' or ',' in to the code but i just cant work out where it wans me to put it. Please Help!!!!!
Thank You
Serious Help Needed: Flash Game
hey guys
i've been trying to do this on my own but am not getting anywhere within the time frame i've got.. yea i got a dateline for this lil' project i need serious help with!
i basically am trying to re-create >this game<
but hopefully i can get it to a level of sophistication required by my prof.
so far, i've made the movie symbols as needed, and have successfully gotten the movieclip to follow the mouse around. but it's going everywhere the mouse wants... i need to lock the movement of the mouse on the horizontal axis (x axis) . how do i do that with the actionscript ?
next thing i would have to do is actionscript for randomness of the 'spitting out'.. how do i go about getting started on that ?
hoping someone or some could offer your assistance for this entire project, or im screwed bad.. thanks for reading !
Some SpaceShip Game... Help Needed
Hey, I'm currently working on a project with one of my friends, and am stuck now... I made the spaceship work on the Arrow Keys and stuff..
Hittest, all ok.
But now comes the finish, if I try the hittest with a movie clip to move to 'scene2' it doesnt work:
Normal hittest:
ActionScript Code:
if (!_root.wall.hitTest(_x+x, _y+y, true)) {
_x += x;
_y += y;
} else {
speed *= -.9;
}
Finish hittest:
ActionScript Code:
if (!_root.finish.hitTest(_x+x, _y+y, true)) {
gotoAndPlay ("Scene 2", 1);
}
else {
speed *= -.9;
}
I can't see the problem... Do you?
Please tell me what to do if you know, or anything!
Thanks!
Flash Game Help Needed
Im doing a simple car racing game.
Ive spent hours trying to work out a way of scrolling the terrain/circuit and keeping the car still on the screen. But i cant for the life of me work it out?
The test circuit i made rotates from the wrong place. and dosnt simulate real driving.
Something like http://www.jaildog.com but not as advanced. The movement of the map is what im trying to achive.
ANyone know of a good tutorial that would cover this??
Cheers
Flash Game Help Needed Please
hey, i am making a side scrolling beat-em up game like streets of rage or something like that. I have got the character to be able to kill enemys, lose health when being hit, die and respawn but cant get my head around why when i add in a scrolling background does the character spawn a clone and do odd things like that.
any help would be greatly apreciated
http://www . megafileupload.com/en/file/37016/side-scroller-fla . html
Rpg Making Help Needed For A Newbie
I'm making an Rpg with flash and have alot of the code needed except for the hittest when my little guy runs into walls and the like.
so far i have this which makes him stop if there is a wall to his left, but only to his left ...
guy.onEnterFrame = function(){
if(this.hitTest(wall)==true){
this._x += speed;
}
}
ok i know it's a bit rusty but there has to be an easier way than this to make hittest, it would take me weeks to ad different instance names and y, x coordinates. PLEASE tell me there is another way, if there isn't well ill just have to sit at my computer for days on end adding pointless actionscript.
Help On Making A Shooter Game
I'm begging with something very simple. My characters move, can be shoot, and it displays if you shot the person or not. Now that I have done that, I am so proud as dumb as that is, I'm gonna make more missions to my game. So I wanted to know, how would I make a game were say I had five people on screen and each could be shot. How would I make it so that they can be shot in any order and so that they all have timers for when they shoot at you, and finally a life bar. HOW?!? After I know the answer though I'll wonder how I missed it. :-)
Making A Card Game
I'm making a card game, and I'm randomly giving the player and three computer players cards. The only problem is, I can't figure out how to check in an array if something already exists (so that, for example, player one and three don't both get the three of clubs).
Thanks for your help.
|