本文整理汇总了C++中Shot::SetModel方法的典型用法代码示例。如果您正苦于以下问题:C++ Shot::SetModel方法的具体用法?C++ Shot::SetModel怎么用?C++ Shot::SetModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shot
的用法示例。
在下文中一共展示了Shot::SetModel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StartLevel
void GameBase::StartLevel(void)
{
unsigned int i;
unsigned int j;
Ship *ship;
Shot *shot;
Rock *rock;
GameObject **go=m_objects; /* collision objects list */
GameParticle *particle;
m_paused=false;
/* init the players first */
for(i=0;i<MAXPLAYERS;++i)
{
ship=&m_ship[i];
*(go++)=ship;
ship->m_type=OBJTYPE_SHIP;
ship->m_index=i;
ship->m_shotdelay=0;
ship->m_game=this;
ship->m_state=STATE_APPEAR;
ship->m_statedelay=0;
if(!m_level)
{
ship->m_active=(i<m_numplayers);
ship->m_heading=0.0f;
ship->SetModel(&g_shipmodel);
ship->m_x=((m_numplayers/2.0f)*-60.0f)+(i*60.0f);
ship->m_y=0.0f;
ship->m_speedx=0.0f;
ship->m_speedy=0.0f;
ship->m_showthrust=0;
}
for(j=0;j<MAXSHOTS;++j)
{
shot=&ship->m_shot[j];
*(go++)=shot;
shot->m_type=OBJTYPE_SHOT;
shot->m_ship=ship;
shot->m_game=this;
shot->m_active=false;
shot->SetModel(g_shotmodel);
}
}
*(go++)=&m_ufo;
m_ufo.m_type=OBJTYPE_UFO;
m_ufo.SetModel(&g_ufomodel);
m_ufo.m_game=this;
m_ufo.m_active=true;
m_ufo.m_heading=0.0f;
m_ufo.m_x=0.0f;
m_ufo.m_y=-100.0f;
m_ufo.m_active=false;
m_ufo.m_appeardelay=0;
m_ufo.m_shotdelay=0;
for(j=0;j<MAXSHOTS;++j)
{
shot=&m_ufo.m_shot[j];
*(go++)=shot;
shot->m_type=OBJTYPE_UFOSHOT;
shot->m_ship=0;
shot->m_game=this;
shot->m_active=false;
shot->SetModel(g_shotmodel);
}
m_beat=0;
m_beatcount=0;
m_beatdelay=60-(m_level*3);
/* vary the number of rocks depending on the level */
m_numrocks=4+m_level;
if(m_numrocks>12)
m_numrocks=12;
/* init the rocks */
for(i=0;i<MAXROCKS;++i)
{
rock=&m_rock[i];
*(go++)=rock;
rock->m_game=this;
rock->m_type=OBJTYPE_ROCK;
if(i<m_numrocks)
{
rock->m_active=true;
rock->m_size=0;
rock->m_x=Rand(m_w)-m_cx;
rock->m_y=Rand(m_h)-m_cy;
GenerateRock(rock);
//.........这里部分代码省略.........