How do you make a sprite fall against another sprite

0 favourites
  • 4 posts
From the Asset Store
Template for an alternative to falling shapes, fully documented in comments and video
  • I want the sprite to fall against another sprite and aim it's falling direction against the player. The options you use for the bullet behavior to aim towards the player doesn't work since the sprite don't fall all the time if you use that. If you use the bullet behavior the sprite will not fall all the time. Using the set angle of gravity also doesn't make it fall all the time. The sprite should aim at the other sprite and always falling. Here is two images showing how i want the sprite to move and still aim at the other sprite and how i don't want it to move. Rigth is how i want it to work. Wrong is how i don't want it to work. How do you make it work?

    https://s10.postimg.org/g47ing74p/Example_00000.png

    https://s9.postimg.org/t5mle3dnz/Exampl ... _00000.png

  • Using bullet behaviour should work fine?

    If you set the angle towards the player, and set the speed to something like say, 400... it will fall if it's above the player.

    If the problem you're having is that the falling thing goes back UP again after it goes below the player, you need to set conditions on the movement. If you only want the thing to move and aim at the player if it is above the player and not below, then make the condition something like;

    [Compare Y position of falling.object -> is less than player.object]

    --- Set angle to player.object

    --- Set speed to 400

    I guess you should draw a picture of how you want this to work in your game though, because I still don't really understand what you're trying to do.

    ~Sol

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Using bullet behaviour should work fine?

    If you set the angle towards the player, and set the speed to something like say, 400... it will fall if it's above the player.

    If the problem you're having is that the falling thing goes back UP again after it goes below the player, you need to set conditions on the movement. If you only want the thing to move and aim at the player if it is above the player and not below, then make the condition something like;

    [Compare Y position of falling.object -> is less than player.object]

    --- Set angle to player.object

    --- Set speed to 400

    I guess you should draw a picture of how you want this to work in your game though, because I still don't really understand what you're trying to do.

    ~Sol

    The problem whit that is that if the sprite is above or on the same Y as the other sprite it won't aim anymore. Making the sprite only aim at the other sprites X would work. But i don't know how to write that expression. I know the expression for making the sprite aim at both the other sprites X and Y but not just X.

    angle(Sprite.X,Sprite.Y,OtherSprite.X,OtherSprite.Y) is the rigth expression for aiming at both the sprites X and Y. You can use it in different ways to change the ways the sprites aims. For just making it aim at the other sprites X though, even if removing the Y parts of the expression seems rigth it doesn't work. So how do you write it rigth?

  • For Y component you can do "self.y" - if I understand your problem I think that will work.

    In which case you would do something like;

    [if ABC]

    --- set thing.x position = otherthing.x

    --- set thing.y position = thing.y (or self.y)

    If that doesn't work then can you draw a diagram of what you want to happen - and then I should be able to explain better, or make an example.

    ~Sol

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)