void UserInterface::Init() 
{
	window->setStyleSheet("background-color: #7ac5cd;");
	window->setFixedSize(400, 200);
	window->move(900, 200);
	//---------------------------------------
	SetLabelProperties();
	SetInputLineProperties();
	//---------------------------------------
	QVBoxLayout *mainLayout = new QVBoxLayout;

	//------------------------------------------

	CreateHead();
	CreatePlaneDetails();

	//-----------------------------------------	
	mainLayout->addLayout(head);
	mainLayout->addWidget(_strategy);

	//_----------------------------------------- connects

	connect(_xf, SIGNAL(textChanged(const QString)), this, SLOT(newsegment()));	//küld eventet, a textedited nem küld
	connect(_yf, SIGNAL(textChanged(const QString)), this, SLOT(newsegment()));
	connect(_xn, SIGNAL(textChanged(const QString)), this, SLOT(newsegment()));
	connect(_yn, SIGNAL(textChanged(const QString)), this, SLOT(newsegment()));

	connect(_width, SIGNAL(textChanged(const QString)), this, SLOT(newwidth()));
	connect(_unit, SIGNAL(textChanged(const QString)), this, SLOT(newwidth()));

	//-------------------------------------------

	window->setLayout(mainLayout);
	window->show();
}
Exemplo n.º 2
0
void Snake::CreateStartingSnake()
{
	//Tworzy wê¿a, jaki zaczyna sê grê.
	State = SnakeState::GoingUp;
	RealSnake.push_back(CreateHead(7,2));
	for (size_t i = 3; i < 6; i++)
	{
		RealSnake.push_back(CreateElement(7,i));
	}
	GrowInSize();
}