Sumyjkl's Recent Forum Activity

  • When you press A, have something like this:

    if random(100) < critical chance >>> Do critical animation

    else >>> do normal animation

    Basically is calculates a random number random(100) and if that number is inside your critical chance then it is a critical hit.

  • Thanks so much! I'm not entirely sure how, but it works, and it's awesome.

  • Hi there. So I was wondering about this for a while, how do I set the angle of an object to it's angle of motion?

    I have the feeling that it would be:

    tan(a) = y/x

    ∴ tan(velY/velX)^(-1) = a

    But that doesn't seem to work very well at all, possibly due to being negative or positive, I'm not sure. There's also the x ≠ 0 problem. I would think then that it would be tan(abs(velY)/(abs(velX) + 0.0001)) = a or something but I'm hesitant to try that one out.

    I'd rather not learn how to deal with vector, but if it comes to that, oh well.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can just make an instance variable and subtract dt from it, and when it's <=1 reset to random(n) + x where x is the base time, and random(n) is the variability.

  • Hi, so I have a huge problem, and I can't seem to figure it out.

    I have several layers for different things, like one for objects, one for walls, one for lighting etc.

    The problem I have is that I want the lighting (or the black part which overlays the other layers) to only affect a certain layer.

    Basically this:

    [attachment=0:1pj5rpah][/attachment:1pj5rpah]

    Note how the darkness from the lighting does not affect the background (white in this case).

    I've been messing around with so many different combinations of blend modes it's ridiculous.

  • The for each seems to work, not sure why since it only seems to be instance problems when it does the same thing to everything.

    [attachment=0:1wel0gaw][/attachment:1wel0gaw]

  • What is the 'hpMissle' variable for, what other events change that?

    Otherwise, try adding a for each. I doubt it would work for something like this, but it might if your 'Hurtables' have different hp values.

  • I was more considering that like I have done in my project, you make the third family contain all the relevant behaviors. You would still need to differentiate between them though, but it's the cleanest way I have found so far.

    Also, you could use A or B to then select the same object in the third family, using a similar method:

    pick family3.UID = familyA.UID - - > action

  • If you mean differentiating between two families you can do that by picking the UID of the object that is equal to the UID of the other family.

    E.g.

    Pick familyA.UID = familyB.UID - - > [action]

    Not sure that's what you're trying to do though.

    Having the same variable for both families could be achieved by having another family dedicated to all the variables shared by the objects, but that's not the best and certainly not the most efficient way of doing that I suppose.

    Transferring the variable to the other family could get really messy by the way.

    Edit: Also, the above method would mean needing to do this differentiation condition every time you wanted to change the variable in an event for only one family.

  • 65.2 hp per heart. You could use a tiled background and set the size to (hp/65.2*[heartwidth]), and then round up to the heartwidth.

    Edit: To round up to 16: width = int(Sprite.HP/65.2)*16

    [attachment=0:3ex93ms4][/attachment:3ex93ms4]

    To change the amount to round to you can change the multiplier, e.g. for half hearts, use int(Sprite.HP/65.2*2)*8.

  • What are you trying to do? Is this similar to some retro space shooters? Are you walking on a platform or suspended in the air? Do the objects follow you only after a certain point?

    If this is suspended in the air, that's easier than above. You have them spawn, they drop automatically, you dodge them.

    Also, if Sargas is right, then you just have your physics or whatever apply forces / move towards the player.

  • You should probably just figure this out but...

    You spawn the object (physics / platformer whatever you're looking for) at the top of the screen (for example at Y = -10 X = random(windowwidth) ) and have another event on collision with the ground, which sets a (boolean) variable that describes whether it is "activated". When it is activated: if X < player.x move right else move left.

    That's if you have a flat game world, otherwise I wish you luck with your AI.

Sumyjkl's avatar

Sumyjkl

Member since 16 Mar, 2014

None one is following Sumyjkl yet!

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

13/44
How to earn trophies