droptank21's Recent Forum Activity

  • <?php

    $db = "database";//Your database name

    $dbu = "root";//Your database username

    $dbp = "";//Your database users' password

    $host = "localhost";//MySQL server - usually localhost

    $dblink = mysql_connect($host,$dbu,$dbp);

    $seldb = mysql_select_db($db);

    if(isset($_GET['username'])){

         //Lightly sanitize the GET's to prevent SQL injections and possible XSS attacks

         $username = strip_tags(mysql_real_escape_string($_GET['username']));

        $query = "select * from user where username='$username'";

        $result = mysql_query($query) or die("User does not exist") ;

        $result2=mysql_fetch_array($result);

        if($result2)

        {

           session_start();

           $_SESSION['username']=$username;

           echo "$result2[id]";

        }

        else

        {

           print 'Wrong username or password.';

        }

        }

    else

    {

    echo "No data input to page.";

    }

    ?>

  • I'm currently building one right now, actually. Along the lines of Eye of the Beholder and Lands of Lore. A game like King's Quest VI or other will require more programming to control the character. I can guarantee though, that you can easily make a 2D point and click. The most challenging part is handling the inventory system, but do a quick search here on the forum and you can easily find a working one utilizing both click and drag and drop mechanics as a basis.

    Here's one by Wastrel Simple Point & Click Inventory

  • Did you change the ajax request url's in the C2 capx to match the url's of the php pages on your web server?

    Example:

    "http://localhost/wwxmmo/login.php?username="& UsernameTxt2.Text & "&password=" & PasswordTxt2.Text

    To

    "http://savvy001.com/wwxmmo/login.php?username="& UsernameTxt2.Text & "&password=" & PasswordTxt2.Text

    Be sure to check the syntax of your ajax code as well. Specifically ensuring there are spaces after the ampersands (&) denoting the data.

    (&_UsernameTxt2.Text &_)

  • You would create a new column in sql for level. Then much as the stats query you would query the user's level and assign the result to a global variable. Then simply assign an event that will check the user's level and set the system to go to one layout for a user and another seperate layout for admin.

    Tinker around with the stats php code and you'll get the hang of it.

  • And, of course, showing them their stats is all well and good. But there also needs to be an easy way to update a stat.

    Here is the php code for that as well...Here

    Then ensure it updates the stats in the game to show the new stat score.

    For example:

    Mouse -> on right button clicks on object 1 -> Ajax -> Post to : "http://localhost/wwxmmo/addexp.php?username="& UsernameTxt.Text & "&password=" & PasswordTxt.Text (tag "addexp")

    Ajax->On "addexp" completed -> Ajax ->Request: "http://localhost/wwxmmo/getstats.php?username="& user

    Ajax-> On "getstats" completed -> [Text]stat1 -> Set text to Ajax.Lastdata

    Simple as that. The user clicks on an object, our game Posts a command to php. Php updates the database. When the ajax command finishes a request is sent to retrieve the updated stat from the database, we assign that stat to a text object and the new stat is then displayed in the game.

  • It wasn't really necessary for the login function. However, I guess since you want a player to login you will need an idea of how to easily show them their own info.

    Here is the link to the getstats.php example.

  • Nice. Perfect for RTS games.

  • Looks fine to me. On Firefox.

  • Even though you go from one layout to the next and then back to the game layout you are still increasing global and instance variables every tick or every x number of seconds. You have to set rules that reset the variables (speed, acceleration, etc.) back to their original settings.

  • System -> On Start of layout : System -> Set speed to 2

    That will reset the speed of the game.

    I am pretty sure there are other parameters for the tiled backgrounds and the acceleration of the sprite16 that should be reset at the start of the layout as well, but still working on it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There's always csv files as well.

  • The tricks would be whether the mobile device can run asp and mdb files and finding a way to have the Ajax request point to the database within file structure of the app.

droptank21's avatar

droptank21

Member since 6 Apr, 2011

None one is following droptank21 yet!

Trophy Case

  • 13-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies