MPPlantOfficial's Forum Posts

  • Create global variable: IS_PAUSED.

    IS_PAUSED = 0

    Put All in-game events under this

    Pause button is pressed | Set IS_PAUSED = 1

  • A ? B : C is called ternary operator.

    It basically means "if A is true, then B, else C"

    I see. Thanks for explaining.

    For each chain ordered chain.index*dir

    --- do stuff

    For each chain ordered chain.index*-dir

    --- do stuff

    I used equations to cram it all together. It probably would be more readable utilizing functions. Maybe.

    Nice! I'm learning new stuff everyday!

    I was actually going for that approach as well however I did not know how I would be positioning the chainlinks for the second loop using their second image points as reference points.

    Thanks again, guys!

  • Fixed end version. Basically pulls one way, minus the last, then pulls the other way.

    https://www.dropbox.com/s/ecjsc9mmn509i ... .capx?dl=1

    Excellent capxs guys.

    I don't know what's happening here:

    chain.index*(loopindex("i")?-dir:dir)

    particularly the ("i")?-dir:dir part but I'm gonna study this example.

    It's impressive how you managed to do it without a second image point for the links as well.

  • Basically think of Chain Chomps from Mario / Zelda WITHOUT the gravity.

    As you can see, each link follows the head but stays grounded on the opposite end.

    If this is a nightmare to program now, how much more back then? XD

  • Sorry, I didn't modify your capx, it's too complex.

    Oh I forgot to specify.

    I actually wanted one end to be grounded while the other one moves. That was the challenging part.

    I imagine it'll take something like 2 loops constantly following the moving chain while the "grounded" end "tugs back" at the same rate when max distance is exceeded.

    Speaking of which, I could start there:

    RedBox/Greenbox is dragging

    Distance Bar greater than or equal to [cumulative lengths of all chain links] | [some code to keep opposite box grounded.]

    This was my initial struggle

  • Here is what I came up with:

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

    The code is quite dirty and can be optimized, but I hope you find it helpful.

    Gold! Sorry didn't reply earlier. I haven't gotten the chance to check back immediately.

    Thanks again! <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

  • This is something I still haven't figured out after a year.

    R0J0hound do you mind taking a look at my Capx?

    I have a problem getting the links of the chain to link at the opposite end.

    I've tried revolute joints but this isn't really a capx that needs physics.

    Capx: https://www.dropbox.com/s/4zaon4bgge5s1 ... .capx?dl=0

  • What about giving each object a "Bullet" function reactionary.

    Every tick > Set Object.Bullet.Angle to -angle(self.x,self.y,char.x,char.y)

    For each object

    If dist(self.x,self.y,char.x,char.y) > mindist

    Set Object.Bullet to enabled

    else

    Set Object.Bullet to disabled

  • Try Construct 3

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

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

    Yeah! This is pretty good. It doesn't have the jumpy effect like when I try to combine sine + displacement every tick.

    Thanks a lot!

  • Hi guys. I want to create sort of a "WHITE NOISE" effect with the lines of my sprite.

    In the capx below are my attempts at creating that effect on sprites.

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

    FACE 1 is the base animation of each face

    FACE 2 uses controlled double sine to simulate shaking effect. can be moved using WASD

    FACE 3 uses REX'S SHAKE PLUGIN. can be moved using UDLR

    Now as you can see in both picture and CAPX, the white noise simulation looks better on FACE_2.

    However it cannot be smoothly implemented as setting its position relative to a point every tick results in it not moving at all so I'm forced to set FACE_2 position every X seconds and this results in a pretty bad, Atari-looking displacement.

    Basically, I want FACE_3's shaking along a point but with less intensity that what it currently has. Is there a separate effect for shaking where you can control the parameters of the the shake? What other solutions would you suggest?

  • [quote:3lk42j0s]If indicator overlaps with a block that's DISABLE = 1, it would get reassigned to block.FALLBACK

    What if that block is also disabled?

    Manual instavar assignment per block. All Fallback blocks are activated. Or at least they should be. I haven't worked on the CAPX yet

  • Here you go:

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

    I think it works pretty well.

    Cool. Thanks. By the way another solution I made was simply to assign 2 instavars on each block.

    The instance vars are:

    DISABLE = 0/1

    FALLBACK = varies.

    If indicator overlaps with a block that's DISABLE = 1, it would get reassigned to block.FALLBACK

    However with this example the fallback block is 1-way so it might be ideal to create 4 fallbacks for each direction just like in your example. Thanks again.

  • Just a though - maybe you could do this without the array, using Pick Nearest event.

    If Right key pressed:

    First try to Pick Nearest green sprite, which is on the same row (sprite.y=current.y), and which is to the right from the current (sprite.x>current.x)

    Else (If none picked):

    Pick Nearest green sprite, which is to the right from the current (sprite.x>current.x). Nearest from any other row will be picked.

    EDIT: When using "Pick nearest" with other conditions, "Pick nearest" needs to be the last in the list:

    Trying a different solution right now. I'd love to see your solution in a capx though

  • Hi guys. I'm having a problem with some seemingly basic grid problem. I have built a capx before enabling the pink square to be move from square to square with ease using a single instance variable for my indicator sprite but right now I'm faced with a different challenge.

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

    First of all, I want the black squares in the image above to be totally different sprites thus my existing capx won't be applicable in this situation. In the image, only the green squares are selectable.

    So the movement I want would be say I'm at A2, pressing right = A3

    B2 pressing RIGHT = B4

    A2 pressing DOWN = B2

    A3 pressing DOWN = B4

    B4 / B2 pressing DOWN = C1

    E5 pressing UP = D1

    B4 pressing UP = A3

    And so on. How would I go about this? This seems like it should be simple but somehow I'm at a plateau <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

  • In that case just look through the capx's in the examples folder and see which ones can be presented as they are.