• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ANIMATE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ai_miserys_bubble

void ai_miserys_bubble(Object *o)
{
    Object *target;

    switch(o->state)
    {
    case 0:
    {
        // find the Toroko object we are to home in on
        target = mbubble_find_target();
        if (!target)
        {
            o->state = 9999;
            return;
        }

        o->xmark = target->x - (6 << CSF);
        o->ymark = target->y - (6 << CSF);

        ThrowObject(o, o->xmark, o->ymark, 0, (2 << CSF));
        o->state = 1;

        // correct values: 0x3F0, 0xAE
        NX_LOG("Computed toss values xi: 0x%x, 0x%x\n", o->xinertia, o->yinertia);
        NX_LOG("Target x/y: 0x%x, 0x%x\n", target->x, target->y);
    }
    case 1:
        ANIMATE(1, 0, 1);

        if (abs(o->x - o->xmark) <= (3 << CSF) && \
                abs(o->y - o->ymark) <= (3 << CSF))
        {
            o->state = 2;
            o->frame = 2;
            sound(SND_BUBBLE);

            if ((target = mbubble_find_target()))
                target->invisible = true;
        }
        break;

    case 2:
    {
        ANIMATE(1, 2, 3);

        o->xinertia -= 0x20;
        o->yinertia -= 0x20;
        LIMITX(0x5FF);
        LIMITY(0x5FF);

        if (o->y < -1000)
            o->Delete();
    }
    break;
    }
}
开发者ID:helmyarkan12,项目名称:nxengine-libretro,代码行数:56,代码来源:misery.cpp


示例2: ai_npc_igor

// cutscene igor
void ai_npc_igor(Object *o)
{
	switch(o->state)
	{
		case 0:		// init, standing/panting
			o->xinertia = 0;
			o->frame = 0;
			o->animtimer = 0;
			o->state = 1;
		case 1:
			ANIMATE(5, 0, 1);
		break;
		
		case 2:		// walking
			o->state = 3;
			o->frame = 2;
			o->animtimer = 0;
		case 3:
			ANIMATE(3, 2, 5);
			XMOVE(0x200);
		break;
		
		case 4:		// punch
			o->xinertia = 0;
			o->state = 5;
			o->timer = 0;
		case 5:
			o->frame = 6;
			if (++o->timer > 10)
			{
				o->timer = 0;
				o->state = 6;
				sound(SND_EXPL_SMALL);
			}
		break;
		case 6:
			o->frame = 7;
			if (++o->timer > 8)
			{
				o->state = 0;
				o->frame = 0;
			}
		break;
		
		case 7:
			o->state = 1;
		break;
	}
	
	o->yinertia += 0x40;
	LIMITY(0x5FF);
}
开发者ID:Fordi,项目名称:nxengine-evo,代码行数:53,代码来源:igor.cpp


示例3: ai_mesa_block

void ai_mesa_block(Object *o)
{
        ANIMATE(0, 0, 1);

        switch(o->state) {
        case 0: {	// being held
                if (!o->linkedobject || o->linkedobject->type == OBJ_MESA_DYING) {
                        o->Delete();
                }
        }
        break;

        case 1: {	// launched
                if (++o->timer == 4)
                        o->flags &= ~FLAG_IGNORE_SOLID;

                o->yinertia += 0x2A;
                LIMITY(0x5ff);

                if (o->blockd && o->yinertia >= 0) {
                        sound(SND_BLOCK_DESTROY);
                        o->Delete();
                }
        }
        break;
        }

        if (o->deleted) {
                SmokeClouds(o, 3, 0, 0);
                effect(o->x, o->y, EFFECT_BOOMFLASH);
        }
}
开发者ID:lluixhi,项目名称:nxengine-evo,代码行数:32,代码来源:hell.cpp


示例4: ai_ironh_shot

void ai_ironh_shot(Object *o)
{
	if (!o->state)
	{
		if (++o->timer > 20)
		{
			o->state = 1;
			o->xinertia = o->yinertia = 0;
			o->timer2 = 0;
		}
	}
	else
	{
		o->xinertia += 0x20;
	}
	
	ANIMATE(0, 0, 2);
	
	if (++o->timer2 > 100 && !o->onscreen)
	{
		o->Delete();
	}
	
	if ((o->timer2 & 3)==1) sound(SND_IRONH_SHOT_FLY);
}
开发者ID:Fordi,项目名称:nxengine-evo,代码行数:25,代码来源:ironhead.cpp


示例5: ai_green_devil

void ai_green_devil(Object *o)
{
	switch(o->state)
	{
		case 0:
		{
			o->flags |= FLAG_SHOOTABLE;
			o->ymark = o->y;
			o->yinertia = random(-5<<CSF, 5<<CSF);
			o->damage = 3;
			o->state = 1;
		}
		case 1:
		{
			ANIMATE(2, 0, 1);
			o->yinertia += (o->y < o->ymark) ? 0x80 : -0x80;
			
			XACCEL(0x20);
			LIMITX(0x400);
			
			if (o->dir == LEFT)
			{
				if (o->x < -o->Width())
					o->Delete();
			}
			else
			{
				if (o->x > ((map.xsize * TILE_W) << CSF) + o->Width())
					o->Delete();
			}
		}
		break;
	}
	
}
开发者ID:Fordi,项目名称:nxengine-evo,代码行数:35,代码来源:ballos_misc.cpp


示例6: ai_ballos_target

// targeter for lightning strikes
void ai_ballos_target(Object *o)
{
	switch(o->state)
	{
		case 0:
		{
			// position to shoot lightning at passed as x,y
			o->xmark = o->CenterX() - ((sprites[SPR_LIGHTNING].w / 2) << CSF);
			o->ymark = o->CenterY();
			
			// adjust our Y coordinate to match player's
			o->y = player->CenterY();
			
			sound(SND_CHARGE_GUN);
			o->state = 1;
		}
		case 1:
		{
			ANIMATE(1, 0, 1);
			o->timer++;
			
			if (o->timer == 20 && o->dir == LEFT)
			{	// lightning attack
				// setting lightning dir=left: tells it do not flash screen
				CreateObject(o->xmark, o->ymark, OBJ_LIGHTNING)->dir = LEFT;
			}
			
			if (o->timer > 40)
				o->Delete();
		}
		break;
	}
	
}
开发者ID:Angluca,项目名称:nxengine-libretro,代码行数:35,代码来源:ballos_priest.cpp


示例7: ai_doctor

void ai_doctor(Object *o)
{
	switch(o->state)
	{
		case 10:	// he chuckles
			o->state = 11;
			o->timer2 = 0;
			o->frame = 1;
			o->animtimer = 0;
		case 11:
			ANIMATE(6, 0, 1);
			if (++o->timer2 > 8*6) { o->frame = 0; o->state = 1; }
		break;
		
		case 20:	// he rises up and hovers
		{
			o->state = 21;
			o->timer = 0;
			o->frame = 2;
			o->ymark = o->y - (32 << CSF);
		}
		case 21:
		{
			o->yinertia += (o->y > o->ymark) ? -0x20 : 0x20;
			LIMITY(0x200);
		}
		break;
		
		case 30:	// he teleports away
		{
			o->timer = 0;
			o->frame = 2;
			o->yinertia = 0;
			o->state++;
		}
		case 31:
		{
			if (DoTeleportOut(o, 1))
				o->Delete();
		}
		break;
		
		case 40:	// he teleports in and hovers
		{
			o->timer = 0;
			o->state = 41;
			o->frame = 2;
		}
		case 41:
		{
			if (DoTeleportIn(o, 1))
			{
				o->state = 20;
				o->yinertia = -0x200;
			}
		}
		break;
	}
}
开发者ID:Angluca,项目名称:nxengine-libretro,代码行数:59,代码来源:npcregu.cpp


示例8: ai_ballos_skull

void ai_ballos_skull(Object *o)
{
	ANIMATE(8, 0, 3);
	
	switch(o->state)
	{
		case 0:
		{
			o->state = 100;
			o->frame = random(0, 16) & 3;
		}
		case 100:
		{
			o->yinertia += 0x40;
			LIMITY(0x700);
			
			if (o->timer++ & 2)
			{
				(SmokePuff(o->x, o->y))->PushBehind(o);
			}
			
			if (o->y > 0x10000)
			{
				o->flags &= ~FLAG_IGNORE_SOLID;
				
				if (o->blockd)
				{
					o->yinertia = -0x200;
					o->state = 110;
					o->flags |= FLAG_IGNORE_SOLID;
					
					quake(10, SND_BLOCK_DESTROY);
					
					for(int i=0;i<4;i++)
					{
						Object *s = SmokePuff(o->x + random(-12<<CSF, 12<<CSF), \
											  o->y + 0x2000);
						
						s->xinertia = random(-0x155, 0x155);
						s->yinertia = random(-0x600, 0);
						s->PushBehind(o);
					}
				}
			}
		}
		break;
		
		case 110:
		{
			o->yinertia += 0x40;
			
			if (o->Top() >= (map.ysize * TILE_H) << CSF)
			{
				o->Delete();
			}
		}
		break;
	}
}
开发者ID:Fordi,项目名称:nxengine-evo,代码行数:59,代码来源:ballos_misc.cpp


示例9: ai_bute_flying

void ai_bute_flying(Object *o)
{
        //AIDEBUG;
        if (run_bute_defeated(o, BUTE_HP))
                return;

        switch(o->state) {
        case 0: {
                o->invisible = true;
                o->state = 1;
        }
        case 1: {
                if (o->dir == LEFT) {
                        if (player->x > (o->x - (288<<CSF)) && \
                                        player->x < (o->x - (272<<CSF))) {
                                o->state = 10;
                        }
                } else {
                        if (player->x < (o->x + (288<<CSF)) && \
                                        player->x > (o->x + (272<<CSF))) {
                                o->state = 10;
                        }
                }
        }
        break;

        case 10: {
                o->state = 11;
                o->invisible = false;
                o->flags |= FLAG_SHOOTABLE;
                o->damage = 5;
        }
        case 11: {
                FACEPLAYER;
                ANIMATE(1, 0, 1);

                XACCEL(0x10);
                o->yinertia += (o->y > player->y) ? -0x10 : 0x10;

                LIMITX(0x5ff);
                LIMITY(0x5ff);

                if ((o->blockl && o->xinertia < 0) || \
                                (o->blockr && o->xinertia > 0)) {
                        o->xinertia = -o->xinertia;
                }

                if ((o->blockd && o->yinertia > 0) || \
                                (o->blocku && o->yinertia < 0)) {
                        o->yinertia = -o->yinertia;
                }


        }
        break;
        }

}
开发者ID:lluixhi,项目名称:nxengine-evo,代码行数:58,代码来源:hell.cpp


示例10: ai_bat_circle

void ai_bat_circle(Object *o)
{
	switch(o->state)
	{
		case 0:
		{
			uint8_t angle;
			o->state = 1;
			
			// set up initial direction and target x,y
			angle = random(0, 255);
			o->xinertia = sin_table[angle];
			
			angle += 64;
			o->xmark = (o->x + (sin_table[angle] * 8));
			
			angle = random(0, 255);
			o->yinertia = sin_table[angle];
			
			angle += 64;
			o->ymark = (o->y + (sin_table[angle] * 8));
		}
		case 1:
			// circle around our target point
			ANIMATE(1, 2, 4);
			FACEPLAYER;
			o->xinertia += (o->x > o->xmark) ? -0x10 : 0x10;
			o->yinertia += (o->y > o->ymark) ? -0x10 : 0x10;
			LIMITX(0x200);
			LIMITY(0x200);
			
			if (!o->timer2)
			{
				if (pdistlx(0x1000) && (player->y > o->y) && pdistly(0xC000))
				{	// dive attack
					o->xinertia /= 2;
					o->yinertia = 0;
					o->state = 2;
					o->frame = 5;		// mouth showing teeth
				}
			}
			else o->timer2--;
		break;
		
		case 2:	// dive attack
			o->yinertia += 0x40;
			LIMITY(0x5ff);
			
			if (o->blockd)
			{
				o->yinertia = 0;
				o->xinertia *= 2;
				o->timer2 = 120;		// delay before can dive again
				o->state = 1;
			}
		break;
	}
}
开发者ID:Fordi,项目名称:nxengine-evo,代码行数:58,代码来源:weed.cpp


示例11: ai_bute_falling

void ai_bute_falling(Object *o)
{
        ANIMATE(3, 0, 3);

        switch(o->state) {
        case 0: {
                o->state = 1;
                o->MoveAtDir(o->dir, 0x600);
                o->flags |= FLAG_IGNORE_SOLID;
        }
        case 1: {
                o->timer++;

                if (o->timer == 16) {
                        o->flags &= ~FLAG_IGNORE_SOLID;
                } else if (o->timer > 16 && o->block[o->dir]) {
                        o->state = 10;
                }

                if (o->timer > 20) {
                        switch(o->dir) {
                        case LEFT:
                                if (o->CenterX() <= player->CenterX() + (32<<CSF))
                                        o->state = 10;
                                break;

                        case RIGHT:
                                if (o->CenterX() >= player->CenterX() - (32<<CSF))
                                        o->state = 10;
                                break;

                        case UP:
                                if (o->CenterY() <= player->CenterY() + (32<<CSF))
                                        o->state = 10;
                                break;

                        case DOWN:
                                if (o->CenterY() >= player->CenterY() - (32<<CSF))
                                        o->state = 10;
                                break;
                        }
                }
        }
        break;

        case 10: {
                o->y += (4 << CSF);
                o->ChangeType(OBJ_BUTE_FLYING);
                o->state = 10;	// trigger flight immediately

                o->frame = 0;
                o->xinertia = 0;
                o->yinertia = 0;
        }
        break;
        }
}
开发者ID:lluixhi,项目名称:nxengine-evo,代码行数:57,代码来源:hell.cpp


示例12: ai_misery_ring

void ai_misery_ring(Object *o)
{
	if (!o->linkedobject)
	{
		SmokeClouds(o, 3, 2, 2);
		o->Delete();
		return;
	}
	
	switch(o->state)
	{
		case 0:
		{
			o->state = 1;
			o->timer = 0;
		}
		case 1:
		{
			// distance from misery
			if (o->timer < 192)
				o->timer++;
			
			// turn to bats when misery teleports
			if (o->linkedobject->state >= STATE_TP_AWAY && \
				o->linkedobject->state < STATE_TP_AWAY+10)
			{
				o->state = 10;
			}
		}
		break;
		
		case 10:	// transform to bat
		{
			o->flags |= FLAG_SHOOTABLE;
			o->flags &= ~FLAG_INVULNERABLE;
			
			ThrowObjectAtPlayer(o, 3, 0x200);
			FACEPLAYER;
			
			o->sprite = SPR_ORANGE_BAT_FINAL;
			o->state = 11;
		}
		case 11:
		{
			ANIMATE(4, 0, 2);
			
			if ((o->dir == LEFT && o->blockl) || \
				(o->dir == RIGHT && o->blockr) || \
				o->blocku || o->blockd)
			{
				SmokeClouds(o, 3, 2, 2);
				o->Delete();
			}
		}
		break;
	}
}
开发者ID:GameMaker2k,项目名称:NXEngine,代码行数:57,代码来源:misery.cpp


示例13: ai_mannan_shot

void ai_mannan_shot(Object *o)
{
	XACCEL(0x20);
	ANIMATE(0, 1, 2);
	
	if ((o->timer & 3) == 1)
		sound(SND_IRONH_SHOT_FLY);
	
	if (++o->timer > 100)
		o->Delete();
}
开发者ID:Fordi,项目名称:nxengine-evo,代码行数:11,代码来源:weed.cpp


示例14: ai_black_lightning

void ai_black_lightning(Object *o)
{
	ANIMATE(0, 0, 1);
	o->yinertia = 0x1000;
	
	if (o->blockd)
	{
		effect(o->CenterX(), o->Bottom(), EFFECT_BOOMFLASH);
		SmokeXY(o->CenterX(), o->Bottom(), 3, o->Width()>>CSF, 4);
		o->Delete();
	}
开发者ID:GameMaker2k,项目名称:NXEngine,代码行数:11,代码来源:misery.cpp


示例15: ai_firewhirr_shot

void ai_firewhirr_shot(Object *o)
{
    ANIMATE(1, 0, 2);
    o->x += (o->dir==LEFT) ? -0x200 : 0x200;

    if ((o->dir==LEFT && o->blockl) || (o->dir==RIGHT && o->blockr))
    {
        if (o->dir == RIGHT) o->x += o->Width();
        effect(o->x, o->CenterY(), EFFECT_FISHY);
        o->Delete();
    }
}
开发者ID:GameMaker2k,项目名称:NXEngine,代码行数:12,代码来源:labyrinth_m.cpp


示例16: aftermove_blade_l12_shot

void aftermove_blade_l12_shot(Object *o)
{
    int level = (o->shot.btype - B_BLADE_L1);
    ANIMATE(1, 0, 3);

    if (--o->shot.ttl < 0)
    {
        shot_dissipate(o);
        return;
    }

    // only start damaging enemies after we've passed the player
    // as it starts slightly behind him
    if (++o->timer >= 4)
    {
        Object *enemy;
        if ((enemy = damage_enemies(o)))
        {
            // on level 2 we can deal damage up to 3 times (18 max)
            if (level == 0 || \
                    ++o->timer2 >= 3 || (enemy->flags & FLAG_INVULNERABLE))
            {
                o->Delete();
                return;
            }
        }
        else if (IsBlockedInShotDir(o))
        {
            if (!shot_destroy_blocks(o))
                sound(SND_SHOT_HIT);

            shot_dissipate(o, EFFECT_STARSOLID);
            return;
        }
    }

    switch(level)
    {
    case 0:
        if ((o->timer % 5) == 1)
            sound(SND_FIREBALL);
        break;

    case 1:
        if ((o->timer % 7) == 1)
            sound(SND_SLASH);
        break;
    }
}
开发者ID:helmyarkan12,项目名称:nxengine-libretro,代码行数:49,代码来源:blade.cpp


示例17: ai_ironh_fishy

void ai_ironh_fishy(Object *o)
{
	switch(o->state)
	{
		case 0:
		{
			o->state = 10;
			o->animtimer = 0;
			o->yinertia = random(-0x200, 0x200);
			o->xinertia = 0x800;
		}
		case 10:			// harmless fishy
		{
			ANIMATE(2, 0, 1);
			if (o->xinertia < 0)
			{
				o->damage = 3;
				o->state = 20;
			}
		}
		break;
		
		case 20:			// puffer fish
		{
			ANIMATE(2, 2, 3);
			
			if (o->x < (48<<CSF))
				o->Delete();
		}
		break;
	}
	
	if (o->blocku) o->yinertia = 0x200;
	if (o->blockd) o->yinertia = -0x200;
	o->xinertia -= 0x0c;
}
开发者ID:Fordi,项目名称:nxengine-evo,代码行数:36,代码来源:ironhead.cpp


示例18: ai_fuzz_core

void ai_fuzz_core(Object *o)
{
    ANIMATE(2, 0, 1);

    switch(o->state)
    {
    case 0:
    {
        // spawn mini-fuzzes
        int angle = 120;
        for(int i=0; i<5; i++)
        {
            Object *f = CreateObject(o->CenterX(), o->CenterY(), OBJ_FUZZ);
            f->linkedobject = o;
            f->angle = angle;
            angle += (256 / 5);
        }

        o->timer = random(1, 50);
        o->state = 1;
    }
    case 1:		// de-syncs the Y positions when multiple cores are present at once
    {
        if (--o->timer <= 0)
        {
            o->state = 2;
            o->yinertia = 0x300;
            o->ymark = o->y;
        }
    }
    break;

    case 2:
    {
        FACEPLAYER;

        if (o->y > o->ymark) o->yinertia -= 0x10;
        if (o->y < o->ymark) o->yinertia += 0x10;
        LIMITY(0x355);
    }
    break;
    }
}
开发者ID:GameMaker2k,项目名称:NXEngine,代码行数:43,代码来源:labyrinth_m.cpp


示例19: ai_toroko_teleport_in

void ai_toroko_teleport_in(Object *o)
{
	switch(o->state)
	{
		case 0:
		{
			o->state = 1;
			o->timer = 0;
			o->flags &= ~FLAG_IGNORE_SOLID;		// this is set in npc.tbl, but uh, why?
		}
		case 1:
		{
			if (DoTeleportIn(o, 2))
			{
				o->frame = 1;
				o->state = 2;
				o->animtimer = 0;
			}
		}
		break;
		
		case 2:
			ANIMATE(2, 1, 4);
			
			if (o->blockd)
			{
				o->state = 4;
				o->frame = 6;		// tripping frame
				sound(SND_THUD);
			}
		break;
		
		case 4: break;			// knocked out
	}
	
	// fall unless teleporting
	if (o->state >= 2)
	{
		o->yinertia += 0x20;
		LIMITY(0x5ff);
	}
}
开发者ID:Angluca,项目名称:nxengine-libretro,代码行数:42,代码来源:npcregu.cpp


示例20: ai_bute_dying

void ai_bute_dying(Object *o)
{

	switch(o->state)
	{
		case 0:
		{
			o->flags &= ~(FLAG_SHOOTABLE | FLAG_IGNORE_SOLID | FLAG_SHOW_FLOATTEXT);
			o->damage = 0;
			o->frame = 0;
			o->animtimer = 0;
			o->state = 1;
			
			o->yinertia = -0x200;
		}
		case 1:
		{
			if (o->blockd && o->yinertia >= 0)
			{
				o->state = 2;
				o->timer = 0;
				o->frame = 1;
			}
		}
		break;
		
		case 2:
		{
			o->xinertia *= 8;
			o->xinertia /= 9;
			
			ANIMATE(3, 1, 2);
			
			if (++o->timer > 50)
				o->DealDamage(10000);
		}
		break;
	}
	
	o->yinertia += 0x20;
	LIMITY(0x5ff);
}
开发者ID:Angluca,项目名称:nxengine-libretro,代码行数:42,代码来源:hell.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ANIM_animdata_filter函数代码示例发布时间:2022-05-30
下一篇:
C++ ANGLE_TRY函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap