Ask a Question related to Macromedia Director Lingo, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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,...
    2. 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...
    3. 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...
    4. 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
    5. 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...
  3. #2

    Default Re: High Score

    > 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?
    Yes, except either

    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

  4. #3

    Default 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

  5. #4

    Default 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

  6. #5

    Default 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

  7. #6

    Default 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

  8. #7

    Default 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

  9. #8

    Default 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?
    >
    I was obtusely pointing out that you'd forgotten to put the code in the message
    :-)

    Andrew

    Andrew Morton Guest

  10. #9

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139