Flappy Pig – Scripting Movement: He Lives!
Day 073 #100DaysOfCode
Day 037 #100DaysOfGameDev
- add new C# script to FlappyPig GameObject
- get Rigidbody2D component data for FlappyPig GameObject to be able to apply physics to it
- determine if FlappyPig is still moving or has been KO’d
- KO means further flapping will be disabled
- determine if the Left Mouse button is clicked, which will be used to flap wings
- add rising force to each wing flap (click) to make FlappyPig ascend (gravity will constantly make him descend)
- upward force currently set to 200f
- set up collision detection