Allardje's Recent Forum Activity

  • Update: i see everything manually works.. So my guess is that something is blocking my request.

    I did use the:

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

    But to bad without result.

    Here is my complete script:

    <?php
    header('Access-Control-Allow-Origin: *');
    
    $dbhost = '';
    $dbuser = '';
    $dbpass = '';
    $conn = mysql_connect($dbhost, $dbuser, $dbpass);
    if(! $conn )
    {
      die('Could not connect: ' . mysql_error());
    }
    
    $name = $_GET['name'];
    $highscore = $_GET['highscore'];
    
    $sql = "UPDATE hiscore SET name = '$name', score = '$highscore'";
    
    mysql_select_db('*****');
    $retval = mysql_query( $sql, $conn );
    if(! $retval )
    {
      die('Could not update data: ' . mysql_error());
    }
    echo "Updated data successfully\n";
    
    // close connection 
    mysql_close($conn);
    ?>
    

    Oh ps.. Ye i know somehow i made my database "hiscore" instead of Highscore.. So i'm aware of that it's not a typo ;-)

  • Hi all,

    Still bugging around with AJAX.

    All my requests etc are working but now i actually want to write my data to a DB.

    At this very moment i do not care yet about safety so..

    All i want to do is write a name and score to the DB. My PHP script works fine, my AJAX post works fine also.. But this is if i manually input the name and score.

    What i do have:

    <img src="http://www.pixentral.com/pics/1sS5LxdqBWrbk0vRk2qMP4lKorZ.jpg" border="0" />

    Can any one explain to me why this is not working?

    So again,

    If i change the link and input the name and score myself it does work. So somehow it will not get my username.Text and/or the global variable; Score

  • Omg i'm so stupid. Just lost it lol..

    On "TAG" completed is the way to go.. Just the normal function pfff...

    I should really quit for today Ghehe

  • Hi all!

    I got 2 different ajax requests with 2 different tags.

    Now my question is.. How can i get the right TAG with a Ajax.Lastdata request?

    I did look alot online for the right awnser but i can't find it :(.

    So i got:

    Request: TAG1

    Request: TAG2

    And all i can find is Ajax.Lastdata

    Is there a way like: Ajax.Lastdata("TAG1") , Ajax.Lastdata("TAG2")??

    Thanks in advance!

  • Hi all!

    i've got a problem.

    I created a app which randomly spawns objects and float from right to left.

    Works great when i preview it on PC.

    Once compiled with Cocoonjs it works at the start. Once hitting a program it just wont continue..

    Is there a know issue with not proccessing groups?

    It all goes well till it has to active some groups?

    I am using: Canvas 2D/WebGL

    Found out i have the same problem with PhoneGap

    Thanks in advance!

  • Hi all,

    Let me be clear on this one. I use my global variables as a kind of gamesettings when a game start. For example the time to spawn a object.

    This is different in every level with the same layout.

    One layout which can be seen as the game frame. In that layout i check which level is selected, and than i insert the information needed for that level. So again for example the spawn speed.

    This isn't hard to reach, what i was aiming for was the best way to do this.

    I learn everyday with CS2 and if i check the difference between my start period and now i already know alot more to save events etc.

    So sometimes i'm just not sure what the best way is to do something.

    Though all methodes above are pretty small and would work great.

    Thanks all!

  • Hi,

    Yeah i was afraid so. I actually did that. The same way as including the sheets so i can use my sheets as level variables. Works perfect but global variables would be much easier to modify.

    Well thanks! I continue using the method i used and you just told.

    Thanks!

  • I do not know what you mean for sure.

    What i got now is eventsheets like:

    Eventsheetlvl1

    Eventsheetlvl2

    And on the layout i do it like:

    if level = 1 include Eventsheetlvl1

    if level = 2 include Eventsheetlvl2

    Thats works great, but i can not use duplicates of global variables.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi!

    I want to know if it is possible to use mulitple global variables with the same name in different event sheets.

    I got a game with different levels.

    Seperated in:

    Level 1 = EventsheetLevel1

    Level 2 = EventsheetLevel2

    etc..

    I want to use global variables in both event sheets with the same name but i can not make duplicates.

    Can any one tell me how i am able to do this?

    One way i can think of is including all global variables in one sheet, and in the different sheets set the global variables.

    So it would be:

    EventsheetLevel1

    SET GLOBALVARIABLE1 1 = ....

    EventsheetLevel2

    SET GLOBALVARIABLE1 34 = ....

    That way it is possible but the way to edit it is way more time taking than just normal global variables.

    Thanks in advance!

  • You sir, are still a legend :)

    Thanks alot!

    Though it did not work 100%. But yet, i just needed to know the technique behind it.

    What i had to do was to change the boolean to a value and instead of false and true i had to use 0 and 1. This way i could compare the values.

    Again. It works like a charm now! Kudos!

  • Hi! Long time ago yet i got a question about this!

    I had alot of help from the "Whack-a-mole Advanced"!

    Though i have a question. Is there any way to check if a "hole" is filled? And if yet do not spawn a new mole there?

    Thanks in advance!

  • I also now updated my first post with a link to the result.

    Thanks guys!

Allardje's avatar

Allardje

Member since 25 Jun, 2013

None one is following Allardje yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies