R0J0hound's Forum Posts

  • You can do angleDiff with this expression:

    a is first angle

    b is second angle

    AngleDiff = acos(clamp(cos(a)*cos(b)+sin(a)*sin(b), -1, 1))

  • Try using a variable as a countdown. Two events and you're done.

    http://dl.dropbox.com/u/5426011/examples%208/sully.capx

  • The cause:

    The slowdown is due to the creating and destroying of Array objects. I was able to reproduce it in a simple capx that did just that and the fps degraded over time.

    The reason:

    I don't know really, maybe it's caused by object recycling, but that would be odd since that works flawlessly with sprites.

    A solution:

    You can redesign the algorithm you're using so that you don't have to create and destroy any objects at all.

    Here's my attempt at it using one DataStructures object. Only the heros movement is recorded and the allys are positioned at distances down the path.

    http://dl.dropbox.com/u/5426011/examples%208/jumprock.capx

    cheers

  • In the mean time a number variable could be used. 0 for flase, 1 for true.

  • o you could never have an action that said something like:

    Cat(2).my_instance_variable = Cat(1).my_instance_variable.

    Well, yes you can, what I typed was quite literal, "Sprite(1).X" is an allowed expression:

    http://dl.dropbox.com/u/5426011/examples%208/inst_ex.capx

    A bit more info:

    Sprite(1).X

    will always give the X position of the second instance of sprite, (not the second picked).

    When families get implimented it would look like this:

    Make object "Sprite" part of a family called say "Blue".

    Then with events Blue is just another selection of Sprite, so you can pick two separate instances of Sprite.

    + Start of Layout:

    + Sprite: Pick Instance with UID: 22

    + Blue: Pick Instance with UID: 34

    ---> Sprite: Pin Pin to Blue

  • If there are two Sprite instances their values can be accessed with Sprite(n).

    Ex.

    Text: Set Text to Sprite(0).X + Sprite(1).X

    In the case of your question, it will be simple to do when families are implemented, but at this point you'll have to resort to events instead of using the pin behavior as a workaround.

  • R0J0hound you should really integrate the PasteDelete stuff officially...

    I won't integrate it, because it will only work with the Sprite object if it's effect is set to "none". If the sprite uses any other effect PasteDelete won't work right. It also won't work with TiledBackground or Canvas objects either.

    Just give whatever object you want to delete from the canvas a "destination out" effect before pasting it.

  • It looks like there are two instances, so you need to find the second. Make sure all the layers are visible and have "parallax in editor" for each layer set to no. Then search the layout.

  • There are no instances of that array object on your layout. When there are no instances the expressions default to 0. The only solution at this point is to delete the Direcciones object from the "object types" folder and create a new array on the layout.

    Ashley

    This situation is pretty easy to reproduce.

    1. Create Array.

    2. Delete Array from objects bar.

    At this point Array only exists in the "object types" folder, and there is no way to add an instance of it to the layout.

    Could a solution be to allow dragging Array from the "object types" folder onto the layout if there were no instances of it already there?

  • Store the walls in an array and flood fill the area outside the walls, then any place that isn't filled create a floor sprite.

    I made an example capx but then noticed that this was in the CC section. I'll post it anyway since it doesn't use anything that CC doesn't have.

    http://dl.dropbox.com/u/5426011/examples%208/fill.capx

  • Add an "every tick" event at the end of the event sheet with a "scroll to Camera" action. That removes the major jitter.

  • Just use the "Compare instance variable" condition to pick a certain instance.

    The event will look like this:

    Sprite: testvar=1

  • I was going to say that you would need to use events for that but then I found a solution:

    for i in range(5):
       System.Create("chain", 1, Sprite.X + i*32, Sprite.Y)
       SOL.chainPhysics.DisableCollision("Sprite")
       if i == 0:
          SOL.chainPhysics.HingeToObject("Sprite",0,0)
       else:
          prev_chain.HingeToObject("chain",0,0)
       prev_chain=SOL.chainPhysics[0]

    It attaches the first link to the sprite object.

  • Try Construct 3

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

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

    execfile(System.AppPath + 'Data\py\array.py')

    or

    exec(open(System.AppPath + 'Data\py\array.py'))

    instead.

  • This will work just like zeropad(n,8):

    left("00000000", 8-len(str(n))) & n