Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
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!
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:
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
set player.windPower to 0[/code:3785pp2o]
Thanks so much!!! You were a enormous help! 7Soul
Develop games in your browser. Powerful, performant & highly capable.
is there any example capx??