PDA

View Full Version : highscore?


omega10mg
02-01-2003, 08:47 PM
hum.. i'm making a game, and i need to make a highscore system.

so i have 3 questions. plz awnser as many questions as you can. :)

1. how can i make a score "thing", i guess i should use dynamic text, but how?
I need the score to go up one point each second.
do u understand? and then how do i make it stop once it started count? (i need it to stop once u die =))


okey..

2. How do i save this information in a text file? with the palyers name? I think i need to make some kinda formular for that right?
Both the text file and swf file will be in the same dir, up at a webserver.

3. How do i amke flash collect the information, from the text file?
so u can watch the highscore in the flash later?

i dont know if all this is possible, but help if you can, if u cant help me with all the thing help with the things u can..

thanx! :)

omega10mg
02-02-2003, 02:53 PM
btw, u can try out teh game at my website.
Beta Version 1.2

www.omega10mg.tk (http://www.omega10mg.tk)

thax.

CyanBlue
02-02-2003, 03:06 PM
Howdy... Two quick question... :)

Are you using FMX or F5???
Does your server support PHP or ASP or those sort of server side script???

Let me know... :)

omega10mg
02-02-2003, 06:42 PM
okey.. i have MX and i can maybe fix it up on a server that supports PHP and ASP and so on.. but i would prefer, if it was possible to save it in a txt, it would make it easier..

omega10mg
02-02-2003, 09:46 PM
anyone?

atleast try and help me with one of above?

zoomfreddy
02-03-2003, 05:52 AM
you will need a server side script(asp, php, java, flashremoting...you name it) to do the text file saving...do a search for high scores asp on the forums...a long time ago TG help me to do exactly this stuff, and there are some (unfinished) asp codes to download, those should give you some ideas(the code are based on some php high scores script found somewhere on the web). good luck.

:cool:

omega10mg
02-03-2003, 07:12 AM
thanx..

CyanBlue
02-03-2003, 05:06 PM
Arggg... I was going to create some PHP code and Flash script for you last night, but couldn't make it done in time... So, I'll just answer whatever I can here...

1. how can i make a score "thing", i guess i should use dynamic text, but how?
I need the score to go up one point each second.
do u understand? and then how do i make it stop once it started count? (i need it to stop once u die =)) So... You are saying you want to add up the score from the starting point till the character die and the one point for each second??? Interesting theory it is... :) Yes... You should use dynamic field, but you will have to use if statement that checks if your character is alive or not... and if he still is, you can add up the point to the dynamic text field... Show me your code on that if you have problem, I'll see what I can do...

2. How do i save this information in a text file? with the palyers name? I think i need to make some kinda formular for that right?
Both the text file and swf file will be in the same dir, up at a webserver.As it has been mentioned many times, you should use server side script to save a text file into the web server, period... :) When the game is ended, you could open up a message box asking the player's name or email address... When the button is pressed after that, you could call up the server side script, let's say PHP from now on, and send the user's informaion including name, email, score or whatever you want to save into the database... Once the PHP script get the data from the Flash, it will probably load up the database, in this case text file, and do the sorting to see if that score can go in to top 10 or something and if it does, add the given information to the database and update the database file, and if not, just ignore the data... and return the status back to Flash...

3. How do i amke flash collect the information, from the text file?
so u can watch the highscore in the flash later? Once the Flash get the status back from the PHP, Flash can load the text file again by using LoadVars() object to show the top 10 list on the stage... Maybe you can use duplicate movieclip or something to show the user information that you have read from the text file or you can just use 10 text fields aligned vertically to show the info...

Well... Just briefly went through the process of how you can do it... I hope it gave you some thing to think about... Good luck... :)

omega10mg
02-03-2003, 07:33 PM
thanx for all...
but could u go more into detail on my first question?
becuse i am not sure on how to do that thingy, how would the code look?
i dont even know how to make a dynamic text change when something happens... heh sorry

CyanBlue
02-03-2003, 07:50 PM
Um... Why don't you show us what you have got so far??? I don't even know how you are checking to see if your character dies... and without that sort of information, how can we go on, right??? :)

omega10mg
02-04-2003, 01:30 PM
okey... this is my code.

Die Code (on the ground MC):

onClipEvent (enterFrame) {
if (this.hitTest("_root.craft")) {
tellTarget ("_root.craft") {
gotoAndPlay(20);
}
}
}

then the explotion plays, and the screen turns black and replay buttom appears. i did that like this (code is on last frame in the explotion):
tellTarget ("_root.black") {
gotoAndPlay(5);
}
}

on frame 5, is the button to retry and some text.

hope this will help you to help me... I really need a scoering system to work... a highscore is just a bonus... first i need some score =)