Bee Enemy
Add a new folder for the Bee
Add a new folder for the Bee
Use the Sprites provided in the Pixel Adventure 2 Pack
Use the Sprites provided in the Pixel Adventure 2 Pack
For the BeeDead Sprite
For the BeeDead Sprite
Use the first Frame of the Idle Animation
Use the first Frame of the Idle Animation
Animations
Animations
Set up animations for IDLE, ATTACK and HIT using the sprite sheets provided.
Set up animations for IDLE, ATTACK and HIT using the sprite sheets provided.
The animation speed is 20FPS and IDLE is the only animation which loops.
The animation speed is 20FPS and IDLE is the only animation which loops.
BeeDead, BeeBullet, BeeBulletPiece1 and BeeBulletPiece2
BeeDead, BeeBullet, BeeBulletPiece1 and BeeBulletPiece2
are all single frames not looping.
are all single frames not looping.
The Bee will hover and then attack
The Bee will hover and then attack
when the player is within a certain range.
when the player is within a certain range.
Once the Bee is within range and attacking
Once the Bee is within range and attacking
Spawn bullets
Spawn bullets
The Bee should have TWO sine behaviours
The Bee should have TWO sine behaviours
The first is for horizontal movement
The first is for horizontal movement
The second is for vertical movement
The second is for vertical movement
This will create a figure 8 flying pattern.
This will create a figure 8 flying pattern.
Use the settings shown.
Use the settings shown.
The Bee Bullet (Sting)
The Bee Bullet (Sting)
Should have the Bullet behaviour
Should have the Bullet behaviour
With settings shown.
With settings shown.
Bee Bullet Piece 1 & 2
Bee Bullet Piece 1 & 2
Should have:
Should have:
Physics behaviour
Physics behaviour
Flash Behaviour
Flash Behaviour
With settings shown.
With settings shown.
CODE
CODE
When the Bee starts it will attack the player if within range
When the Bee starts it will attack the player if within range
Otherwise it will play the idle animation.
Otherwise it will play the idle animation.
If the Bee is attacking
If the Bee is attacking
It will drop stingers.
It will drop stingers.
We do this for each Bee
We do this for each Bee
In case there is more than one Bee in the level.
In case there is more than one Bee in the level.
When the Bee collides with the Player
When the Bee collides with the Player
Either the Bee dies
Either the Bee dies
If the player stomped it from above
If the player stomped it from above
Or the Player gets hurt
Or the Player gets hurt
And we call the Hit function
And we call the Hit function
When the Bullet hits a Solid object
When the Bullet hits a Solid object
It should break apart and fragment
It should break apart and fragment
We should spawn the bullet pieces
We should spawn the bullet pieces
Apply physics forces to them
Apply physics forces to them
Then make them flash
Then make them flash
Before destroying them.
Before destroying them.
When a Bullet hits the Player
When a Bullet hits the Player
It should also split into pieces
It should also split into pieces
Apply physics to the pieces
Apply physics to the pieces
Call the Hit function of the Player.
Call the Hit function of the Player.