Merge pull request #3 from IngenerkaTeamCenter/2-заготовки-мульта

2 заготовки мульта
This commit is contained in:
Mikhail Abramov 2018-02-23 15:11:20 +04:00 committed by GitHub
commit ce35402bff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,35 @@
#include "TXLib.h"
int main()
{
txCreateWindow(800, 600);
HDC texture = txLoadImage("Pictures\\Personaj.bmp");
int textureX = 10;
int textureY = 10;
int nomer_kadra = 0;
while (textureX < 1000)
{
txSetColor(TX_RED);
txSetFillColor(TX_RED);
txRectangle(0, 0, txGetExtentX(), txGetExtentY());
txTransparentBlt(txDC(), textureX, textureY, 55, 86, texture, 55 * nomer_kadra, 0, RGB(0, 255, 255));
textureX++;
nomer_kadra++;
if (nomer_kadra > 2)
{
nomer_kadra = 0;
}
txSleep(10);
}
txDeleteDC(texture);
return 0;
}

View file

@ -0,0 +1,44 @@
#include "TXLib.h"
int main()
{
txCreateWindow(800, 600);
HDC texture = txLoadImage("Pictures\\Personaj.bmp");
double textureX = 50;
double textureY = 50;
double angle = 0;
double nomer_kadra = 0;
while (!GetAsyncKeyState(VK_ESCAPE))
{
txSetColor(TX_RED);
txSetFillColor(TX_RED);
txRectangle(0, 0, txGetExtentX(), txGetExtentY());
/*textureX++;
textureY = 300 + 150 * sin(textureX / 10);*/
angle++;
textureX = 500 + 200 * cos (angle / 10);
textureY = 300 + 200 * sin (angle / 10);
txTransparentBlt(txDC(), textureX, textureY, 55, 86, texture, 55 * nomer_kadra, 0, RGB(0, 255, 255));
////////////////////////////////////////////////
nomer_kadra++;
if (nomer_kadra > 2)
{
nomer_kadra = 0;
}
txSleep(10);
}
txDeleteDC(texture);
return 0;
}