Friday, 24 March 2017

Let's steal chickens! - chapter one -chicken chain

Do you remember the old Mario game on GBA that the little green Yoshi taking a long queue of egges and throwing them at the enemies?

I was having a lot of fun of collecting different colours and types of eggs.


I am making same feature in my game in an evil version (evilly smile)

So what's this feature about?

Instead of collecting egges, you collect little birds. You will be able to steal eggs from their mother bird. When your hp is low, you eat them to gain hp (poor chickens!).

Let's take a loot at our chicken in close!


The mother bird is able to generate chickens who follow their mom. When the player attack the chicken, the chicken will be stunned.  Then the player can steal the chicken. The chicken starts follow the player.

To achieve the effect of chicken chain, the chicken need to follow her [target] either the previous chicken in the chain or, if there's no previous chicken, the player or mother bird.

This means, in the chicken class. There will be a Gameobject_target and a function setTarget(). The target need to be set when the chicken is created. setTarget() function can also be useful when the player is trying to steal her from the mother bird.

With the target set, the chicken chain movement will be easy, the chicken class constantly test the distance between it's target and itself. If the distance is larger than a threshold, +the chicken walk towards it's target.

Here's the effect of chicken chain!


Fun to look at , lol!

Here is the movement class of the chicken.

The following step will be create a simple movement for the mother bird , allow the mother bird to spawns chickens over time.


No comments:

Post a Comment