StanBond's Recent Forum Activity

  • Here is the issue, you set the position everywhere to the starting Burger.StartX

    Edit:

    Here is a quick way of doing what you need.

    But the more easy way would be using the family feature.

  • There's a third party plugin that could help you, or you can use some javascript with the browser plugin or your own to parse it.

    I've tried the Json-to-C2-Array plug in but it throws errors from the start. I'll look into the parsing. That's bizarre that there is no simple way of doing it.

  • When construct 2 generates json file it is sligthtly different than the one that is being generated using php from mysql data:

    {
       ""c2array"":true,
       ""size"":[3,7,1],
       ""data"":[
          [[0],[0],[0], [0],[0],[0],[0]],
          [[1],[-1],[-1],[-1],[-1],[14],[26]],
          [[2],[30],[10],[8],[-1],[-1],[-1]],
       ]
    }[/code:16of4qpq]
    The above is example of json that construct tend to generate.
    
    Here is a json string that is being generated by my php file on the basis of mysql data:
    [code:16of4qpq]{"uemail":"mail","upassword":"password","data":"","level":"1000","nickname":"Rager"}[/code:16of4qpq]
    
    How I can load this type of information, from what I've read, construct 2 only understands the way it generates.
  • > like this?

    >

    Thanks I'll look into this one too

    I've looked into your file, thanks that was great. However, I've a question about it.

    What if I make a square1, add drag and drop to your square2. Whenever I put square 2 overlapping square 1, square 2 should rotate by 15 degrees and then keep on with the rotation taking into account the 15 degree offset

  • Using gamecorpstudio's example, click on the Flashlight, create a container and add the Lightbeam. Make two more copies of the Flashlight. Done!

    Thanks, that's what I've been looking for.

  • everytick = lightbeam.setangle-to:flashlight.angle that should solve it

    or you can use the pin behavior on light and pin it position&angle and will automatically follow the flashalight angle and position.

    here is a capx example v2 using pin

    i updated the toggle of the lightbeam now when you press the flashlight from button to the tail area it toggles the opacity of the lightbeam sprite.

    Thanks but I wanted to achieve something a bit different. As for now you have a flashlight and light beam, what I wanted is to use the same lightbeam on other copies of flashlight, like for example, If i copy the flashlight, set it to rotate by a bit different curve but use the same lightbeam on it. Such as, it moves differently, but light the same.

    And if you want to copy the flashlight and have the new one also have its own beam, use containers <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> https://www.scirra.com/manual/150/containers

    According to the manual this approach creates same object, but I can't manipulate each one of the created objects separately. I would like to animate the flashlight, or change its position independently of all other flashlights.

  • I have a flashlight underneath it I have placed a sprite to simulate the light beam (triangle sprite with reduced opacity of yellow color).

    The problem is, if I copy my flashlight without cloning/creating new object, how can I make it have this light beam also?

    For example, If i'll add drag and drop on my flashlight, whenever I move my flashlight its light cone must move with it.

    I hope this will illustrate it

    At the moment the only option I see is using frames, one without the lightbeam and one with, and switch between them.

  • ..glad to hear..

    > I've managed according to the tutorials to use the local json file through the files folder. Now I would like to try out hosted version of it.I've tried to use the AJAX request http://www.site.com/file.json, but nothing worked...

    >

    so..let's say.. you upload json file on your site

    http://www.StanBond.com/gamefolder/file.json[/code:6tp5f9fw]
    and than you use
    [img="http://lookpic.com/O/i2/997/i48LnMDP.png"]
    in [b]Preview[/b](on localhost) this request will most likely fail & in [url=https://developer.chrome.com/devtools#console]console[/url] you will see something like 
    [img="http://lookpic.com/O/i2/100/UXShPyYF.png"]
    you can bypass this ...with small PHP file(file.php)
    [code:6tp5f9fw]<?php
    header('Access-Control-Allow-Origin: *');
    $myfile = file_get_contents('http://www.StanBond.com/gamefolder/file.json');
    echo $myfile;
     exit;
    ?>[/code:6tp5f9fw]
    upload this in your [i]gamefolder[/i] 
    [code:6tp5f9fw]http://www.StanBond.com/gamefolder/file.php[/code:6tp5f9fw]
    and now  you  request
    [img="http://lookpic.com/O/i2/298/JDWRFZoK.png"]
    
    I really don't know if this is a good way....but works..
    

    I was also worried about the usability of this approach, and as in the most cases there is a need to read generated by the server json, I've decided to assign the json string onto the variable and echo it.

    <?php
    
    header('Access-Control-Allow-Origin: *');
    header('Content-Type: application/json');
    
    $string = '{"c2array":true,"size":[3,10,1],"data":[[[0],[0],[0],[0],[0],[0],[0],[0],[0],[0]],[["Nameless"],[1000],[100],[100],[10],[10],[50],[10],[10],[0]],[[0],[0],[0],[0],[0],[0],[0],[0],[0],[0]]]}';
    
    echo ($string);
    ?>
    [/code:6tp5f9fw]
  • like this?

    Thanks I'll look into this one too

  • I've done something similar

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I assume this is what you've been suggesting:

    Only the first time is doing it the right way, after that it starts to twitch for 1/2 degrees every secound or so.

  • Hello,

    I was trying to build something simple. Camera that moves within the defined angle range. Lets say, I have a camera and I want it to look through the area of 40 degrees, so it will move from 0 degrees to 40 degress wait 1 second and go back to 0 degress and then repeat this process endless times.

    Here is what I've done, I've made a system repeat that every 3 seconds Sprite 1 will set its angle to 20 degrees wait 1 second and then set angle to 0 degrees.

    The issues is that it's not rotating at all, it just jumps between the states from 20 to 0 degrees and I want the came to rotate slowely.

    How can this be done?

StanBond's avatar

StanBond

Member since 11 May, 2016

None one is following StanBond yet!

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies