当前位置: 首页>>代码示例>>C++>>正文


C++ setEntityAnimation函数代码示例

本文整理汇总了C++中setEntityAnimation函数的典型用法代码示例。如果您正苦于以下问题:C++ setEntityAnimation函数的具体用法?C++ setEntityAnimation怎么用?C++ setEntityAnimation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setEntityAnimation函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: dropAttackInit

static void dropAttackInit()
{
    int minX, maxX;

    minX = getCameraMinX();
    maxX = getCameraMaxX();

    setEntityAnimation(self, "ATTACK_3");

    self->flags &= ~NO_DRAW;

    self->x = player.x + player.w / 2 - self->w / 2;

    if (self->x < minX)
    {
        self->x = minX;
    }

    else if (self->x + self->w >= maxX)
    {
        self->x = maxX - self->w - 1;
    }

    self->y = self->head->y;

    addParticleExplosion(self->x + self->w / 2, self->y + self->h / 2);

    playSoundToMap("sound/common/spell", -1, self->x, self->y, 0);

    self->action = &dropAttack;

    self->thinkTime = 60;

    self->dirY = 0;

    self->touch = &entityTouch;

    checkToMap(self);
}
开发者ID:carriercomm,项目名称:edgar,代码行数:39,代码来源:awesome_boss.c

示例2: resumeNormalFunction

static void resumeNormalFunction()
{
	self->thinkTime = 0;

	self->touch = &touch;

	setEntityAnimation(self, "WALK");

	self->animationCallback = &explode;

	self->active = TRUE;

	self->health = 30;

	self->mental = 1;

	self->dirX = 0;

	self->dirY = 0;

	self->action = &startFuse;
}
开发者ID:revcozmo,项目名称:edgar,代码行数:22,代码来源:bomb.c

示例3: creditsMove

static void creditsMove()
{
	self->mental++;

	setEntityAnimation(self, "STAND");

	self->dirX = self->speed;

	checkToMap(self);

	if (self->dirX == 0)
	{
		self->inUse = FALSE;
	}

	if (self->mental != 0 && (self->mental % 300) == 0)
	{
		self->thinkTime = 60;

		self->creditsAction = &electrifyStart;
	}
}
开发者ID:polluks,项目名称:edgar,代码行数:22,代码来源:lightning_tortoise.c

示例4: stingAttack

static void stingAttack()
{
	self->thinkTime--;

	if (self->thinkTime == 0)
	{
		self->dirX = self->face == LEFT ? -24 : 24;

		self->flags |= ATTACKING;

		self->touch = &ramTouch;
	}

	else if (self->thinkTime < 0)
	{
		if (self->dirX == 0)
		{
			shakeScreen(MEDIUM, 15);

			self->frameSpeed = 0;

			self->flags &= ~FLY;

			self->dirY = -4;

			self->dirX = self->face == LEFT ? 4 : -4;

			self->action = &stingAttackPause;

			self->touch = &entityTouch;

			setEntityAnimation(self, "ATTACK_2");

			self->thinkTime = 180;
		}
	}

	checkToMap(self);
}
开发者ID:LibreGames,项目名称:edgar,代码行数:39,代码来源:fly_boss.c

示例5: creditsPurpleMove

static void creditsPurpleMove()
{
	self->mental++;

	setEntityAnimation(self, "STAND");

	self->dirX = self->speed;

	checkToMap(self);

	if (self->dirX == 0)
	{
		self->inUse = FALSE;
	}

	if (self->mental != 0 && (self->mental % 300) == 0)
	{
		self->creditsAction = &spitAttackInit;

		self->dirX = 0;
	}
}
开发者ID:revcozmo,项目名称:edgar,代码行数:22,代码来源:snail.c

示例6: spinAttackStart

static void spinAttackStart()
{
	setEntityAnimation(self, "ATTACK_2");

	self->flags |= INVULNERABLE;

	if (self->thinkTime > 0)
	{
		self->thinkTime--;

		if (self->thinkTime == 0)
		{
			self->face = (player.x > self->x ? RIGHT : LEFT);

			self->frameSpeed = 2;

			self->dirY = -8;
		}
	}

	else if (self->thinkTime == 0 && self->flags & ON_GROUND)
	{
		playSoundToMap("sound/enemy/red_grub/spin", -1, self->x, self->y, 0);

		self->speed = self->originalSpeed * 4;

		self->dirX = (self->face == RIGHT ? self->speed : -self->speed);

		self->action = &spinAttack;

		self->creditsAction = &creditsSpinAttack;

		self->thinkTime = 180;

		self->flags |= ATTACKING;
	}

	checkToMap(self);
}
开发者ID:polluks,项目名称:edgar,代码行数:39,代码来源:red_grub.c

示例7: addCursor

static void addCursor()
{
	Entity *e = getFreeEntity();

	if (e == NULL)
	{
		showErrorAndExit("No free slots to add a Mastermind Cursor");
	}

	loadProperties("item/jigsaw_puzzle_cursor", e);

	e->x = self->endX;
	e->y = self->endY;

	e->action = &cursorWait;

	e->draw = &drawLoopingAnimationToMap;

	e->head = self;

	setEntityAnimation(e, "STAND");
}
开发者ID:LibreGames,项目名称:edgar,代码行数:22,代码来源:mastermind_display.c

示例8: throwApple

static void throwApple(int val)
{
	Entity *e;

	if (self->thinkTime <= 0 && game.status == IN_GAME && player.element != WATER)
	{
		setEntityAnimation(self, "WALK");

		self->active = TRUE;

		e = addEntity(*self, player.x + (player.face == RIGHT ? player.w : 0), player.y);

		e->flags &= ~ON_GROUND;

		e->health = 1;

		e->dirX = player.face == LEFT ? -6 : 6;

		e->dirY = ITEM_JUMP_HEIGHT;

		e->action = &doNothing;

		setCustomAction(e, &invulnerableNoFlash, 60, 0, 0);

		playSoundToMap("sound/common/throw", -1, player.x, player.y, 0);

		self->health--;

		if (self->health <= 0)
		{
			self->inUse = FALSE;
		}

		else
		{
			self->thinkTime = 120;
		}
	}
}
开发者ID:LibreGames,项目名称:edgar,代码行数:39,代码来源:apple.c

示例9: instructionMove

static void instructionMove()
{
	checkToMap(self);

	setCustomAction(&player, &helpless, 5, 0, 0);

	if (self->dirX == 0 && self->dirY == 0)
	{
		processNextInstruction();
	}

	else if (self->x == self->endX && self->y == self->endY)
	{
		runScript("robot_end");

		self->dirX = 0;
		self->dirY = 0;

		self->action = &entityWait;

		setEntityAnimation(self, "STAND");

		activateEntitiesWithRequiredName(self->objectiveName, TRUE);

		centerMapOnEntity(&player);

		setPlayerLocked(FALSE);

		self->health = 2;

		self->target->inUse = FALSE;

		self->target = NULL;

		self->touch = NULL;

		self->activate = NULL;
	}
}
开发者ID:revcozmo,项目名称:edgar,代码行数:39,代码来源:robot.c

示例10: getFreeEntity

Entity *addThunderCloud(int x, int y, char *name)
{
	Entity *e = getFreeEntity();

	if (e == NULL)
	{
		showErrorAndExit("No free slots to add a Thunder Cloud");
	}

	loadProperties(name, e);

	e->x = x;
	e->y = y;

	e->action = &init;
	e->touch = &entityTouch;
	e->draw = &drawLoopingAnimationToMap;

	setEntityAnimation(e, "STAND");

	return e;
}
开发者ID:LibreGames,项目名称:edgar,代码行数:22,代码来源:thunder_cloud.c

示例11: getFreeEntity

Entity *addOneWayDoor(int x, int y, char *name)
{
	Entity *e = getFreeEntity();

	if (e == NULL)
	{
		showErrorAndExit("No free slots to add a One Way Door");
	}

	loadProperties(name, e);

	e->x = x;
	e->y = y;

	e->type = KEY_ITEM;

	e->action = &entityWait;

	switch (e->mental)
	{
		case 0:
			e->touch = &touch;
		break;

		case 1:
			e->touch = &upTouch;
		break;

		default:
			e->touch = &downTouch;
		break;
	}

	e->draw = &drawLoopingAnimationToMap;

	setEntityAnimation(e, "STAND");

	return e;
}
开发者ID:LibreGames,项目名称:edgar,代码行数:39,代码来源:one_way_door.c

示例12: finalAttack

static void finalAttack()
{
	Entity *e;

	if (self->endY == 1)
	{
		self->thinkTime--;

		if (self->thinkTime <= 0)
		{
			setEntityAnimation(self, "GROUND_ATTACK");

			e = addProjectile("boss/fly_boss_slime", self, self->x + (self->face == RIGHT ? self->w : 0), self->y, (self->face == RIGHT ? 7 : -7), 0);

			e->touch = &slimePlayer;

			self->endY = 0;

			self->die = &dieWait;
		}
	}
}
开发者ID:LibreGames,项目名称:edgar,代码行数:22,代码来源:cave_boss.c

示例13: createLightningWaveInit

static void createLightningWaveInit()
{
	Entity *e;

	if (self->endX == 0)
	{
		e = addThunderCloud(self->x, self->y, "enemy/thunder_cloud");

		e->x = self->x + self->w / 2;
		e->y = self->y + self->h / 2;

		e->x -= e->w / 2;
		e->y -= e->h / 2;

		e->targetX = self->targetX;
		e->targetY = getMapCeiling(self->x, self->y);

		calculatePath(e->x, e->y, e->targetX, e->targetY, &e->dirX, &e->dirY);

		e->flags |= (NO_DRAW|HELPLESS|TELEPORTING|NO_END_TELEPORT_SOUND);

		playSoundToMap("sound/common/spell", -1, self->x, self->y, 0);

		e->head = self;

		e->face = RIGHT;

		setEntityAnimation(e, "STAND");

		e->action = &lightningWaveStart;

		self->endX = 1;
	}

	checkToMap(self);

	hover();
}
开发者ID:LibreGames,项目名称:edgar,代码行数:38,代码来源:large_book.c

示例14: returnMove

static void returnMove()
{
	checkToMap(self);

	if (self->x == self->startX && self->y == self->startY)
	{
		runScript("robot_end");

		centerMapOnEntity(&player);

		self->action = &entityWait;

		self->dirX = 0;
		self->dirY = 0;

		self->active = FALSE;

		setPlayerLocked(FALSE);

		self->health = 0;

		self->action = &entityWait;

		self->target->flags &= ~NO_DRAW;

		self->target->x = self->x;

		self->target->y = self->y;

		self->target->dirY = ITEM_JUMP_HEIGHT;

		self->target->touch = &keyItemTouch;

		self->target = NULL;

		setEntityAnimation(self, "STAND");
	}
}
开发者ID:revcozmo,项目名称:edgar,代码行数:38,代码来源:robot.c

示例15: creditsMove

static void creditsMove()
{
	Entity *e;

	self->thinkTime++;

	setEntityAnimation(self, "STAND");

	self->dirX = self->speed;

	checkToMap(self);

	if (self->thinkTime >= 900)
	{
		e = addSnailShell(self->x, self->y, "enemy/snail_shell");

		e->face = self->face;

		e->touch = NULL;

		self->inUse = FALSE;
	}
}
开发者ID:revcozmo,项目名称:edgar,代码行数:23,代码来源:snail.c


注:本文中的setEntityAnimation函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。