Skill Tree Activated

The quest to become an indie game developer

#100DaysOfCode#100DaysOfGameDevC#CodingGame DevIllogical BaconScript-writingUnity

Flappy Pig – Obstacle Gapping, Coin Pickup, and Coin Spawning

Day 084 #100DaysOfCode
Day 048 #100DaysOfGameDev

Obstacle Gaps

  • added variable in PostPool to determine the gap between last post and current post
  • if gap exceeds the minimum required, spawns in a new post
X position difference between posts
if the gap is big enough, add a new post

Coin Pickup

  • created a new script to determine if a collision with a coin is made
  • upon collision, the score is updated and the coin is destroyed
new CoinPickup script

Coin Spawn

  • created a new script to handle the spawning of new coins
  • set minimum time between spawns
  • use random X and Y parameters (within a range) as the spawn point
new CoinSpawn script

Leave a Reply

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