Ask a Question related to Macromedia Director Lingo, Design and Development.
-
Emil RT webforumsuser@macromedia.com #1
High Score
Hi,
I've posted this question before and been reading the similar questions about this matter but I aint getting any wiser.
I just want to create a simple high-score table to use over the net in a shockwave movie. I understand that i cant use the fileIO xtra though.
Everybody recomends "http://www.shocknet.org.uk", but i cant understand why you have to use so many files to achive that.
I know a litte bit asp.
Is is a little bit like this:
Shockwave movie->postNetText(www.domain.com/script/file.asp?name="rune"%score="1000")
then the asp code calculates the values to se if you reach the highscore and then writes it in a databse (access?)
And then the same procedure with remove?
Emil RT webforumsuser@macromedia.com Guest
-
High Score Boards...
I want to add a DB-driven high score board to one of my flash games, so that people can compete with each other. I have seen a few around the net,... -
High run queue, high idle cpu percentage
Hey - I have a werid situation: vmstat shows high r (always r>0, sometimes r>10), but id > 90%. The rest of the values are nominal. Any... -
ADD SCORE
in the game im making i need to keep a score. the points will increment by 5 and 15. how do i make a button that adds 5 to the score board but at... -
Adding to a score
How do I add points ie. 10 points to my score feild? Because when I do it all it does is write 10 to the feild not the number 10 -
put score into textfield
Hi All, I wrote an easy game to go with a project, but I'm stuck with a problem. The point of the game is, you fly a rocket that has to evade... -
Andrew Morton #2
Re: High Score
> Is is a little bit like this:
movie->postNetText(www.domain.com/script/file.asp?name="rune"%score="1000")>
> Shockwavethen writes it in a databse (access?)> then the asp code calculates the values to se if you reach the highscore andYes, except either>
> And then the same procedure with remove?
netID=getNetText("http://www.domain.com/script/file.asp?name=" & urlEncode(rune)
& "&score=" & string(myScore))
or
netID=postNetText("http://www.domain.com/script/file.asp", ["name": rune,
"score": myScore])
and then wait for data to be returned from the cgi script (see netDone in the LD
for how to wait).
A database may be overkill for storing the high scores - a text file may do just
as well.
Note that urlEncode turns spaces into + instead of %20
Andrew
Andrew Morton Guest
-
Dave Mennenoh #3
Re: High Score
>>A database may be overkill for storing the high scores - a text file may
do just as well.
Maybe - but if you use PHP for example, the dbase stuff is built in - it's
really no harder to use than a text file and you have tons more control as
well. I just went through learning just enough PHP to do a HS table for my
xyz*bert game. I'm writing a tutorial on it for my site...
--
Dave
[url]http://www.blurredistinction.com/director[/url]
Dave Mennenoh Guest
-
Dave Mennenoh #4
Re: High Score
If you want to make this easier on yourself, scratch using ASP if you can
and use PHP instead. It is _extremely_ easy to do dbase stuff with PHP. For
example, here's a little PHP script that will insert into a mySQL db:
--
Dave
[url]http://www.blurredistinction.com/director[/url]
Dave Mennenoh Guest
-
Dave Mennenoh #5
Re: High Score
I did mean to paste in the script before sending ya know...
<?PHP
$name = $_POST['name'];
$score = $_POST['score'];
$level = $_POST['level'];
$connection = mysql_connect("localhost", "yourUserName", "yourPassWord")
or die("Died");
$myDB= "yourDatabaseName";
mysql_select_db($myDB, $connection) or die("Died");
$sql = "INSERT INTO score(name, score, level) VALUES('$name', $score,
'$level');";
$result = mysql_query($sql, $connection) or die("Died");
echo ($result); //returns 1 if success
?>
Then I'd use a Post to send my three variables into the script:
myNetID = postNetText(theURL & "save_script.php", ["name":nam, "score":scor,
"level":levl])
HTH - and I'm actually working on a tutorial on exactly this for my web
site...
--
Dave
[url]http://www.blurredistinction.com/director[/url]
Dave Mennenoh Guest
-
Andrew Morton #6
Re: High Score
> example, here's a little PHP script that will insert into a mySQL db:
Cripes! I'd hate to try and maintain code that concise!>
>
> --
Andrew
Andrew Morton Guest
-
Dave Mennenoh #7
Re: High Score
>>I'd hate to try and maintain code that concise!
Are you kidding? It's 6 lines...and what's to maintain?
--
Dave
[url]http://www.blurredistinction.com/director[/url]
Dave Mennenoh Guest
-
Andrew Morton #8
Re: High Score
> >>I'd hate to try and maintain code that concise!
I was obtusely pointing out that you'd forgotten to put the code in the message>
> Are you kidding? It's 6 lines...and what's to maintain?
>
:-)
Andrew
Andrew Morton Guest
-
Dave Mennenoh #9
Re: High Score
>>I was obtusely pointing out that you'd forgotten to put the code in the
message
Ah, well... obtusely... I haven't had coffee yet Andrew!
--
Dave
[url]http://www.blurredistinction.com/director[/url]
Dave Mennenoh Guest



Reply With Quote

