NOT SOLVED|How do I Make Wind That Pushes a Platform Sprite?

0 favourites
  • 10 posts
From the Asset Store
Weather Wind Sounds - Wind contains 10 tracks (1 tracks and 9 seamless loops)
  • How do I Make Wind That Pushes a Platform Sprite? This is my third post about this and no one has helped answer my problem. I want to make a sprite that can push a platform sprite when it comes into contact with it. I have one solution but it has its own problems. I made a transparent sprite with the Solid and Sine behaviors so it constantly pushes the platform sprite away but now the sprite can jump on top of the solid block! HELP PLEASE!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You don't need to make it solid to detect collisions

  • I know but that doesn't solve the problem...Its just the only behavior that moves a platform sprite 7Soul

  • The way I would do it, is to control the player movement through its vector.X property, instead of using the "simulate action" command.

    Then you can add whatever you want to the speed, like "Set vector.X to player.moveSpeed + windObject.strenght"

  • 7Soul Can I just set the vector.X property to 200? Would that move the sprite over 200 pixels?

  • That sets the speed to 200, which means the player moves 200 pixels over 1 second (or around 3 pixels per frame at 60fps)

  • So 7Soul would that not work? What would be a preferable and simple way to do it? Btw, I appreciate your help very much

  • Add these variables:

    On the player add "speedMax" to the maximum speed you want (lets say 100), "currentSpeed" (leave at 0) and "windSpeed" (leave at 0)

    On the wind object add "power" an make it a positive or negative number (like 50 or -50) depending on the direction.

    When the player press right
        set "currentSpeed" to "speedMax"[/code:3785pp2o]
    [code:3785pp2o]When the player press left
        set "currentSpeed" to -"speedMax" (notice the - )[/code:3785pp2o]
    Making the player stop:
    [code:3785pp2o]Not pressing left and Not pressing right
        set "currentSpeed" to 0[/code:3785pp2o]
    Applying the variables to the speed:
    [code:3785pp2o]Every tick
        set player.vectorX to player.currentSpeed + player.windSpeed[/code:3785pp2o]
    Adding the wind speed to the player:
    [code:3785pp2o]Player overlapping wind object
        set player.windPower to windObject.power
    Else
        set player.windPower to 0[/code:3785pp2o]
  • Thanks so much!!! You were a enormous help! 7Soul

  • is there any example capx??

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