コード例 #1
0
ファイル: drawbridge_anchor.c プロジェクト: LibreGames/edgar
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;
}
コード例 #2
0
ファイル: scale.c プロジェクト: LibreGames/edgar
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;
}
コード例 #3
0
ファイル: awesome_boss.c プロジェクト: carriercomm/edgar
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;
}
コード例 #4
0
ファイル: pendulum.c プロジェクト: revcozmo/edgar
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;
}
コード例 #5
0
ファイル: fly_boss.c プロジェクト: LibreGames/edgar
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;
}
コード例 #6
0
ファイル: spider.c プロジェクト: LibreGames/edgar
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;
}
コード例 #7
0
ファイル: energy_drainer.c プロジェクト: polluks/edgar
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;
}
コード例 #8
0
ファイル: ceiling_snapper.c プロジェクト: polluks/edgar
static int drawVine()
{
	int y = self->head->startY - self->h;

	drawLoopingAnimationToMap();

	while (self->y > y)
	{
		drawSpriteToMap();

		self->y -= self->h;
	}

	return TRUE;
}
コード例 #9
0
ファイル: azriel.c プロジェクト: LibreGames/edgar
static int drawBeam()
{
	self->y = self->startY;

	drawLoopingAnimationToMap();

	while (self->y > 0)
	{
		self->y -= self->h;

		drawSpriteToMap();
	}

	return TRUE;
}
コード例 #10
0
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;
}
コード例 #11
0
ファイル: magnet.c プロジェクト: LibreGames/edgar
static int drawChain()
{
	int y;

	y = self->head->startY - self->h * 2;

	drawLoopingAnimationToMap();

	while (self->y >= y)
	{
		drawSpriteToMap();

		self->y -= self->h;
	}

	return TRUE;
}
コード例 #12
0
ファイル: drawbridge_pulley.c プロジェクト: revcozmo/edgar
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;
}
コード例 #13
0
ファイル: gib.c プロジェクト: LibreGames/edgar
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;
}
コード例 #14
0
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;
}
コード例 #15
0
ファイル: extend_o_grab.c プロジェクト: LibreGames/edgar
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;
}
コード例 #16
0
ファイル: chaos_vine.c プロジェクト: LibreGames/edgar
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;
}
コード例 #17
0
ファイル: red_ceiling_creeper.c プロジェクト: revcozmo/edgar
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;
}
コード例 #18
0
ファイル: cave_boss.c プロジェクト: LibreGames/edgar
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;
}
コード例 #19
0
ファイル: skull.c プロジェクト: revcozmo/edgar
static int draw()
{
	drawLoopingAnimationToMap();

	return TRUE;
}
コード例 #20
0
ファイル: energy_drainer.c プロジェクト: polluks/edgar
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;
}
コード例 #21
0
ファイル: cave_boss.c プロジェクト: LibreGames/edgar
static int drawCaveBoss()
{
	addElementParticles();

	return drawLoopingAnimationToMap();
}