- Home /
Crushy Bird Game Doubt
I have recently downloaded Crushy Birds android game. It is nice game with unique concept. Crushy Birds
After playing this game, I have one doubt in my mind. How to apply birds movement? They are coming from left side of the screen in based on some curve path.
My other doubt is, Is this physics based game of normal one? How to perform this movement in unity?
Answer by Kumo-Kairo · Apr 18, 2014 at 06:07 PM
As I can see, there are two paths you can follow:
Apply physics and gravity.
Every bird has a Rigidbody2D component and a script which forces your bird to flap if it goes below some point, thus creating a curve effect. You should, of course, constantly move your bird forward. You can actually "combine" your velocity vector from two parts - desired horizontal speed and the vertical speed from your AddForce impact (if your bird goes too low)
pros: you don't have to worry if the movement of your birds are smooth and natural - physics will make it look good, you can also make every bird with a different bottom line, which will create even more randomness
Move with code
You can also move every bird with code by calculating desired trajectory. In fact, this can also be a abs (sin (time a + b) c) where time is actual passed time of your game, a is a speed multiplier, b is an offset and c is amplitude.
pros: full control of the movement cons: it may take a while to get all those parameters right, so your birds actually move naturally
I would personally prefer the first choice, it's simple to implement and will be the fastest solution possible
Thanks for your reply. If you see game more clearly some birds are moving backward after touching corner of pipe. If I am using first approach then how to perform this or it is normal physics behaviour.
For second approach, why I have to take abs value of result? I already up vote your answer.
If you will use physics you can just push the birds with force away from the pipe, they will gradually increase their X speed
As for the formula, we need abs so they "jump" a bit when they reach a zero point in the sinus ins$$anonymous$$d of smoothly floating, you can just look at the plot of the abs(sin(x)) function to get what I mean
Thanks for your help. If I stuck in any situation then I will disturb you.
@$$anonymous$$umo-$$anonymous$$airo, Thanks for you humble support. You told about personal message but how to send you. There is no feature available for that.
As this link says How to send a private message to another Unity Answers user?
Your answer
Follow this Question
Related Questions
How to make a Spring in a 2D game in unity? 0 Answers
Atlas size based on sprite 0 Answers
Terrain Handling For Performance Improvement in 2D Game 0 Answers
Sprite Rendering Cost Calculation 1 Answer
Background Sprite Setting 0 Answers