Day 16. Enemy Shield. Aggressive Enemy Type. Pickup Collect

--

Lots of fun today with the core programming section.

Shield converted to prefab and instantiated with an enemy by code.

Enemy shield first try

Adjusted localSize. One extra hit for an enemy with the shield.

This is how the Aggressive Enemy type works.

I am checking the distance between the enemy and the player Vector3.Distance(transform.position, _player.transform.position) < 4f

and use MoveTowards to process movements.

transform.position = Vector3.MoveTowards(transform.position, target, _speed * Time.deltaTime);

Similar task was Pickup Collect. MoveTowards function move power-up towards player when key “C” pressed.

Core programming almost done. Couple more tasks ahead.

--

--

Dmitry Gordeev
Dmitry Gordeev

No responses yet