igortyhon's Recent Forum Activity

  • Here is my script to save and load the game for each player. It works, but I created it a long time ago, maybe there are newer methods.

    <?php

    //

    $mysql_host = "xxxxx";

    $mysql_database = "xxxxx";

    $mysql_user = "xxxxx";

    $mysql_password = "xxxxx";

    //

    $link = mysql_connect($mysql_host, $mysql_user, $mysql_password) or die("Err MySQL" );

    mysql_select_db($mysql_database, $link) or die ('err db');

    //

    Header('Access-Control-Allow-Origin: *');

    Header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");

    Header("Content-Type: text/html; charset=UTF-8");

    $to = $_POST['to'];

    //

    if($to == 'savegame'){

    $id_user = $_POST['id_user']; //

    $gamedata = $_POST['gamedata']; //

    //

    $q1 = mysql_query("SELECT * FROM savegames WHERE id_user='".$id_user."' ORDER BY id_user DESC LIMIT 1");

    if(mysql_num_rows($q1)==0){

    //

    mysql_query("INSERT INTO savegames VALUES (NULL,'".$id_user."','".$gamedata."')");

    } else {

    //

    mysql_query("UPDATE savegames SET gamedata='".$gamedata."' WHERE id_user='".$id_user."'");

    }

    echo 'ok';

    }

    //

    if($to == 'loadgame'){

    $id_user = $_POST['id_user']; //

    //

    $q1 = mysql_query("SELECT * FROM savegames WHERE id_user='".$id_user."' ORDER BY id_user DESC LIMIT 1");

    if(mysql_num_rows($q1)==0){

    //

    echo 'error';

    } else {

    //

    $q2 = mysql_fetch_array($q1);

    echo $q2['gamedata'];

    }

    }

  • Hi. I am adding such CORS settings in php on server.

    //Allowing the browser to make crossdomain requests
    @header('Access-Control-Allow-Origin: *');
    @header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
    @header("Content-Type: text/html; charset=UTF-8");
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You do not have permission to view this post

  • Hi, if you don't use third-party services, there is only one option.

    For those who donate give the game with extended prizes. This is a popular method on ITCH.

  • It can be done. Check out the multiplayer examples for Construct3.

    But multiplayer games require more knowledge than regular games.

  • Hi. You should get used to having errors in your reports, there is no way to get rid of it. I recommend that you periodically review your failure report and if you notice devices with abnormally high error rates, simply block them. This strategy will help you keep your crash limit below 0.47% and then Google will not reduce your traffic.

    The main cause of errors is too much segmentation of devices on which android runs and too long support of older versions.

  • Is there a way to move the block smoother and not that instant that it is right now?

    You can set the coordinates of the touch point like this.

    lerp(Self.X,Touch.X,0.1)

    lerp(Self.Y,Touch.Y,0.1)

  • winkr7

    Hey!

    Thanks for your response. I am really bad at physic, this is what I've manage to achieve.

    https://www.dropbox.com/scl/fi/dksjskdwlibn1pr20l7oh/DragAndDropExample_01.c3p?rlkey=w1zl85gzyjivdmqpug9dx7ok0&dl=0

    Can you make the moving of blocks smoother? Also the blocks do not slide easily into the pits, why is that?

    I had to find and install a plugin for that damn Poki to open your example.

    I reworked your example a little bit.

    dropmefiles.com/cCLY0

    Updated.

    To make it easier to insert parts, you can reduce the collision a bit, developers often give the player invisible simplifications.

  • It doesn't work if nothing has ever been saved for the item to local storage. I'll add something to have it set something by default if it's missing for each stored value. Thanks again!

    There is also an action there in case the save is not found.

    Or you want your colleagues to use your screenshot with actions and rework it. It's not difficult, but it will degrade your development experience.

  • This example was done for someone else, so you don't need to look at the icon.

    You can switch to another layout after the trigger no found or save loaded.

  • Hi. You can additionally save the time of saving the last record and check whether 2.5 hours have passed or not before and after loading data from local storage.

  • You do not have permission to view this post

igortyhon's avatar

igortyhon

Online Now

Member since 22 Jul, 2020
Last online 27 Dec, 2024

Twitter
igortyhon has 14 followers

Connect with igortyhon