Ribis's Forum Posts

  • In my game, "Psi," I have hidden bonus rooms off of the main level. How do I save what's going on in the main level and return to it when the bonus room is exited? Thanks, Morgan.

    you can use webstorage,

    your game is for nodewebkit?

  • Thanks, ist's basically the same as with mySQL posts.

    you are welcome,

    yes, well, with the mySQL you can store a variable into a database, this is important to load all information of the player (username, password, email...coins, jems, levels...etc...etc)

    but when you need to save a big data text, like 200000 characters, you can't store on the database(you could...but is crazy)... I solved this with this step (on facebook app, but you can also make a login/registration page):

    -at the first access of the user, check if exist the UID of the user in database.

    • if doesn't exist, insert the UID with my data (username, password...coins "0", jems"0"...) on the database. (use method"POST") and you can also encrypt the data (there is a plugin on this forum)
    • make 2 folders in my server with the UID of the user. (PHP)

    this is just one file, if the user exist, just skip all of this, and if the UID exist, just load the database data.

    now, when the player open a level, I do this at the first access of every level:

    -at the first access of the level, check if there is a file json on a folder of the UID player with the name of the layout.

    -if exist, load a AJAX.string to an array. (this load everything about the level, coins taken, terrain, etc....)

    -when the player finish the level or find a save checkpoint, C2 will send a JSON string of the array with method POST on my php file, and when the php file has the data, just make a file with the name of the level in a folder of the user in .json.

    now, if the file doesn't exist, just load the orginal level...this works perfect for me.... (basically the array delete the coins taken, enemy, tilemap...or something like that)

  • Hello fellas,

    I know there's a way to download array/string/dictionary data as a file, but what I'm looking for is the possibility to save into previously imported project file. Is it possible?

    if you export with NodeWebKit you have all action to make file an save to some folder in your computer...

    but if you are looking to export on web, you can't, you need to run a php code in your server and send data with AJAX, and save your file to some folder of your server... (php do this...)

  • ...or rotate on X amount but still lands perfectly?

    thanks in advance!!!

    if objects is on collision with the ground, set angle objects to zero....

    you can also calculate the jump space and the rotation speed to be a zero when the jump is finish...but if the square touch another ground more high, this will not works...

  • There is no way to delete a save, the way you could do it is just deleting a reference to a save, like checking a webstorage value that would be related to that save.

    Ashley the request is still really valid, could a simple "delete existing save (by name)" exist?

    you can delete the savegame by "clear cache" of your browser... and this isn't good if you want to make a game online...

    but it depends what do you want to store... save game system will save all, position of the instance, variable, global variable etc...

    for delete a savegame is possible to save a state at the first access like "reset" savestate, and when you want to reset all stats, just click a button, and a "reset" savestate will replace the old gamesave... that should work...

    but I suggest to save a game on some server with a php an AJAX, and if the player want to reset the game, just do this process and replace with the json file on the server... I don't like to store information on the browser... if you are making a game with a lot of level, or something important to continue the game (store coin, jems, position of the sprite...levels..other important stuff..)....and the user clear the cache, just say bye bye to your save...

    but depends of the game... if you are making a game like tetris... and just post your score at the end of the game... no problem

    EDIT: I add a capx

  • R0J0hound - Thanks Ill check that out tonight.

    Ribis - Yes, as stated in the OP the behavior does work well, but sliding against angled walls seems like it should be part of the behavior similar to how the platform movement deals with slopes without extra code. The Platform Behavior has received many improvements to increase it's usability but 8 Direction hasn't gotten much attention.

    yes, I understand and you are right, make it simple if the behavior has more implementation, but for some request is better if you made your own script for make your own gameplay... but a wall sliding can be an important integrate.

    R0J0hound I locked your script (and don't just this)... and they are like an art... did you study math?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Choose 'low quality' fullscreen mode and you can get it to render a small viewport which is cheaply stretched to the screen, which can improve performance.

    I see, if I set low quality is better, but with 150% I could save 15 fps and the quality is "fine".... it's not a big problem (someone can make a little tutorial for a player to do this...) it's just in case...

  • I made a test for this...

    on my computer, one image 250x250 and, another 125x125 scaled x 2 on construct2, the performance is a little bit better.... but the quality is low off course....

    the problem is how many big is the sprite.... one trick to solve this, is to scale the layout (x1.5...etc) and use a little sprite, you can increase your performance a lot, (I tried to another test)...

    is better if you can scale with construct2, but it depends....

    Ashley

    just one question.... with chrome you zoom the page (ctrl+mousewhell) and you can zoom the page... if you do to a canvas, like 150% zoom, the contruct2 performance will be really better and the quality can be very well... like, one of my project in my old computer was 35 fps, if I do this "trick", the fps change to 60!! and the quality is ok....

    now my question is.... can you integrate on construct2? like, choose the % of the zoom? this can solve the problem of the lag... if you don't want to change effect, particle...or other things for old computer, with this simple step you solve everythings

    thank you very much

  • is normal that the object stop... you are using the basic behavior without any code... and the behavior works well...

    you have to make a easy script to make your gameplay...

    for instance, if the player touch some wall, the player "bounce" 2 px.... you can also use physics behavior and platform behavior... it dependes how you would like to make it...

    you can find a lot of example in this forum

  • >

    > > Thank you, but I´m experienced in PHP, that thing about inserting in databse and getting data etc is clear for me as I wrote in my first post. Only thing I have problem is POST score from the game, because I don´t know what to write in which ajax column in game editor

    > >

    >

    > ON ajax, select:

    >

    > Post to url:

    >

    > TAG (you can use on event of contruct2)

    >

    > URL (of the php file)

    >

    > Data: (the variables to send, like, if you have USERNAME and SCORE)

    >

    > "username="&variableofC2USERNAME&"&"&"score="&VariablescoreonC2

    >

    > method: "POST"

    >

    > with this, you will send:

    > variableofC2USERNAME to username and VariablescoreonC2 to score on your php

    >

    I have folowed your steps but not working. It just change the database column to 0, not reached Score. Name of my variable is score, I have Data column: "points="&Score""

    Then php get:

    $score = mysql_real_escape_string($_GET['points']);

    The database updating works, it change the amount, but to zero, I still think, that It is not posting score correctly

    you have to set &score without the ""... and if you use GET, you can't use POST....

    GET is working on url like myscript.php?username=mynameinC2&score=8238923

    you have to change your variable with POST:

    $score = mysql_real_escape_string($_POST['points']);

    and for more information, you can see if your php generate some error... let me know if you solve that

  • Thank you, but I´m experienced in PHP, that thing about inserting in databse and getting data etc is clear for me as I wrote in my first post. Only thing I have problem is POST score from the game, because I don´t know what to write in which ajax column in game editor

    ON ajax, select:

    Post to url:

    TAG (you can use on event of contruct2)

    URL (of the php file)

    Data: (the variables to send, like, if you have USERNAME and SCORE)

    "username="&variableofC2USERNAME&"&"&"score="&VariablescoreonC2

    method: "POST"

    with this, you will send:

    variableofC2USERNAME to username and VariablescoreonC2 to score on your php

  • for the database, you have to make a php:

    get a score from CONSTRUCT2 with method "POST" and send the information to the file with AJAX plugin

    your file php will connect to your database

    you have to make a code who INSERT the value where the ID or USERNAME is, like

    "$sql = mysql_query("INSERT INTO `name of database`.`userdb` (`id`) VALUES ('','$idFROMC2');");"

    and after this, you have to make another script who asort the score table....

    now I'm working, when I get home, if I have time I will post more information.... search on internet how insert data on the database, how connect on the database...etc.... contruct2 have just to send the score or other variables... you have to work with the php... it's pretty simple if you start with the php... there are a lot of tutorial step by step on internet... find a good one, and you can start very good

  • hi all, when I try to send a data with "POST" method to a php file, like:

    URL:"phpfile/MAKEJSON.php"

    DATA: "c2array="&myarray.AsJSON

    my php file will write a new file:

    $myfile = fopen("users/$id/$namesavegame.json", "w") or die("Unable to open file!");

    fwrite($myfile, $c2array);

    fclose($myfile);

    and this work, the problem is a result of the json file:

    {[/b]"c2array[/b]":true,[/b]"size[/b]":[412,5,1],[/b]"data[/b]":[[ you can see, "\", and i don't find any solution about this, I don't understand why "[/b]" will appear...

    with GET is working good, ( {"c2array":true,"size":[412,5,1],"data":[[) but I need to use POST....is a bug? thank you very much... I don't know how to solve this problem...

  • [quote:u9i3h6ze]I tried it,in this case the scroll camera doesn't work fine....

    don't understand

    The scroll of the camera doesn't work because of the parallax, if you try the example, you will see ...if you move the player, the camera doesn't follow the player good... I would like to put my player on a layer with a 60 parallax, but I can't because of this...

  • Pretty obvious why it wouldn't work with different paralax, right?

    Just putting the camera sprite on the same layer as the player, would work..

    I tried it,in this case the scroll camera doesn't work fine....