top of page
Search

Week 3: Entities and How I'm Going To Use Them.

  • Writer: Sean Murray
    Sean Murray
  • Feb 23, 2018
  • 1 min read

Going into this project, the main philosophy I want to use is making components easily expandable. Because of this I have started to split objects in my level into entities and non-entities. The main reason for this is to preemptively optimise the level for mobile, as I have set it up so the entities don't update every FixedUpdate (or Update) but instead update every X FixedUpdate, with the X being variable in editor.


Entity Controller script updates entities every X step

Last week I talked about how I was moving the player around and how I handled special movement types for the player, i.e. Jumping off ledges. As the player is the main entity in the game I'm using it as a tester for many entity scripts. The pipeline I'm using is to develop the player scripts normally. Then when they get to a point where it gets mixed with methods and mechanics used for the player, but has elements which can be used for other, more basic, entities.


An example of this is PlayerMovement to EntityMovement. The basic movement, and collision detection can be the same for the majority of entities, but the player has special movement abilities such as jumping. So I removed the basic movement aspects and placed them in EntityMovement and made PlayerMovement inherit from EntityMovement. This wasy the players movement can act the same, but I don't have to rewrite movement for other entities, and can in fact just drop the script on any entity and then they can move around in the world.

 
 
 

Kommentarer


bottom of page