static int draw() { drawLoopingAnimationToMap(); self->x += self->offsetX; self->y -= self->offsetY; setEntityAnimation(self, "WALK"); self->face = LEFT; while (self->x < self->endX) { drawSpriteToMap(); self->x += self->offsetX; self->y -= self->offsetY; } self->face = RIGHT; setEntityAnimation(self, "STAND"); self->x = self->startX; self->y = self->startY; return TRUE; }
static int drawChain() { int y; self->y = self->head->y - self->h; y = self->head->mental - self->h * 2; drawLoopingAnimationToMap(); while (self->y >= y) { self->x = self->head->x; drawSpriteToMap(); self->x = self->head->x + self->head->w - self->w; drawSpriteToMap(); self->y -= self->h; } return TRUE; }
static int energyBarDraw() { int width; float percentage; if (!(self->head->flags & NO_DRAW)) { drawLoopingAnimationToMap(); percentage = self->health; percentage /= self->head->maxHealth; width = self->w - 2; width *= percentage; if (percentage >= 0.5) { drawBoxToMap(self->x + 1, self->y + 1, width, self->h - 2, 0, 220, 0); } else if (percentage >= 0.25) { drawBoxToMap(self->x + 1, self->y + 1, width, self->h - 2, 220, 220, 0); } else if (percentage > 0) { drawBoxToMap(self->x + 1, self->y + 1, width, self->h - 2, 220, 0, 0); } } return TRUE; }
static int ringDraw() { int i, endX, endY; float diffX, diffY; endX = self->head->x; endY = self->head->y + self->head->h / 2 - self->h / 2; diffX = (endX - self->head->startX) / self->head->mental; diffY = (endY - self->head->startY) / self->head->mental; drawLoopingAnimationToMap(); for (i=0;i<self->head->mental;i++) { drawSpriteToMap(); self->x += diffX; self->y += diffY; } self->x = self->startX; self->y = self->startY; return 1; }
static int drawSuspended() { drawLine(self->startX + self->w / 2, self->startY, self->x + self->w / 2, self->y + 15, 255, 255, 255); drawLoopingAnimationToMap(); return TRUE; }
static int draw() { if (self->health > 0) { drawLine(self->startX + self->w / 2, self->startY, self->x + self->w / 2, self->y, 255, 255, 255); } drawLoopingAnimationToMap(); return TRUE; }
static int draw() { /* if ((self->mental == 1) && self->health > 0) { drawLine(self->x + self->w / 2, self->endX, self->x + self->w / 2, self->endY, 255, 0, 0); } */ drawLoopingAnimationToMap(); return TRUE; }
static int drawVine() { int y = self->head->startY - self->h; drawLoopingAnimationToMap(); while (self->y > y) { drawSpriteToMap(); self->y -= self->h; } return TRUE; }
static int drawBeam() { self->y = self->startY; drawLoopingAnimationToMap(); while (self->y > 0) { self->y -= self->h; drawSpriteToMap(); } return TRUE; }
static int draw() { int offsetX = self->offsetX; int drawn = drawLoopingAnimationToMap(); if (drawn == TRUE) { if (game.status == IN_GAME && offsetX == 0 && self->offsetX != offsetX) { shakeScreen(LIGHT, 5); } addSparkles(); } return drawn; }
static int drawChain() { int y; y = self->head->startY - self->h * 2; drawLoopingAnimationToMap(); while (self->y >= y) { drawSpriteToMap(); self->y -= self->h; } return TRUE; }
static int drawChain() { self->x = self->startX; self->y = self->startY; drawLoopingAnimationToMap(); while (self->x > self->endX && self->y > self->endY) { drawSpriteToMap(); self->x -= self->offsetX; self->y -= self->offsetY; } return TRUE; }
static int drawGib() { if (drawLoopingAnimationToMap() == TRUE) { if (!(self->flags & ON_GROUND)) { if (prand() % 6 == 0) { addBlood(self->x + self->w / 2, self->y + self->h / 2); } } else { self->frameSpeed = 0; } } return TRUE; }
static int energyBarDraw() { int width; float percentage; if (self->head->thinkTime != 0) { drawLoopingAnimationToMap(); percentage = self->health; percentage /= self->head->maxHealth; width = self->w - 2; width *= percentage; drawBoxToMap(self->x + 1, self->y + 1, width, self->h - 2, 0, 220, 0); } return TRUE; }
static int draw() { int startX; startX = self->x; /* Draw the segments first */ setEntityAnimation(self, "BLOCK"); if (self->face == RIGHT) { while (self->x >= self->startX) { drawSpriteToMap(); self->x -= self->w; } } else { while (self->x <= self->startX) { drawSpriteToMap(); self->x += self->w; } } /* Draw the tip */ setEntityAnimation(self, self->health == 1 ? "WALK" : "JUMP"); self->x = startX; drawLoopingAnimationToMap(); return TRUE; }
static int draw() { int y = self->y; drawLoopingAnimationToMap(); setEntityAnimation(self, "BODY"); self->y = y - self->h; while (self->y >= self->startY - self->h) { drawSpriteToMap(); self->y -= self->h; } setEntityAnimation(self, "HEAD"); self->y = y; return TRUE; }
static int drawTongue() { float y; y = self->y; setEntityAnimation(self, "WALK"); while (self->y >= self->startY) { drawSpriteToMap(); self->y -= self->h; } setEntityAnimation(self, "STAND"); self->y = y; drawLoopingAnimationToMap(); return TRUE; }
static int iceDraw() { int frame, alpha; float timer; /* Draw the boss with its lowering alpha */ drawLoopingAnimationToMap(); frame = self->currentFrame; timer = self->frameTimer; alpha = self->alpha; /* Draw the other part with its rising alpha */ setEntityAnimation(self, "ICE_STAND"); self->currentFrame = frame; self->frameTimer = timer; self->alpha = 255 - alpha; drawSpriteToMap(); /* Reset back to original */ setEntityAnimation(self, "NORMAL_STAND"); self->currentFrame = frame; self->frameTimer = timer; self->alpha = alpha; return 1; }
static int draw() { drawLoopingAnimationToMap(); return TRUE; }
static int beamDraw() { int drawn; Entity *e; if (self->head->mental == 1 && self->head->health > 0) { self->x = self->head->x; self->y = self->head->endX; drawn = drawLoopingAnimationToMap(); if (drawn == TRUE) { e = addPixelDecoration(self->x + self->w / 2, self->y); if (e != NULL) { e->dirX = prand() % 20; e->dirY = prand() % 20; if (prand() % 2 == 0) { e->dirX *= -1; } e->dirX /= 10; e->dirY /= 10; e->thinkTime = 20 + (prand() % 30); e->health = 255; e->maxHealth = 0; e->mental = 255; } } while (self->y < self->head->endY - self->h) { self->y += self->h; drawn = drawSpriteToMap(); } if (drawn == TRUE) { e = addPixelDecoration(self->x + self->w / 2, self->head->endY); if (e != NULL) { e->dirX = prand() % 20; e->dirY = -prand() % 20; if (prand() % 2 == 0) { e->dirX *= -1; } e->dirX /= 10; e->dirY /= 10; e->thinkTime = 20 + (prand() % 30); e->health = 255; e->maxHealth = 0; e->mental = 255; } } } return TRUE; }
static int drawCaveBoss() { addElementParticles(); return drawLoopingAnimationToMap(); }