Bl4ckSh33p's Recent Forum Activity

  • Good to know I am not the only one with this problem.

    But it seems to happen less often if you close all projects first.

  • Hi. I have a solution for my problem now. :)

    foreach ($user_array as $nr => $inhalt) { 
            // Compare current item to the posted information 
            if($user == $inhalt["User"] AND $serial == $inhalt["Serial"]) { 
                // The current user matched, return info and exit 
                echo md5($user).md5($serial).'::'.$installed; 
                exit; 
            }  
    }
  • Hi! I only know a few basic things about PHP and tried to get this to work for hours but it just does not work.

    So I want to ask if someone here might be experienced with PHP. If you know it this should only take a minute or two for you to figure out. :)

    I have a nested array. Its just a list like this

    array[0]["Name"]="Alex";

    array[0]["Serial"]="12345";

    array[0]["NIC"]="1dA21n";

    array[1]["Name"]="Roland";

    array[1]["Serial"]="1337";

    array[1]["NIC"]="uR0ck";

    and so on...

    and I want to compare the entered value submitted with HTTPPost to all array entries with a foreach loop. But I can't figure out how to write this loop properly. <img src="smileys/smiley18.gif" border="0" align="middle" />

    The original code:

    <?

    // Check for post data

    if ($_POST)

    {

        // Initialize user array in format "Username"=>"Serial"

        $user_array = array(

            "John Doe"=>"abc-def-ghi",

            "Jane Smith"=>"123-456-789"

        );

        // Get info from post variables

        $user = $_POST['user'];

        $serial = $_POST['serial'];

        $installed = $_POST['installed'];

        // Step through the user array

        foreach($user_array as $username=>$serialnumber)

        {

            // Compare current item to the posted information

            if(($user==$username) AND ($serial==$serialnumber))

            {

                // The current user matched, return info and exit

                echo md5($user).md5($serial).'::'.$installed;

                exit;

            }

        }

        // If this script makes it this far, nothing matched, return error code

        echo -1;

    }

    else

    {

        // no post data was sent, return error code

        echo -1;

    }

    ?>

    I changed the array and added another POST variable.

    I tried several things from the php manual and php tutorial sites like:

    foreach ($user_array as $type => $properties) {

    // $properties = $GodArray[$type]

    foreach ($properties as $property => $value) {

        // $value = $GodArray[$type][$property]

        //echo $property, "=", $value, "<br />";

                 if(($user==$username) AND ($serial==$serialnumber) AND ($nic==$nicid)

            {

                 //The current user matched, return info and exit

                echo md5($user).md5($serial).md5($nic).'::'.$installed;

                exit;

            }

         

    }

    }

    or:

    /*

    foreach ($user_array as $nr => $inhalt)

    {

        $username[$nr] = ( $inhalt['User'] );

        $serialnumber[$nr]   = ( $inhalt['Serial'] );

        $nicid[$nr] = ( $inhalt['NIC'] );

         echo $username.$serialnumber.$nicid;

    }

    */

         

    or:

        // Step through the user array

        //foreach($user_array as ($username, $serialnumber, $nicid))

         

         //foreach ($user_array as $v1) {

        //foreach ($v1 as $v2) {

        //    if(($user==$username) AND ($serial==$serialnumber) AND ($nic==$nicid)

        //    {

                // The current user matched, return info and exit

        //        echo md5($user).md5($serial).md5($nic).'::'.$installed;

        //        exit;

        //    }   

        //}

    //}

        //{

            // Compare current item to the posted information

            //if(($user==$username) AND ($serial==$serialnumber) AND ($nic==$nicid)

            //{

                // The current user matched, return info and exit

            //    echo md5($user).md5($serial).md5($nic).'::'.$installed;

            //    exit;

            //}

        //}

    But it puts out everything in one line (all data from every array entry) or I get an syntax error with missing , ( or {.

    Does anyone know how to do this? Any help would be very much appreciated.

  • Great! Got already 3 fantastic new game titles I have to make. <img src="smileys/smiley36.gif" border="0" align="middle" />

  • I found this when browsing for some art on opengameart yesterday. <img src="smileys/smiley1.gif" border="0" align="middle" />

    It's a nice bundle with sprites and music. Thanks for sharing.

  • Hi. Is it possible to download the capx file for this? I tried to add controller support to my new game but it does not seem to do anything. But in your demo everything works fine. But it would be great to see what you did different.

  • When I created my first game Moon Raccoon I had a similar issue but the sounds "came back" after playing the level for a while.

    Did you try to use the Audio > Preload action? I used it on the title screen to preload the sound effects and it worked for me. It plays the music and sound effects from the beginning now.

  • Hi! I have finished my very first game. It was just for fun and to learn how Construct 2 works, so don't take it too serious please.

    You can play it on clay.io and if you create an account you can earn achievements and compare your highscore against other players.

    I will update it to v1.1 with a few minor fixes and improvements soon.

    Thank you very much to all who answered my beginner questions in the forums here. <img src="smileys/smiley1.gif" border="0" align="middle">

    Moon Raccoon Minisite

    Play now!

  • Hi. You could try to add a sprite with the same angle as the cone and pin it to the object with the Line of Sight behaviour?

    But a builtin feature to show it would be nice. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Hi. You could try to use a global variable as kind of switch maybe?

    If the var is set to 0 (false) music stops, if it is set to 1 music plays. But I did not try this, yet. Just an idea that could work.

  • I will try this tomorrow, thanks. (But I did not use any physics)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi. I added the CocoonJS object to my new game and tried to preview it via Wifi but I get about 100 errors when trying this.

    It says: "Cannot open the javascript file "preview_cocoonjs_postlude.js": NSURLErrorDomain and Ressources cant be found.

    Now I tried to copy the exported .zip to my iPod with iTunes to open it in the cocoon launcher but I get a black screen and the launcher crashes every time.

    But the game is only 2 layers with 400 tiny star sprites (white dots) and the layout moves right (scroll to X) to simulate moving stars and a soundfile plays in the background.

    Does anyone know how I can fix the wifi preview or crashing launcher on my iPod (4th gen)? I downloaded the CocoonJS Launcher from iTunes about 30 minutes ago so it should not be outdated?

Bl4ckSh33p's avatar

Bl4ckSh33p

Early Adopter

Member since 20 Jul, 2013

Twitter
Bl4ckSh33p has 5 followers

Connect with Bl4ckSh33p

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • x3
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x7
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x2
    Lightning Draw First person to up-vote a new Construct 3 release
  • x4
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

21/44
How to earn trophies