dop2000's Forum Posts

  • You mean you need to pass a name from the list to php?

    I believe you do this by adding parameters to the URL, something like this:

    AJAX Request Url "https://myserver.com/GetScores.php?PlayerName=" & NamesList.SelectedText
    
    In PHP:
    
    $name=$_GET["PlayerName"];
    $sql="SELECT * FROM scores WHERE name='" . $name . "' LIMIT 3";
    ...
    [/code:3s3ngeez]
    
    I did this many years ago, so not sure if the syntax is correct.. 
    There may be issues with space character, maybe first try testing with one-word names.
    
    There are a few tutorials you can study:
    [url=https://www.scirra.com/tutorials/4839/creating-your-own-leaderboard-highscores-easy-and-free-php-mysql]https://www.scirra.com/tutorials/4839/c ... -php-mysql[/url]
    [url=https://www.scirra.com/tutorials/346/online-high-score-table-ajax-php-mysql]https://www.scirra.com/tutorials/346/on ... -php-mysql[/url]
  • For example your layout is 100.000px long and your screen size is 1024x768

    Make the first 1024px and the last 1024px of your layout look identical.

    Once the player.X>=(100000-1024/2), set its position to Player.X-(100000-1024)

  • Why can't you just pick instances of sprites B with low fuel?

    B fuel<10 -> B find path to yellow spot

    If you want to differentiate objects in the family, the easiest way is to add another instance variable objectType to the family. When sprites are created, for sprites A set objectType="A", for sprites B set objectType="B".

    Then you can do this:

    Family objectType="B" -> Family find path to yellow spot

    and Family fuel<10

  • For "y"=0 to array.width-1
       For "x"=1 to array.at(loopindex("y"))  -> system create sprite at ( loopindex("x")*50, (loopindex("y")+1)*50)
    [/code:eizhips2]
  • The first line in your php retrieves 100 top scores. If John Doe is not in the top 100, his score will not be shown.

    If you want to display first 100 plus John Doe, you need to first retrieve 100 top scores, and then get one or several highest scores for John Doe:

    SELECT * FROM scores WHERE name='John Doe' ORDER BY score DESC LIMIT 1[/code:vknipp8z]
    
    Or modify your SELECT statement, probably to something like this:
    [code:vknipp8z]SELECT....TOP 100 
    *UNION* 
    SELECT ... WHERE name='John Doe'...[/code:vknipp8z]
  • I believe it's not possible with just one boolean instance variable and nothing else.

  • kriand

    "every 0.1 seconds" is not much better than every tick in this case. Before using "acquire target" you need to check that this turret does not have any targets already. Or simply use "Add object as target" once and the turret will acquire them automatically.

  • kriand , What is "2"? Did you mean setting animation frame to 2? But this will skip frame 1.

    DarthPapalo666

    If your animation is not looping, you can make this event with 3 conditions, it will only be triggerred once:

    Sprite On animation frame change

    Sprite Animation frame =0

    Sprite is animation "Name" playing

  • Be careful though, if you have multiple instances of sprite, with "System->Trigger once" it may not work as expected.

  • Oh, so you quickly pour a large amount of water onto one spot, and then it flows down to lower levels. Got it.

  • Your array2 values contain line break (newline) in front.

    use trim() expression when putting text values into the array, it will remove all invisible characters - spaces, tabs, line breaks.

  • There are a few tutorials about using turrets, study them.

    https://www.scirra.com/tutorials/all

    You can add objects to turret's target list at start of the layout, then they will pick targets automatically, once they are in range.

    If you want control over which targets they should shoot at (for example to prefer stronger enemies), you can use "Acquire target", but you need to make sure that turret doesn't already have a target.

  • You can add Persist behavior to those 4 text boxes, add instance variable UseCounter.

    textBox Pick Lowest UseCounter

    ...System Pick random instance of textBox -> TextBox add 1 to UseCounter ; TextBox Set text

  • Try Construct 3

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

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

    Squares of different color mean different height above the sea level, right?

    I don't understand, why is water flooding light red and dark red squares at the same time?

    Shouldn't it fill the lower level squares first?

  • You can try this:

    Turret NOT has target
         Enemy instVariable="specific value"   -> Turret acquire target Enemy
    [/code:p1s27k1s]
    
    If you have "Add turret target Enemy" event, you need to remove or disable it.