Aphrodite's Forum Posts

  • Construct 2 will try to tie the logic of the game to the VSync I think, which maybe is limiting the actual precision you need, also, the browser may take a little time to actually play the Beat sound when you command it to do so. I do not know if the sound playing is tied to the app framerate (and furthermore I 'm not sure the actual triggers can run between ticks), so the precision needed in your case might not be possible to achieve (I'm not sure of that, hope someone else can confirm or revoke it), also, What is a BPM? (Beat per ..?).

  • Aphrodite I like that algo you found there. Inspired I found a way to extend it beyond 32 elements. The idea is to use another array of 1's and 0's instead of just a number, and update the array with a simple function to add 1 in binary.

    https://dl.dropboxusercontent.com/u/542 ... count.capx

    It looks like counting sums of zero works, but it's also counting the case of none of the numbers added together. That case could be discarded by not using it when loopindex=0.

    Edit:

    Under further tests something seems broken with my capx.

    R0J0hound

    I didn't fully understood the capx (didn't had much time to look at it today), but instead of using an array of 0 and 1, why not taking int(Array.CurX/(2^loopindex))%2 instead of the getbit, I think it does the job over 32 elements(unless I got my math wrong).

    Also by adding a condition "loopindex > 0" at your 11 event, it does not add the empty case for 0.

    EDIT: Tried with 9, indeed not all solutions are found

    Edit2: I begin to see the concept, your bits array help to choose the values to show it seems, I'm still strugling to understand why no all values are counted though

  • I agree with r0j0hound, about the fact that it is not because it is easy that it shouldn t be included:

    First: readeability, just reading Sign() is explicit enough, contrary to the other expressions we can set up for it

    2nd: I had more trouble doing it that doing a lerp with expressions, because of the 0! And it is easy to forgot for a non mathematician guru than 0/0 does not exist (lerp does not need any conditionnal, it is a simple calculation, while Sign is not a calculation, but an evaluation at the end)

  • I think the order is guaranted (aka : read your main event sheet in the good order, if you come across an include when you are reading, read that included then come back), but I am not sure if I actually tested this or if I considered true by default.

  • https://www.scirra.com/tutorials/247/ho ... ork/page-1

    This should get you started, but normally by exporting and testing on your device, performances can be different (generally better than previewing so not too worrying)

  • Hi guys,

    i wanted to know if there is something like an "Or" action/expression

    For example:

    If Player1 OR Player2 touches HealthPotion ---> Touching Player Health +1

    Something like that

    Im trying to add some potions and when the player gets the potion, the variable Health goes up by 1.

    In that case, it is more the families that are involved, Player_Family is overlaping Potion (but it is a pro feature, as others have said, an OR block to test : Player1 is overlapping Potion, OR Player2 is overlapping Potion works too)

  • Currently I have made a function that'll return the number of sum that give the wanted result (except if the value wanted is 0):

    of course now the thing is instead of returning number_of_sum, it should return a string corresponding to what we want, and to consider the 0, I'm working on that (also I think getbit makes it so you cannot make it work on an array > 32 in width, of course we can still use other techniques I think)

  • Try Construct 3

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

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

    abs(x) / x

    and then 0 came x)

    for that I'd use the function object, or directly (x=0?0:abs(x)/x), but I agree that a sign function returning -1, 0 or 1 would be kind of nice for readeability.

  • I think you'd have to try every single combination to do this, which can add up a lot:

    In you exemple [A, B, C, D] for a value Z, you have to compare I think 16 sums, there may be a way to do it (like excluding some of them if they cannot work, for exemple if the sum of all positives values cannot reach the number or above it, then no sum will be able to), but the basic concept is this I think. I hope there is an easier way

    you could maybe try a repeat loop (16 times):

    compare Z = A*((int(loopindex/8))%2) + B*((int(loopindex/4))%2) + C*((int(loopindex/2))%2) + D*(loopindex%2)

    intested but this should try all the sums, (it will also compare Z to 0 the first time)

    EDIT: glad you figured it out, I should have though of using not only one loop though.

  • It seems to affect the minifier (like a file cannot be created it seems), were you able to export before?

  • You can do an empty sub event under the function, and put the actions into it.

  • The tilemap object is one big object, I don t think in C2 you can move one tile (since what defines a tile is it's X and Y position on the tilemap), what could be done potentially would be to compare each tile, and when you encounter a particular tile, you create a sprite over it, and destroy the tile then, this operation would have to be done on the start of layout (maybe it can also work on the tilemap trigger condition "on created", but not sure about that)

  • Just add the browser object (like you would add a new sprite or tiledbackground), and you will be able to use it.

    https://www.scirra.com/manual/110/browser

  • actually lerp(a, b, x) should have the x parameter variying, not the a parameter (it is a simple linear interpolation by defining a 0 to 100% value), it just happens that it do something else the way you (and not only you) are using it (I think this is called a geometric progression), but in your case:

    -did the angle moved too slowly? (since 0.9*dt is a very low value, it will stay relatively close to Self.angle, and so self.angle won't vary that much even at the beginning), maybe a 0.5*60*dt will be more noticeable (it should be half way of it's current position 1/60 of seconds later).

  • This tutorial may help you: https://www.scirra.com/tutorials/318/ho ... ng-screens