barbara

Members
  • Content Count

    21
  • Joined

  • Last visited

About barbara

  • Rank
    Member

Recent Profile Visitors

570 profile views
  1. barbara

    change setSize only if possible

    Worked perfectly! Many thanks! XD
  2. barbara

    change setSize only if possible

    Hi, I'm making a platform game, i have a player that can bend himself so it can go throw an obstacle that is placed in a low position. The problem is that if the player stops in the middle of this obstacle it goes up again and appears through the object. I want it to go up only if there's no obstacle that collides with it, but i'm out of ideas, i don't know how to do it. My player in anchor is set to (0.5 , 1), and then i change the setSize property when it bends and again when it goes up so the collision size changes. Any ideas? Thanks!
  3. barbara

    store data in an app created with cocoon

    ok, thanks for your answer, i will try in a cocoon forum then.
  4. Hi, i'm creating a game with phaser and i converted it in an app with cocoon so i can put it up in the play store. Now i face a problem, i don't know how to store simple data, as levels, lifes, etc... so when the user exits the app and get back in can continue playing where it was left. I found some info about it but it seems pretty difficult as it is in native android (wich i don't know very well), i don't know if there are more options, i'm looking for something easy, at least to start. Many thanks.
  5. barbara

    input.onDown doesn't respond on certain smartphones

    Hi i was trying what you told me, but the problem persisted. Finally i discovered it, it was a phone issue, sorry for post it here, i was desperate. In case anyone need it, the problem was i have activated in my phone a touch gesture that was interfering with the browsers touches. It was i three times quick touch to zoom in the screen. Thanks for your time!
  6. barbara

    input.onDown doesn't respond on certain smartphones

    onDown, onUp, OnOver and onOut, have all the same issue. The command onTap works perfectly, but i need the button to answer to a "hold" behavior too, so the player continues going right or left while the button is down, so onTap doesn't fit the needs. It could work for the jumping behavior, but only for that one. It seems to me like the problem is not with the phaser code but maybe with the browser or the device, i was hopping i could insert some code that overwrites that problem.
  7. I'm creating a platform game in phaser, and i'm using buttons for control the game as in this example: http://phaser.io/examples/v2/input/virtual-gamecontroller, the same code. When i open it with my phone, an "bq aquaris x" or with my older one a "samsung galaxy note 2" the buttons doesn't respond to a quick touch, i need to hold them a little so i get a response. But when i try it in other phones, as a "samsung galaxy 4" or in a tablet, either "samsung tab "A or an ipad(i don't know the model) it works perfectly. I can't find the problem, so i'm not able to fix it. Any ideas why it might be happening?
  8. barbara

    Physics Movement Is Gounded

    Are you using phaser? In that case i think that what you are looking for is: if(sprite.touching.down){ doSomething}
  9. Hi, I'm making platform games with phaser, and to do so i prepare my levels in inkscape, i give a label to each image so when i end it i finally get an .svg document with an x and a y for each labeled element. Then i replace and delete all the useless text with my code editor till i get it in a .json format so i can pass it to my game as a new level. Is a repetitive and boring work, i hate it. So now i'm thinking in write a little "program" or script to do it. What i really don't know is how to pass through a text that it isn't an html or a php. i would prefer to code it with js as is the language i know most, but i'm open to suggestions. I think it shouldn't be so difficult as is only gather some text and creating a new document, but i don't know where to start. Thanks!
  10. barbara

    How to store levels passed in a wordpress site

    Did it! Finally i need to use ajax to load a php page with the conexion to the SQL DataBase and pass the variables in javascript throught the get method. In case anyone has the same problem... Many thanks for your Help! Couldn't do it without you!
  11. barbara

    How to store levels passed in a wordpress site

    Finally i found the conditional code, but now i can't update my sql as i want, these is my code: <script> //Store data in browser cache var lastLevelEnabled; function dataInLocalStorage(){ if(localStorage.lastLevelEnabled){ lastLevelEnabled=localStorage.lastLevelEnabled; }else{ lastLevelEnabled =1;localStorage.lastLevelEnabled = lastLevelEnabled; } } </script> [insert_php] //check if the user is logged with wp code if(is_user_logged_in()){ echo "<script> console.log( 'there is a user logged' );</script>"; //This is how wp gets the user data $current_user = wp_get_current_user(); echo $current_user->user_email; //Connect to sql dataBase $conn = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } echo "Connected successfully".'<br/>'; //Select LastLevel in DataBase $result = mysqli_query($conn,"SELECT gnomeWishLastLevel FROM wp_users WHERE user_login=('$current_user->user_email')"); //Fetch result and show it $resultFetch = mysqli_fetch_array($result); echo $resultFetch[0].'<br/>'; //Here is where i'm trying to store somehow the localStorage in js code in php so i can compare it and store it (i'm doing this in a desperate way, cause if i update here my sql data base i will need to reload the page each time user pass a level) $localStorage =<script>localStorage.lastLevelEnabled</script>; // and here i get an error when trying to update the DataBase if($localStorage>$resultFetch[0]){ mysqli_query($conn,"UPDATE wp_users set gnomeWishLastLevel = localStorage.lastLevelEnabled WHERE user_login=('$current_user->user_email')"); } } [/insert_php] <script> function storeNewData(){ //This function is called from SelectLevelState.js, so every time i pass a level is stored in localStorage localStorage.lastLevelEnabled = lastLevelEnabled; document.getElementById("lastLevelEnabled").innerHTML = "lastLevelEnabled " +localStorage.lastLevelEnabled; //Now i need to store it in mySQL too. i've tried calling a php method but aparently i need ajax for this. } </script> While searching, all i found is that i can't do what i'm trying and that if i want to connect with sql once the page is loaded or call a php method from my js code, i need to do it through ajax. i hope i explained my self clearly, if not ask me, please. Any ideas?? Thanks!
  12. barbara

    How to store levels passed in a wordpress site

    The localStorage works perfecty! Thanks! I'm now able to connect to my sql through php get the informaciĆ³n of a user in the new column for my levels and change it. But i'm stuck in i where hope is the last step. I wanna keep mataining my local Storage for the ones that aren't logged and if they are logged get the information from the sql data base. But i can't reach the conditional code for: if(isLogged){checkSql}else{checkLocalStorage}. I'm using the Ultimate Member plugin i was looking in the docs and i can't find the code for this. Any ideas? Maybe i'm looking at it from the wrong side... Many thanks again!!
  13. barbara

    How to store levels passed in a wordpress site

    Hi BobF, Actually i want to have a login access so i can store each user data for using it and displaying it in each case. But maybe i can take it litlle by little and try to make work first what you told me, i'm still blocked in the same place, i don't know how to pass my data from my main.js where my phaser game is, to my localStorage, so i can keep it and store it in the browser cache, as you are telling me. I understand i can take data from within my wordpress post by using document.getElementById to display it in this same post, but i don't know how to take data from within the main.js wich contains my game and has my level and lives variables. many thanks!
  14. barbara

    How to store levels passed in a wordpress site

    Hi o0Corps0o, Thanks for your answer! I was looking at it, and i think that i can make it work. But, i,m not sure how to pass the data. Inside my wordpress post i have a <div> tag and inside it runs my phaser game. So i need to pass the variables from a javascript file (where my variables are stored) to a php file (my wordpress post) or to pass it from a javascript direct to my sql database. As far as i found i can't do it directly. Do i need ajax to make it work? or i am missing something? Many thanks for your time!
  15. Hi, I'm writting a platform game in phaser, and i want it to have 30 levels. I wanna post them in a wordpress page and i really don't know how can i storage the data: levels passed, lifes left, etc... so i can use it in the wordpress site to show some "leves/icons" as completed and in my phaser game to get this informacion further than the cache data i can pass throught States. My programmer skills are few so i don't even know how to start. Anyone can tel me where to start looking? Many thanks!! Barbara