예제 #1
0
파일: Display.cpp 프로젝트: nev910/nibbler
void			Display::addSnakeSprite(std::list<ISnake *> sList)
{
  ISnake	*back;
  back = sList.back();
  this->addElem(back->getX(), back->getY(), "boule.png");
  this->_snakeSize += 1;
}
예제 #2
0
void			Game::updateSList(std::list<ISnake *> &list) const
{
  ISnake	*back;

  back = new Snake();
  back->setX(list.back()->getX() - SIDE);
  back->setY(list.back()->getY());
  list.push_back(back);
}
예제 #3
0
파일: Game.cpp 프로젝트: nev910/nibbler
std::list<ISnake *>	Game::updateSList(std::list<ISnake *> list)
{
  ISnake	*back;

  back = new Snake();
  back->setX(list.back()->getX() - SIDE);
  back->setY(list.back()->getY());
  list.push_back(back);
  return (list);
}
예제 #4
0
파일: Display.cpp 프로젝트: nev910/nibbler
void			Display::onOriginalList(std::list<ISnake *> &list, char func)
{
  ISnake	*tmp;
  int		x;
  int		y;
  
  tmp = list.back();
  list.pop_back();
  x = list.front()->getX();
  y = list.front()->getY();
  if (func == 1)
    y -= 20;
  else if (func == 2)
    y += 20;
  else if (func == 3)
    x -= 20;
  else if (func == 4)
    x += 20;
  tmp->setX(x);
  tmp->setY(y);
  list.push_front(tmp);
}