コード例 #1
0
__attribute__((used)) void gameRun() {
   objects = malloc(sizeof(Entity*) * numEntities);

   playerSprite = malloc(sizeof(Sprite));
   playerSprite->offset.x = 0;
   playerSprite->offset.y = 395;
   playerSprite->size.x = 80;
   playerSprite->size.y = 35;
   playerSprite->speed = 5.0;
   playerSprite->img = IMG_BOSSES;
   playerSprite->numFrames = 3;
   playerSprite->_index = 0;

   playerEntity = makeEntity(ENTITY_PLAYER, playerSprite);
   objects[numEntities - 1] = playerEntity;

   for(int i=0; i<numEntities-1; i++) {
       objects[i] = makeEntity(ENTITY_ENEMY, makeEnemySprite());
   }

   cells = makeCells(getWidth(), getHeight(), 6, 6);

   last = getCurrentTime() / (float)1000.0;
   emscripten_set_main_loop(heartbeat, 0, 0);
}
コード例 #2
0
CellContainer::CellContainer(int Nx, int Ny, int Nz, double r_cut)
{
    this->Nx = Nx;
    this->Ny = Ny;
    this->Nz = Nz;
    this->N = Nx*Ny*Nz;
    this->numberOfAtoms = 0;
    this->r_cut = r_cut;
    first = true;
    makeCells();

}
コード例 #3
0
ファイル: Tetramino.cpp プロジェクト: UltraSabreman/Tetris
Tetramino::Tetramino(Game *game, TetraTypes *type, int offsetX, int offsetY, int rotation)
{
	_type = type;
	_game = game;
	_rotation = rotation;
	_offsetX = offsetX;
	_offsetY = offsetY;

	makeCells();
	_realrot = 0;
	_rotation = 0;
}