]> git.localhorst.tv Git - l2e.git/blob - src/map/Entity.cpp
added Entity class
[l2e.git] / src / map / Entity.cpp
1 /*
2  * Entity.cpp
3  *
4  *  Created on: Sep 29, 2012
5  *      Author: holy
6  */
7
8 #include "Entity.h"
9
10 namespace map {
11
12 Entity::Entity()
13 : sprite(0) {
14
15 }
16
17
18 void Entity::Update(float deltaT) {
19         position += velocity * deltaT;
20 }
21
22
23 void Entity::Render(SDL_Surface *dest, const geometry::Vector<int> &offset) const {
24         if (animation.Running()) {
25                 animation.DrawCenterBottom(dest, offset + position);
26         } else {
27                 sprite->DrawCenterBottom(dest, offset + position);
28         }
29 }
30
31 }