本文整理汇总了C++中Tower::Load方法的典型用法代码示例。如果您正苦于以下问题:C++ Tower::Load方法的具体用法?C++ Tower::Load怎么用?C++ Tower::Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tower
的用法示例。
在下文中一共展示了Tower::Load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
// Function: main()
int main(int argc, char ** argv)
{
PA_Init(); // Initializes PA_Lib
PA_InitVBL(); // Initializes a standard VBL
PA_InitText(1,1);
Drawable cursor(0,0,0);
cursor.Load(0, 0, (void*)pal_cursor, (void*)gfx_cursor, OBJ_SIZE_16X16, 1);
setupRotations();
u8 c = 0;
u8 x = 0;
u8 y = 0;
for (y = 0; y != 8; ++y) {
for (x = 0; x != 8; ++x) {
u16 i = y*8+x;
if (grid[i] == 1) {
Tower tower = Tower(SPRITE_TOWER_BASE+c, x*16, y*16);
tower.Load(0, 1, (void*)pal_tower, (void*)gfx_tower, OBJ_SIZE_16X16, 1);
tower_list.push_back(tower);
PA_SetSpriteRotEnable(0, tower.sprite, c);
++c;
}
}
}
s16 angle = 0;
// Infinite loop to keep the program running
while (1)
{
u8 i = 0;
for (tlist_it it = tower_list.begin(); it != tower_list.end(); ++it) {
angle = (*it).GetAngleTo(cursor);
PA_SetRotsetNoZoom(0, i, angle);
++i;
}
PA_OutputText(1, 0, 0, "Angle: %03d", angle);
PA_OutputText(1, 0, 1, "Angle2: %03d", angle);
PA_OutputText(1, 0, 2, "Cursor: %03d,%03d", cursor.position.x, cursor.position.y);
if (Stylus.Held) {
cursor.position.x = Stylus.X;
cursor.position.y = Stylus.Y;
} else {
cursor.position.x += (Pad.Held.Right - Pad.Held.Left);
cursor.position.y += (Pad.Held.Down - Pad.Held.Up);
}
cursor.Draw();
PA_WaitForVBL();
}
return 0;
} // End of main()