summaryrefslogtreecommitdiff
path: root/src/player.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/player.c b/src/player.c
index 1871944..847202b 100644
--- a/src/player.c
+++ b/src/player.c
@@ -1,16 +1,18 @@
#include "entityimpl.h"
IMPL(draw) {
- TZR_DrawSetColor(1, 1, 1, 1);
+ TZR_DrawSetColor(1, 1, 1, 0.5);
TZR_DrawRectangle(true, this->pos[0] - this->width / 2,
this->pos[1] - this->height / 2,
this->width, this->height);
}
IMPL(update) {
- this->vel[0] = TZR_IsKeyDown(SDL_SCANCODE_RIGHT)
- - TZR_IsKeyDown(SDL_SCANCODE_LEFT);
+ this->vel[0] = 2 * TZR_IsKeyDown(SDL_SCANCODE_RIGHT)
+ - 2 * TZR_IsKeyDown(SDL_SCANCODE_LEFT);
entity_move(this, g);
+ entity_init(game_create_entity(g), entity_type("part"), this->pos[0],
+ this->pos[1], 0, 0);
}
IMPL_INIT(player) {