Merge pull request #6 from IngenerkaTeamCenter/nikpopl-patch-1

Пример мульта с 2 игроками
This commit is contained in:
Mikhail Abramov 2018-03-03 10:28:56 +04:00 committed by GitHub
commit 4a7647c831
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,50 @@
#include "TXLib.h"
int main()
{
txCreateWindow(800, 600);
HDC tex_1 = txLoadImage("Pictures\\Personaj.bmp");
HDC tex_2 = txLoadImage("Pictures\\asa.bmp");
int tex_1X = 10;
int tex_1Y = 10;
int tex_2X = 10;
int tex_2Y = 500;
//Ïåðñíîàæ 1 äâèæåòñÿ ñ 1 ïî 3 ñåêóíäû, ïåðñîíàæ 2 - ñî 2 ïî 4
double angle = 0;
double Time = 0;
while (tex_1X < 1000)
{
txSetColor(TX_RED);
txSetFillColor(TX_RED);
txRectangle(0, 0, txGetExtentX(), txGetExtentY());
if ((Time >= 1) && (Time <= 3))
{
txTransparentBlt(txDC(), tex_1X, tex_1Y, 55, 86, tex_1, 0, 0, RGB(0, 255, 255));
tex_1Y++ ;
}
if ((Time >= 2) && (Time <= 4))
{
txTransparentBlt(txDC(), tex_2X, tex_2Y, 55, 86, tex_2, 0, 0, RGB(0, 255, 255));
tex_2Y--;
}
txSleep(100);
Time = Time + 0.1;
txSleep(10);
}
txDeleteDC(tex_1);
txDeleteDC(tex_2);
return 0;
}