Skill Tree Activated

The quest to become an indie game developer

#100DaysOfCode#100DaysOfGameDevC#CodingIllogical BaconScript-writingTrainingUnity

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
testing flight control and velocity
FlappyPig C# script implementing flight control and movement velocity

Leave a Reply

Your email address will not be published. Required fields are marked *