How to create Button/Switch-Like Tile where you can step on it and change its value?

Posted by aldroid16 on Programmers See other posts from Programmers or by aldroid16
Published on 2012-12-01T05:22:53Z Indexed on 2012/12/01 11:21 UTC
Read the original article Hit count: 222

Filed under:
|
|
|

If the player steps on a Button-Tile when its true, it becomes false. If the player steps on a Button-Tile when it is false, it becomes true.

The problem is, when the player stands on (intersects) the Button-Tile, it will keep updating the condition. So, from true, it becomes false. Because its false and the player intersects it, it becomes true again. True-false-true-false and so on.

I use ElapsedGameTime to make the updating process slower, and the player can have a chance to change the Button to true or false.

However, it's not the solution I was looking for. Is there any other way to make it keep in False/True condition while the Player is standing on the Button tile?

© Programmers or respective owner

How to create Button/Switch-Like Tile where you can step on it and change its value?

Posted by aldroid16 on Game Development See other posts from Game Development or by aldroid16
Published on 2012-12-01T05:20:45Z Indexed on 2012/12/01 5:21 UTC
Read the original article Hit count: 223

Filed under:
|

If the player step on Button-Tile when its true, it become false. If the player step on Button-Tile when its false, it become true.

The problem is, when the player stand on (intersect) the Button-Tile, it will keep updating the condition. So, from true, it become false. Because its false and player intersect on it, it become true again. True-false-true-false and so on.

I use ElapsedGameTime to make the updating process slower, and player can have a chance to change the Button to true or false.

However, its not a solution I was looking for. Is there any other way to make it keep in False/True condition while the Player standing on it (The Button tile) ?

© Game Development or respective owner

Related posts about c#

Related posts about algorithms