99Instances2Go's Forum Posts

  • I always forget that angles increase/decrease different around zero point.

    I also wanted it to work flawless when the dude jumps.

    So i used a little trick.

    https://www.dropbox.com/s/z1jpen8tjubn3 ... .capx?dl=0

    Hope it brings you somewhere.

  • rotate towards min(the_angle, max_angle)

    min() = take the lowest of both values

    the_angle = angle towards mouse

    max_angle = the maximum that you allow it to rotate

  • FreeWolf

    Their youtube channel is awesome.

    https://www.youtube.com/user/BrashMonke ... onstruct+2

  • Did you try this ?

    Use Else.

    if level <= 1 ...

    Else if level <= 2 ...

    Else if ...

    Put an 'else' in the blocks containing that 'Webstorage key ?" (except in the first one)

    Same with spawning in the other order.

    https://www.dropbox.com/s/xupduervio26y ... .capx?dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think that it is a clear case.

    http://pages.ebay.com/help/policies/lis ... cript.html

  • Got to save it as a single file, and share that file.

    File menu > Save As Single File ...

  • I believe that if you use "Request URL', URL can be the (exact) name of a project file (in a string).

  • At this moment, both are fine to use.

    XML has that one benefit, it is easy to edit outside C2.

    At a point in the nearly future (c3), Arrays will have their own 'value editor'. That will make things a LOT nicer. And bring the preference to using an array, i think.

    If you choose for XML, there are a lot of tuts to help you.

    https://www.scirra.com/tutorials/810/xml-example-20

    https://www.scirra.com/tutorials/354/xml-parsing

    There is also a template (when you make a new project, type XML in the search line)

    If you choose for an array. Then specific for your question ....

    You dont need the 'order', because the 'order' is already the same as the index on the X axis.

    Far more easy is to start with an empty array, as in this example.

    https://www.dropbox.com/s/lgad47eunduh6 ... .capx?dl=0

    As you see, at this point is constructing the array tedious. If you have a lot to create, you are better of using XML.

    But, that will change in the near future. And i am (personalty) very happy the new array editor.

  • Reverse the events and use else

    score > 4000

    ______ got to level 4

    Else

    score > 3000

    ______ got to level 3

    Else

    score > 2000

    ______ got to level 2

    Else

    score > 1000

    ______ got to level 1

    If 'score > 4000' then 'score > 1000' is also true, but it will not run.

    'Else' runs only if the previous condition(s) did not run.

  • Now, lets assume that the enemy is in the 'no go zone'. How do we get there ?

    First we need to know which angle to the 'go zone' is the most close.

    Left = (wind.angle - 180 - 45) - (angle(boat.x,boat.y,enemy.x,enemy.y))

    right = (wind.angle - 180 + 45) - (angle(boat.x,boat.y,enemy.x,enemy.y))

    anglediff(left , boat.angle) is smaller then anglediff(right , boat.angle)

    ____ turn boat left

    Else

    ____ turn boat right

    When the boat (turning should go reasonable slow) is at the destination angle (left or right), we can again measure and make a new decision.

  • If i understand right. Then you want to know if the enemy is in the 'no go zone' or in the 'go zone'.

    When the window blows in a direction (d) then ....

    if you take any point in that direction (can be position of the boat) and you face towards the source of the wind (d - 180) ...

    then the 'no go' zone is between 45 degrees to your left and 45 degrees to you right.

    Any other direction is the 'go zone'.

    Or, said another way, standing on the boat, facing direction the source of the wind, the 'no go' zone is between 45 degrees to your left and 45 degrees to you right.

    So, using System > Is between angles ... you can NOT sail to the enemy if ...

    Angle = angle(boat.x,boat.y,enemy.x,enemy.y) .... (standing on the boat ... looking at the enemy)

    First angle = wind.angle - 180 - 45

    Second angle = wind.angle - 180 + 45

    Using an 'else' gives you the 'go zone'.

    System > Is between angles

    Else

    ________ the actions

    I guess an invert works too. I did not test this. Code is only in my head.

  • This would not work if the created sprites aren't added to the family to be pickable until a top level event ?

    (Thats is just a question)

    https://www.dropbox.com/s/u23pivjynifv9 ... .capx?dl=0

  • I think that the 'sprite.count' expression always counts the newly created objects.

    'Sprite.PickedCount ' Is not counting in the newly created objects before using a new root event, because it depends on a pick condition. 'sprite.count' Does not depend on a pick condition.

    That "create object scope", you talk about, is all about not able to pick newly created objects. (except by UID) before the next root event.

  • https://rexrainbow.github.io/C2RexDoc/c ... awayl.html

    plugin-system-date-and-time_t63492

    With that plugin you can write 'current time' to the local storage, on the right moment.

    And retrieve it as 'away time' the next time the game starts.

    In the topic about the plugin you also find a plugin to translate the stored 'numbers' to readable dates, hours and second.

    It always comes down to that principle. Store current time somewhere, retrieve & calculate.

    You can do this with out a 3th party plugin, use local storage and some way to get the current time.

    Like : https://www.scirra.com/tutorials/940/ho ... -a-project

    Now, If you dont trust the user, they can set their clock as they wish, then you need to get the current time from another source than users device.

    You can use php to communicate with a time server, but i did not learn that yet myself.

    And, you need to store that time outside the users device, another thing that i did not yet do myself.