#include "entityimpl.h" IMPL(draw) { 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] = 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"), NULL, this->pos[0], this->pos[1], 0, 0); } IMPL_INIT(player, 0) { this->height = this->width = 12; }