August 2018
Beginner
334 pages
10h 19m
English
We will work on two classes: the enemy generator containing the evolutionary algorithm and the enemy controller for handling the real-time instances from the enemy templates created in the previous section. We'll also use some game logic.
We need to define the controller for such a template with EvolEnemyController:
using UnityEngine;using System;using System.Collections;public class EvolEnemyController : MonoBehaviour, IComparable<EvolEnemyController>{ // next steps }
public static int counter = 0;[HideInInspector]public EvolEnemy template;public float time;protected Vector2 bounds;protected SpriteRenderer _renderer;protected BoxCollider2D _collider; ...
Read now
Unlock full access