GingerBatMan's Recent Forum Activity

  • Weishaupt, Any news? :)

  • Apply impulse at angle, Or do you mean world gravity?

  • Never mind. With the help of the forum we figured out a way to do this without a plugin.

    A level editor would be cool! As smitchell suggested.

    I know how to make the actual application. But can you show me how to save to json? With json I can then send it to a server and retrieve again, can I not?

  • Yann no I didn't. Should that theoretically make it easier to send data and then retrieve it?

  • Forgot to add a Weishaupt :D

  • Here is the rar containing the scoring system, and a capx(I did not make this, im just using it)

    "Is the server run by you....what kind of server is it? just a webserver answering the requests..."

         - Yes I am using just a webserver

    "I see that your php uses HTTP-Requests, but how are they handled on the other side....."

         - Download the .rar it should answer than in the "readscores.php"

              - The Post handles posting the score's, Translates the data into a .csv file format, Then the readscores.php puts them into a array and displays the data.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok, I'll wait. Thanks

    "could me give a little more details about the server side?!"

    Like what?

       -What I need to happen on the server?

  • Weishaupt,

    I allready tried to modify it allready, Didn't go so well.

    Changed the variable names and then was like what now? :S

  • Tehee I feel Special ;D.

    Thanks sure i'll wait.

  • talkinghead Really cannot wait for this!!! It's gonna be amazing to make my first multiplayer game!!! :D:D:D:D <---- Excitement :D:D:D:D

  • Weishaupt, thanks and sorry for being a pain with all my questions :)

    How would I do this serverside? I have a server which im currently hosting high scores on, So will it be similar?

    Here is the PHP for posting..

    <?php

    // read variables from POST data.

    $username = $HTTP_GET_VARS[name]; <-- DEFINE THE USER??

    $score = $HTTP_GET_VARS[score]; // <-- MODIFY THIS TO SEND THE REPLAY??

    // verify the username is set and not empty

    if (!isset($username) || $username == "") {

        echo "failure";

        exit;

    }

    // verify the score is set and a number

    if (!isset($score) || !is_numeric($score)) {

        echo "failure";

        exit;

    }

    // format the username and score as a comma delimited row

    $entry = $username . "," . $score . "\n";

    // append entry to the score file

    if (!file_put_contents("scores.csv", $entry, FILE_APPEND)) {

        echo "failure"; // failed to write to file

        exit;

    }

    echo "success";

    ?>

    Then Return the data

    <?php

    /** Return a list of top scores. */

    // read variables from GET data

    $num_scores = $HTTP_GET_VARS[num_scores];

    // read each line in scores.csv as a string into an array

    $scores = file("scores.csv");

    // define a comparator to sort items by score

    function compare($s1, $s2) {

        // split the strings by their delimiter

        $a1 = explode(",", $s1);

        $a2 = explode(",", $s2);

        // compare the scores

        return $a2[1] - $a1[1];

    }

    // sort the array of scores

    usort($scores, "compare");

    // output the requested number of top scores

    for ($i = 0; $i < $num_scores && $i < count($scores); $i++) {

        echo $scores[$i];

    }

    ?>

    Can i send:

         - int(tokenat(state,0,","))

         - int(tokenat(state,1,","))

         - int(tokenat(state,2,","))

    instead of score? the retrieve it?

  • Yann, Thanks!!! makes things a little better :)

    A few questions if your genius mind is up for it :)

    1, Saving the replay?

         - Can your mind figure out how to save a replay?

    2, Controlling the replay -

        - Pausing and resuming the replay? (RexRainbows pause function does not quite pause this)

        - Speed control? - Can i control the speed of the playback?

GingerBatMan's avatar

GingerBatMan

Member since 15 Dec, 2011

None one is following GingerBatMan yet!

Trophy Case

  • 12-Year Club

Progress

12/44
How to earn trophies