Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Trivia Game And Xml



hello..

i am trying to develop a trivia game that pulls questions & answers from an xml file. i have written some code that will parse the q & a from the xml and load it into a dynamic txt field respectively. now i need to somehow make that function be able to cyle through the xml's list of questions and answers. i am going to track the correct answers with attributes in the xml file so i also need a lil help with that function as well. check out the .fla and xml attached.

any help is greatly appreciatted.
thanks



FlashKit > Flash Help > Flash ActionScript
Posted on: 03-30-2005, 09:11 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Trivia Game
Delete...





























Edited: 01/12/2009 at 08:06:44 AM by Bwargh

Trivia Game
Hi

I have a little problem with my some kind of trivia game. Now there is six questions and where I need help is, when it has asked all the questions, it should go to frame 90. So what I need to change here? Because now it just repeats the questions again, again and again... I know that this is stupid and easy question but I just don't know what to do...









Attach Code

_global.KYSYTYT=new Array();

_global.OIKEATVASTAUKSET=new Array();
_global.OIKEATVASTAUKSET.push(2);
_global.OIKEATVASTAUKSET.push(1);
_global.OIKEATVASTAUKSET.push(1);
_global.OIKEATVASTAUKSET.push(1);
_global.OIKEATVASTAUKSET.push(2);
_global.OIKEATVASTAUKSET.push(3);

_global.KYSYMYSINDEXI=0;
_global.PISTEET=0;
_global.inArray=function(array,value){

for(var i=0;i<array.length;i++){

if(array[i]==value){
return true;
}
}
return false;

}
_global.arvo=function(){

if(_global.KYSYTYT.length==_global.OIKEATVASTAUKSET.length){
_global.KYSYTYT=new Array();
trace("RESETION");

}

var arvo=random(_global.OIKEATVASTAUKSET.length)+1;
while(_global.inArray(_global.KYSYTYT,arvo)){


var arvo=random(_global.OIKEATVASTAUKSET.length)+1;
}
_root.gotoAndplay (90);
_global.KYSYTYT.push(arvo);
trace("Siirryn kysymykseen: "+(arvo));
_global.KYSYMYSINDEXI=arvo-1;
_root.gotoAndPlay("kysymys"+arvo);

}

_global.onkoOikein=function(index:Number){
if(_global.OIKEATVASTAUKSET[_global.KYSYMYSINDEXI]==index){
return true;
}
return false;
}
_global.vastauksenJalkeen=function(tulos){
if(tulos===true){
trace("VASTASIT OIKEIN");
_global.PISTEET++;
}else{
trace("VASTASIT VÄÄRIN");
}
trace("PISTEITÄ NYT: "+_global.PISTEET);
_global.arvo();
}
_global.arvo();

Trivia Game And Xml
hello..

i am trying to develop a trivia game that pulls questions & answers from an xml file. i have written some code that will parse the q & a from the xml and load it into a dynamic txt field respectively. now i need to somehow make that function be able to cyle through the xml's list of questions and answers. i am going to track the correct answers with attributes in the xml file so i also need a lil help with that function as well. check out the .fla and xml attached.

any help is greatly appreciatted.
thanks

Trivia Game And Xml
hello..

i am trying to develop a trivia game that pulls questions & answers from an xml file. i have written some code that will parse the q & a from the xml and load it into a dynamic txt field respectively. now i need to somehow make that function be able to cyle through the xml's list of questions and answers. i am going to track the correct answers with attributes in the xml file so i also need a lil help with that function as well. check out the .fla and xml attached.

any help is greatly appreciatted.
thanks

Scoring In A Trivia Game
I'm putting together a flash trivia game. I want the score to be revealed only after all the questions have been answered. Something like this:
1-5 right, try again
10+ right, good job
15+ you're getting better
20+ you're a master
So, I need some script to remember the score, and keep it hidden, and count the right answers and reveal them at the end.
Can someone help me with this?
I'm kinda new to action scripting

Scoring In A Trivia Game
I'm putting together a flash trivia game. I want the score to be revealed only after all the questions have been answered. Something like this:
1-5 right, try again
10+ right, good job
15+ you're getting better
20+ you're a master
So, I need some script to remember the score, and keep it hidden, and count the right answers and reveal them at the end.
Can someone help me with this?
I'm kinda new to actionscripting
Also, if someone can shoot me some links to beginner tutorials for actionscripting, I'd appreciate it!

Trivia Game Problem
Hello All:

I am having a problem with a little trivia game that I am in the process of developing. What I am trying to do is have flash fade out one wrong answer at a time. All questions are being pulled from an XML file that has hundreds of questions. Keep in mind that the correct answer will not always be in the same spot. I also have it so that one question fades into another after a specific time. Here is the code


Code:
System.useCodepage = true;
//
function loadXML(loaded) {
if (loaded) {
xmlNode = xmlData.firstChild;
answerA = [];
answerB = [];
answerC = [];
question = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
question[i] =
xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
answerA[i] =
xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
answerB[i] =
xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
answerC[i] =
xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
ans_txt.text = "A:";
q_txt.text = "Q:";
}
firstImage();
//veryfirstImage();
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("multiple_trivia.xml");
/////////////////////////////////////
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
desc_txt.text = question[p];
answer_txt.text = answer[p];
slideshow();
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
desc_txt.text = question[p];
answer_txt.text = answer[p];
}
}
function veryfirstImage() {
var randomNum:Number = Math.floor(Math.random(total)*total);
p = randomNum;
if (loaded == filesize) {
desc_txt.text = question[p];
answer_txt.text = answer[p];
slideshow();
picture_num();
}
}
function picture_num() {
current_pos = p+1;
curtxt.text = current_pos+" / "+total; } // minutes = 0; seconds = 59; // var min = minutes; var sec = seconds; delay = 1000;
//-----------------------
var my_fmt:TextFormat = new TextFormat(); my_fmt.bold = true;
//-----------------------
this.onEnterFrame = function() {
if (sec<=36) {
my_fmt.color = 0xFFFF00;
TimeText.setNewTextFormat(my_fmt);
}
if (sec<30) {
TimeText.text = "Time's Up!!!!!!";
answer_txt._alpha = 100;
ans_txt._alpha = 100;
//answer_txt._alpha += 15;
//ans_txt._alpha += 15;
} else {
answer_txt._alpha = 0;
ans_txt._alpha = 0;
}
if (answer_txt._alpha>=15) {
TimeText.text = "";
}
};
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
sec--;
var display_seconds = Math.abs(sec-30);
if (display_seconds<10) {
display_seconds = "0"+display_seconds;
}
if (sec == 0) {
clearInterval(myInterval);
if (min == 0) {
my_fmt.color = 0xFFFFFF;
TimeText.setNewTextFormat(my_fmt);
//-------------------------
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}
sec = seconds;
min = minutes;
}
// Display minutes and
seconds.

TimeText.text = "Time Left: "+min+":"+display_seconds;
}
}
stop();
var spc:Number = 10;
for (i=0; i<4; i++) {
duplicateMovieClip(ans, "ans"+i, i); } this.onEnterFrame = function() {
ans1._y = (desc_txt._y+desc_txt._height)+spc;
ans2._y = (ans1._y+ans1._height)+spc;
ans3._y = (ans2._y+ans2._height)+spc; }; // var intervalId:Number; var count:Number = 0; var maxCount:Number = 3; var hideanswer:Number = 2; var duration:Number = Math.abs(1000*hideanswer); var answer:Array = new Array("wrong", "wrong", "correct"); // function executeCallback(param:String) {
clearInterval(intervalId);
if (count<maxCount) {
count++;
//-------------------------------------------------------
for (i=0; i<3; i++) {
var remove = xmlData.firstChild.childNodes[p].childNodes[i];
ans1.answer_txt.text = "A) "+remove.nodeName
if (remove.nodeName !== answer[2]) {
this.onEnterFrame = function() {
if (this["ans"+i]._alpha>=0) {
this["ans"+i]._alpha -= 25;
}
};

}
}
//-------------------------------------------------------
intervalId = setInterval(this, "executeCallback", duration, answer[count]);
}
}
if (intervalId != null) {
clearInterval(intervalId);
}
intervalId = setInterval(this, "executeCallback", duration, answer[count]); // function firstImage() {
p = 0;
if (loaded == filesize) {
desc_txt.text = question[p];
ans1.answer_txt.text = "A) ";
//ans1.answer_txt.text = "A) "+answerA[p];
ans2.answer_txt.text = "B) "+answerB[p];
ans3.answer_txt.text = "C) "+answerC[p];
slideshow();
findAnswer();
picture_num();
}
}
Here is the XML code:


Code:
<questions>
<question>What Year the Disney world Start?</question>
<correct>1971</correct>
<wrong>1955</wrong>
<wrong>1980</wrong>
</question>
</questions>

Trivia Game Making Lifelines
I am making a trivia type game for my site. I want the user to have 3 life lines. I have a new scene for each question. How could I make it so they could only use one type of lifeline only once during the whole game. Yet have the correct information on a lifeline for that question. And how do I hide a button once sumone clicks on it.

Can I Make A Trivia Game With Flash?
Hey! I am making a project for school, and I have thought about using a Flash program to make a trivia game for my project. Our unit is India, and my chosen project is to make a trivia game to show my knowledge of the country. Can this be done? Also, the only available computers at the school are iMacs running OS X. I have a HP Pavillion VX74 here at home, which is running Windows XP Home Edition. While the project work on both? Thankyou very much in advance.


-Teh Gam3sta

P.S. This is my first post! Partay!

Trivia Game Not Recognizing Commands
I'm building a "Who wants to be a millionaire" type game and I have to use keycodes instead of the mouse for selecting answers, advancing the question, etc. It works perfectly at the beginning....you hit the space bar to move from the "home" screen to the first question. You hit A, B, C or D as your choice of answers and that answer is highlighted. You hit "Enter" to see if you are correct or not.

The problem is that that's where it stops! I would like for you to then hit the space bar and continue to the next question until you get to question 4 where, if you're answer is correct, it's going to play a little movie clip, and if you're wrong, the game will start over. When everything was on the first frame, the space bar worked. I'm thinking that the commands for the space bar need to somehow become a function? When you jump to different frames, it just doesn't recognize the space bar commands anymore? Please help....I have about 1 week to figure this out and get it done! I can send my .fla file to someone if they can help me, but it seems that I can't get it small enough to upload!

Thanks!

Trivia Game: Error While Testing CS3 App In CS4
I have been attempting to test an exercise file for a Trivia Game written in AS3 using the Flash CS3 IDE.
Unfotunately I have been receiving two errors each time its run while using Flash Professional CS4.:
<ol>
<li><strong> 1023: Incompatible override. </strong></li>
<li><strong> 1021: Duplicate function definition.</strong></li>
</ol>

each of these errors occur on the same line:
<ul>
<li> <strong>public function showScore() {</strong></li>
</ul>

Can anyone help? The code and every

What Is The Recommended Method To Make A Trivia Game?
well just like the topic say's i was wondering if any1 can suggest me a good way to make a trivia game though the big question is how shuld i load the questions (with multiple answers) from flash or from txt or from asp?
any1 have recommends?
thanks in advance

Best Approach To Loading Question Data Into Trivia Game
Hello, I've built a trivia game in Flash 8 which I've hardcoded all the questions,answers and catagories into arrays. The file has alot of audio and animation which makes the publishing take a long to complete. I'd like to load the question in from an external file so I don't have republish the game each time new questions are needed. I've looked around and have seen loadVars from a .txt file but I have to reformat all the text that nonalphanumeric. There is also the option of using XML(I don't know XML yet). Can anyone point me in the right direction? Should I dig in and figure out the XML, the loadVars form a text file or is there a better way I'm not aware of yet?

Here is an example of some variable data im using. Usually 20 questions.
catagory[1] = "sports";
question[1] = "What sport does not use a round ball?";
answerA[1] = "Baseball";
answerB[1] = "Golf";
answerC[1] = "Football";
answerD[1] = "Tennis";
theCorrectAnswer[1] = 3;

Thanks,
Padraig

Trivia
Hi all,
And urgent help is needed. I am creating a trivia game. There are ten questions that i'll be asking the user. For every correct question the user gets a point. At the end of the game i display to him what is his score. Now here comes my problem.
At the end of the game, I want to display only the wrong answers to the user and not the correct ones.
I am finding it very hard to store the values and to retrieve those values only which are wrong. If u have any useful link for this game, please do let me know.
How do i display only the wrong answers?

I forgot to add, I don't know arrays.
I have never used them. If u can please help me by sending a sample code for the same.

Please do help. Would really appreciate it.
Thanks

Trivia: Flashkit
What do you use flashMX to develop?

Please choose the answer that best describes your situation.

Pokemon Trivia
I don't know how many people watch pokémon here on this board, but I'm making a pokémon trivia game for my 5-yr-old brother, so I need suggestions for questions to put in it.

Trivia Quiz Help
I want to be able to load random questions into a Flash 5 movie like this http://www.webtoonist.com/triviaquiz/triviaquiz.swf using PHP/ MySQL, can anyone tell me how to do this, please.
Thanks!

Flash Trivia Quiz
I want to load random questions into a Flash movie like this http://www.webtoonist.com/triviaquiz/triviaquiz.swf with PHP/ Mysql can anybody tell me how to do this, please.

Thanks !

Trivia Questions Only Called Once.
Hi, I'm making a trivia based game. Below, questions are stored in arrays and are called using the random function. What I need is for once a question has been called, it will not be called again. I thought it'd be most efficient to do this using the "rando" variable I set below. Can anyone think of some code such that when, for example, rando is set at "8", the program will remember random(8) has been called, and the coresponding question will not be called used again?
If more code that I'm using is needed, I'll post it. I'm still pretty new to actionscript, so I apologize in advance if this seems like a simple question.
Thanks!


Code:
rando=random(10);

q0 = new Array("Who was the first Astronaut in space?","Neil Armstrong","John Herrington","Neil Jones","Buzz Aldren","opt_2");
q1 = new Array("The speed of light in a vacuum is:","3.0 x 10 E8 m/s","Very fast","40 km/hr","8000 m/s","opt_1");
q2 = new Array("What element has an atomic mass of 63.54 g/mol?","Copper","Uranium","Boron","Selenium","opt_1");
q3 = new Array("Who invented gravity?","Sir Isaac Newton","Carol Ann Budd","Randy Way","Gravity was discovered","opt_4");
q4 = new Array("Which type of molecule holds the most potential ATP?","Carbohydrates","Triglycerides","Protien","Amino Acids","opt_2");
q5 = new Array("Which theory explains the expanding universe?","Doppler Effect","3rd Law of Thermodynamics","Heisenburg Uncertainty Principle","Boyle's Law","opt_1");
q6 = new Array("The centre of a blackhole is called the?","Nucleus","Dark Matter","Event Horizon","Singularity","opt_3");
q7 = new Array("Which is not a type of quark?","Up","Bottom","Strange","Silly","opt_4");
q8 = new Array("The gene that is responsible for albino mice is what type of gene?","Dominant","Phenotypical","Recessive","Genotypical","opt_3");
q9 = new Array("What organelle of a plant turns sunlight into energy?","Chloroplasts","Mitochondrion","Golgi Apparatus","Cell Wall","opt_1");

[Flash Pro 8] Trivia Question
I am putting together a small entertainment industry trivia Q&A. Each time a correct answer is selected a point is answered to the scoreboard. The code that I have used for this is:

var score:Number = 0;
stooges_mc._visible = false;
submit_btn.onRelease = function() {
if (lmc_rb.selected) {
answer_txt.text = "CORRECT!!!";
stooges_mc._visible = true;
score += 1;
} else {
answer_txt.text = "WRONG!!!";
}
};
continue_btn.onRelease = function() {
nextFrame();
};


And this much all works fine. My question is this: if the correct answer was selected once, submitted and a point received what might I be able to add so that if it is selected a second time and submitted another point would not be added? (I mean that if you've already been awarded a point for a correct response you should not be able to keep adding points via selecting the same answer to the same question.)

A Judgement Decision, And A Trivia Question
I read the FAQ and several screens of messages but didn't see an answer to this. I greatly appreciate any assistance. This is an amazing, gargantuan place!! I'm so glad a friend sent me the link.

First, I recently told my boss that sure, I could put those adobe pdf's into flash. I hadn't even installed Flash at that point. I'm an optimist. My question isn't about using Flash--I'm sure I can figure it out, I have like six books here and the program help--but rather, what might be the best way of doing this kind of thing?

The pages are put up at an online edu site. When they have an interactive item, they take a page or two from the physical textbook that relates to the topic, and they make it a link, in case the students need more context-info. So in some cases there is more than one page and there has to be a way between them.

On the MM site I see 'flash paper' (I am still not 100% clear on what that is). I can import a pdf into flash no problem. (The output... doesn't scroll... ahem.) Would you suggest putting it in a movie, with a scroll, adding a button if it's two pages, to navigate?

Or is there some more appropriate way that a simple flat-file image could be run through flash?

See I'm thinking this might be something really simple and obvious and I should ASK rather than guess based on zero info.

Second question: this is one of those "there's no such thing as a stupid question! only stupid people who ask questions!" thing. (Just kidding. I hope.) I am not entirely clear, from looking at the html output by Flash that embeds a movie, on the following:

I make mostly ColdFusion driven websites, a few static here and there. I would like to use flash in a way similar to java applets, in other words, have like a Flash "thing" somewhere on the page, as opposed to having an entire website in flash. (After walking through what a pain in the butt it was to make a dynamic-data form in flash vs. dreamweaver, I have no desire to use it as a front-end anymore. Too bad, 'cause I was really kind of excited about that for awhile.) The question is, can I make a "little movie" and insert it into a table cell in a regular website? I mean I see Flash-based ads in yahoo so that has to be possible right? All the examples in my books and on the MM site use Flash as the full-site... not as an 'object' itself.

Anyway I'll continue reading, I'm sure there's a ton to learn here... thanks in advance for any advice.

Palyne

Flash Trivia Quiz I'm Desperate...
Hi,

I'm currently developing this flash trivia quiz!
I've done the design and the code already, but something doesn't work!

The quiz should load the questions from .txt files into dynamic text boxes, but it doesn't!
Or, at least it doesn't show the text correctly!

It would be really nice if somebody could take a look at it!

Download it here.

Note, that the main game is in this MC:
_root.noise.easy
The rest around it are mostly graphics and animation stuff!

The MC for medium and hard gameplay are not yet build!

You can send the file back to me, if you correct an error! The filesize is not too big!!!
Here is my e-mail address!

Thanks in advance for any help!!!
I don't know what's wrong with it!

Greetings,

Fallin_angel AKA Marc

Needs EXPERT Help: 1. Save Game For Replay, 2. Reset Game
I'm rather new to Action Script, but doing not bad. I have searched the Board, found a link to a tutorial on ActionScript[Org], titled: "save a local copy of file". But that was yet not clear enough for me.

2 Questions at the moment (files attached):

1. Save Game for Replay: How can I save the set to a file in the Same Folder so it could reload for further play from that point on?

2. Reset Game: How can I Reset the Game for a NEW Attemp? I need to remove all Actors at once, to start a new game, without closing this SWF and reopenning it.

If you'd be so kind as to explain very clearly, and add Action Script, taking into consideration that I still get confused by trying to deal with Arrays and so. I promise to study your lesson carefully - this GameTest attached is the fruit of this week studies.

THANKS A LOT
Nit Kalish

Was This Game Made From Flash ? (Zadarider) Download The Game
Was this game made using flash 8 because it seems to run very well even when i have made up to 10000 lines.

Flash Game Help The Game Runs Too Slow In A Browser
lo there!
I'am so frustrated!

I have made a plattformgame in flash, and after I had published it I tested it (local) when it was embedded in a browser, and it hacks and laggs! But when I play it in the flash player it works just fine.
What should I do?

I removed all the heavy graphics, lowerd the fps to 30fps and removed all the code so now its just the bassis left (gravity, collision, key checking etc. and yes u should bounce on the walls giving a wall jump effect).

Anyone please! I am in big need of help!
Is it my code? Did I publish it wrong?

here are the links:

http://smh03.lbs.se/smh03niklas/prof...ofilbollen.swf
http://smh03.lbs.se/smh03niklas/prof...ofilbollen.fla
http://smh03.lbs.se/smh03niklas/prof...filbollen.html


//Qui

How To Disply Time In Game And How To Stop After The Game..
Hi all,

i need help on drag and drop game...

i have done the drag and drop function, for this game timer has to be shown, after user finishes the drag & match, it should give finish alert and time taken for this game (please tell me also how to stop time after he finish the game) is to be sent to some external file or some database...

can it be done?
i have attached the .fla file also..

[F8] Game Studio Needs Flash Game Programmer
Hi -

I've been working on cartoon Flash interfaces for awhile. Now my clients want games, so I'm looking for one or two Flash game actionscripters who can help out and maybe start a studio. Since it's a startup, I'm looking for someone who's good, but not yet making millions - hoping we can do that ourselves eventually. Someone dependable, easy-going and easy to get along with. Would be great to find someone relatively local, but not absolutely necessary.

We'll be creating custom Flash games for an existing client.

Hoping to check out people's games first.

J.

[F8] How Can I Make A Game With Levels And A Game That Restarts?
I know this sounds stupid, but I just can't figure it out. I need to make a platform game. I'm fine with making a points system and a scrolling background and it functions but I don't know how to get the player to touch an object, or reach a goal and then transport to another level...I don't want to make the user have to click something to go to a new level.

Also, when the character hits an enemy, I can make it die, but I don't know how to make a button or something appear saying 'Game Over - Try again', so they can pretty much restart the level.

Hopefully someone can help me.
Regards,
Andrea

Help With A Game.. Game Is Running Slow In Browser..
I am working on this game for work and for now all i have is placeholder art for the most part and nothing very heavy on the graphics end yet my game is running very slow.. i bumped the FPS to 60 since at 30 i was getting image tearing or a double vision effect.. the upped FPS fixed that but the game is still running very slow. To give you an idea of what's going on i have different intervals running so different things can happen at different times.. there are 2 constant onEnterframes for the 2 enemies flying around the screen.. there is 1 for the main loop, 1 for the character, 1 for whenever tickets generate which removes itself and deletes the enterframe when they disappear, 1 for the wrecks that occur on level 2 which also remove themselves and delete enterframes for themselves, and 1 for a holder that handles all the money flying in which removes themselves as they collide with the player or leave the screen. All enterframes that run during gameplay delete themselves at the end of each level and re-initialize at the beginning of the next.

I can't figure it out.. please take a look at the fla and html files attached. Could it be just the sheer size of the game screen.. should i make it about half the size?? I appreciate any help and thank you.

Also the game's scripted animations seem to be running a little choppy if you watch their movement closely like there is a little glitchy jump every second or so.. is this fixable?

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

Updating Game Stats During Game
B"H

hi - happy new year

i have a small problem - i run a college sports website - i want to update game stats during the game and ppl would go my website and access the stats as i type them - they are in microsoft database and i have php cgi flash mysql on my server (just not asp) and i want it to be that as i type the scores and then switch cells w/o uploading the new file - flash could still access the files from my computer and update the page auto - (it could load the files from my i.p. addy)

what is the best way to do this - do you have any examples?

thanks

yechi

[CS3] Snake Game, Game Size
I'm using this snake game code from the old Nokia phones. The game takes place in a 150X150 square, i want this to be 384X512 but ideally it would be in a var so it can be changed easily. Can anyone help?


PHP Code:



var unit = 15;//size of snake partsvar uwh = 20;//?var canMove = false;var dir = 2;var score = 0;aPieceList = new Array();mouseListener = new Object();mouseListener.onMouseDown = function(){    if (!canMove)    {        canMove = true;        startGame();    }};Mouse.addListener(mouseListener);k = new Object();k.onKeyDown = function(){    var k = Key.getCode();    if (k == Key.UP && dir != 2 && canMove)    {        dir = 0;        canMove = false;    }    else if (k == Key.LEFT && dir != 3 && canMove)    {        dir = 1;        canMove = false;    }    else if (k == Key.DOWN && dir != 0 && canMove)    {        dir = 2;        canMove = false;    }    else if (k == Key.RIGHT && dir != 1 && canMove)    {        dir = 3;        canMove = false;    }};Key.addListener(k);function addPiece(){    var p = this.attachMovie("piece", "piece" + aPieceList.length, aPieceList.length);    p._x = aPieceList[aPieceList.length - 1]._x;    p._y = aPieceList[aPieceList.length - 1]._y;    aPieceList.push(p);}function moveFood(){    var moveIt = true;    while (moveIt)    {        food._x = Math.floor(Math.random() * uwh) * unit;        food._y = Math.floor(Math.random() * uwh) * unit;        moveIt = false;        for (var i = 0; i < aPieceList.length; i++)        {            if (aPieceList[i]._x == food._x && aPieceList[i]._y == food._y)            {                moveIt = true;            }        }    }}function gameOver(){    delete this.onEnterFrame;    tScore.text = "You Lose.  Score: " + score;    canMove = false;}function startGame(){    for (var i = aPieceList.length - 1; i >= 0; i--)    {        aPieceList[i].removeMovieClip();        aPieceList.pop();    }    score = 0;    var p = this.attachMovie("piece", "piece" + aPieceList.length, aPieceList.length);    aPieceList.push(p);    p._x = 10 * unit;    p._y = 10 * unit;    var food = this.attachMovie("food", "food", -1);    var c = 0;    moveFood();    var startingLength = 3;    for (var i = 1; i < startingLength; i++)    {        addPiece();    }    this.onEnterFrame = function()    {        canMove = true;        tScore.text = score;        for (var i = aPieceList.length - 1; i > 0; i--)        {            aPieceList[i]._x = aPieceList[i - 1]._x;            aPieceList[i]._y = aPieceList[i - 1]._y;        }        if (dir == 0)        {            aPieceList[0]._y -= unit;        }        else if (dir == 1)        {            aPieceList[0]._x -= unit;        }        else if (dir == 2)        {            aPieceList[0]._y += unit;        }        else if (dir == 3)        {            aPieceList[0]._x += unit;        }        if (aPieceList[0]._y / unit == 20)        {            aPieceList[0]._y = 0;        }        else if (aPieceList[0]._y / unit == -1)        {            aPieceList[0]._y = 19 * unit;        }        else if (aPieceList[0]._x / unit == -1)        {            aPieceList[0]._x = 19 * unit;        }        else if (aPieceList[0]._x / unit == 20)        {            aPieceList[0]._x = 0;        }        if (aPieceList[0]._x == food._x && aPieceList[0]._y == food._y)        {            score += 10 * aPieceList.length / 2;            moveFood();            addPiece();        }        for (var i = 1; i < aPieceList.length; i++)        {            if (aPieceList[0]._x == aPieceList[i]._x && aPieceList[0]._y == aPieceList[i]._y)            {                gameOver();            }        }    };}

Save Game/load Game
How do you get the browser to remember all the variables and what point you're in on the timeline when you press "Save Game," and how do you get it to reload those variables when you press "Load Game." Is this some extremely complicated process?

How To Save A Game And Load A Game?
I don't know the codes that can make a game can be saved and be loaded. I have been trying out some codes but they doesn't work. So, can anyone help me please? Im using Flash MX 2004 and Im doing a standalone game.
So, how to make it? Can teach me step by step? Please??

Card Game (turn-based) - Lobby Room And Game Room, Maintain State
Hi all, I´m new in this forum, since now i appreciate for any help.

I´m developing a turn-based card game in Flash 8 (multiplayer), using the concepts of lobby and room. In this case when the user login de game, he always see the lobby, where he can choice the games, then the user selects a game in a dataGrid and enter the game.

Inside the game (that resides in another frame in my .fla), there is a button that when clicked brings de users to the main lobby ( gotoAndStop(“lobby”) ) so that the user can visualize the lobby with the game running in background with the others users.
The problem is when the user return to the game ( gotoAndStop(“game”) ), the images, cards, players name and chat history text disappear, all the game object disappear, remaining only the original graphics (movie clips) to the game room.
In fact, I need a solution to maintain the state of the game when the user decide to visualize the lobby (with the game running) and after return to the game.

Thanks for any help.

Regards,

Luiz Filipe (CURURU)

Os: Sorry for my bad english -

Game Control Panel --> How2make Object Appear In Control Once Discovered In Game
Hey all you flashies,
here's a problem to scramble the flash nerves. I'm creating a game for my Major project and I want to have a control panel at the bottom. The aim of the game in brief, is to collect 6 pieces of fruit (just an example). These 6 pieces of fruit will be found in different order depending on which route the player takes in the game. What I want to happen is each time the player finds a fruit, I want it to appear in the control panel. How do I go about doing this? Can anyone help? Much appreciated! If anyone has an example to something similar to this it would be much appreciated if I could see it! thanks!

My Game....matching Game.
this my example for my game that i have create,can anyone help me and what really wrong with my game,coz the picture not appear went i execute this file.......really need help on this

[F8] Tips On This Game?(my First Game)
I'm making this here game where you walk around a shop, check out the games and movies etc... in the aisles and if you want to buy one, a form gets sent to me. Also there's a TV room with some videos and arcade room with flash games. I did this cause i'm selling my games and movies etc... and i thought this would be useful.

So any tips about how to improve it? what more to add?

Game Help(project Game)
Ok I make a simple game but I need more people in my game project take me contact in e-mail.Now I show what people I need.First I need good actionscripts people.I need only good actionscripts people ty and goodbye.

What Character Would You Like To See In A New Fighting Game In Fighting Game?
as the title suggest. I'm working on a fighting game (like street fighter) and I was wondering who should be in it. It can be a character from any other fighting game or one you have created yourself. I chose Akuma (personal fav.). Eager to hear what you've got!

What Character Would You Like To See In A New Fighting Game In Fighting Game?
as the title suggest. I'm working on a fighting game (like street fighter) and I was wondering who should be in it. It can be a character from any other fighting game or one you have created yourself. I chose Akuma (personal fav.). Eager to hear what you've got!

Help Doing Game
Hi everybody!
Can any of you tell me how to do this?
I´m making a game about a space ship which fires a laser and moves around the screen. My problem is that I want it to fight against asteroids, so I need to do that when the laser hits an asteroid it explodes and then appears randomly again in the screen.
I have already solved the part of the laser shot and the part of the spaceship´s movement, but I can´t do the other part right enough!
My problem is when I fire the laser and when it hits the asteroid I can´t duplicate the asteroid Movie Clip.

If anybody knows how to do this or where I can´t download a tutorial I will appreciate it very much!

Thank you very much!

Help With Game...
I'm creating a game for teachers called "alphabet soup".
The letters go into the bowl and the question appears on the left hand side. I then ask the teachers to drag the correct letters into boxes that appear below the bowl.
e.g. This organization is in the sports entertainment business.....W W F. What I want is when the correct letter is placed in a box it turns green, if its wrong the box will turn red. Can anybody help me out with some script for the boxes that will allow me to make a specific letter turn the box either red or green.
Thanks
Mike

Help Me For A Game Plz
Well I've plenty of MC named wall1 , wall2 , wall3......
wall45668789.

I want to make a collision check with a simple MC named Car.

I don't want to make hundred lines like this one :

if ( _root.car.hitTest(_root.map.wall56)){


How can I call every MC with wall in their occurence name.

Something like ["wall"]+i but I don't success.

Thks for all.

Help Me With This Car Game
HI

I'm currently working on this game.
http://www.multimania.com/pio/Game/game.html
but it is f*cking slow on small PC.
I want to put it in intermediate quality but it doesn't work
I've got a little problem with the collision too ( you'll see)

So if someone want to help me a little ( an idea to make it faster than ever !!)

Thks for all

Game Help
im making a game and i dont know how to make it so the guy you move around can go on certain thing, but when he runs into a building or something he stop when hits the wall. thanx for your help
________

Game (oh My God) HELP
Hello world!!
I am making a game, i am very newbie so i need help. What i want is to only get one point when i shoot an enemy, but now i get points when i hit the explotion too. Heres the code for the gunshot:


for (i=1; i<=_root.numEnemy; i++){
if (this.hitTest( _root["enemy"+i]) and thi**** == 0){ <--
thi**** += 1;
_root.score+=random(100);
_root.down+=1;
_root["enemy"+i].play();
_root.spaceship.laserCounter--;
this.removeMovieClip();

}}}

I would apreachiate some answers!!!!

thnx guys!!
-

ZoPhA zopha.cjb.net
[Edited by zopha on 07-06-2001 at 07:56 PM]

Help With Game
Im trying to make a game but im confused by ALL the tutorials. I need a way to make The main guy (A cute little wolfie) Move forwards when you press the Right arrow key and up n down, ect. but i know how to set the speed and how you need that Onclipevent stuff too but I do all of this and it never works...And where are you aspose to type in This._X= ect code anyways ???Im very much confused.....And if its not to much trouble how do you Teporaily disable Keys ?

Copyright © 2005-08 www.BigResource.com, All rights reserved