void Display::addSnakeSprite(std::list<ISnake *> sList) { ISnake *back; back = sList.back(); this->addElem(back->getX(), back->getY(), "boule.png"); this->_snakeSize += 1; }
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); }
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); }
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); }