English subtitles

← Building an entity - HTML5 Game Development

Get Embed Code
4 Languages

Showing Revision 6 created 05/25/2016 by Udacity Robot.

  1. The basic definition of an Entity Class is actually pretty bare bones. As we
  2. talked about in the quiz, all entities need a position variable to reference
  3. where it exists in the world. This is going to be used in the future for things
  4. like collision and rendering of our visibility. We'll also need to know the
  5. size of this entity and there's a couple reasons for this. Number one it's
  6. important to know the size of the bitmap that this entity represents, 32
  7. pixels, 64 pixels. But it's also important to know the size for physics
  8. calculations. Some objects are bigger than others. And keeping that data around
  9. is going to be important for us later on. And finally, in our bare bones Entity
  10. Class, we actually define an update function. This update function will be
  11. called by a larger game manager class, about every frame. Allowing any given
  12. override-ed entity to have a time slice in order to do execution.