update linux templates
This commit is contained in:
parent
d86f98b0ee
commit
4b8883062b
|
@ -11,7 +11,7 @@ void updateRadius(int baseL, int outerL, int pointL, int *pBaseR, int *pOuterR,
|
|||
totalL+=pointL;
|
||||
else
|
||||
totalL+=outerL;
|
||||
int totalR = 420;
|
||||
int totalR = 340;
|
||||
int remainder = totalR % totalL;
|
||||
if (remainder!=0) {
|
||||
if (remainder < totalL / 2) {
|
||||
|
@ -31,21 +31,21 @@ int main() {
|
|||
int outerL=13;
|
||||
int pointL=3;
|
||||
int baseR,outerR,pointR;
|
||||
int cx=450,cy=450;
|
||||
int cx=350,cy=350;
|
||||
int speed = 1;
|
||||
Color trackColor = BLUE;
|
||||
updateRadius(baseL, outerL, pointL, &baseR, &outerR, & pointR);
|
||||
InitWindow(1300,900,"Epitrochoid");
|
||||
InitWindow(1000,700,"Epitrochoid");
|
||||
SetTraceLogLevel(LOG_WARNING);
|
||||
SetTargetFPS(60);
|
||||
GuiSetStyle(DEFAULT,TEXT_SIZE,20);
|
||||
|
||||
Image trackImage=GenImageColor(900,900,WHITE);
|
||||
Image trackImage=GenImageColor(700,700,WHITE);
|
||||
//border
|
||||
ImageFillRectangleEx(&trackImage,0,0,900,900,LIGHTGRAY);
|
||||
ImageFillRectangleEx(&trackImage,5,5,890,890,WHITE);
|
||||
ImageFillRectangleEx(&trackImage,0,0,700,700,LIGHTGRAY);
|
||||
ImageFillRectangleEx(&trackImage,5,5,690,690,WHITE);
|
||||
|
||||
Image circlesImage = GenImageColor(900,900,BLANK);
|
||||
Image circlesImage = GenImageColor(700,700,BLANK);
|
||||
float r=0;
|
||||
int lastx,lasty;
|
||||
lasty=cy;
|
||||
|
@ -57,9 +57,9 @@ int main() {
|
|||
int newBaseL = GuiSliderBar((Rectangle){ 70, 60, 200, 30 },"Base",TextFormat("%i", (int)baseL), baseL, 1, 50);
|
||||
int newPointL = GuiSliderBar((Rectangle){ 70, 100, 200, 30 },"Point",TextFormat("%i", (int)pointL), pointL, 1, 50);
|
||||
speed = GuiSliderBar((Rectangle){ 70, 150, 200, 30 },"Speed",TextFormat("%i", (int)speed), speed, 1, 50);
|
||||
GuiLabel((Rectangle){ 20, 220, 80, 30 },TextFormat("Color: 0x%X%X%X ",(int)(trackColor.r), (int)(trackColor.g),(int)(trackColor.b)));
|
||||
GuiLabel((Rectangle){ 20, 220, 80, 30 },TextFormat("Color: 0x%02X%02X%02X ",(int)(trackColor.r), (int)(trackColor.g),(int)(trackColor.b)));
|
||||
trackColor= GuiColorPicker((Rectangle){ 50, 250, 196, 192 }, NULL, trackColor);
|
||||
int doClear = GuiButton((Rectangle){ 120, 700, 80, 30 },"Clear");
|
||||
int doClear = GuiButton((Rectangle){ 120, 500, 80, 30 },"Clear");
|
||||
if (newOuterL!=outerL || newBaseL!=baseL || newPointL!=pointL) {
|
||||
if (newOuterL!=outerL)
|
||||
pointL=newOuterL;
|
||||
|
@ -72,12 +72,12 @@ int main() {
|
|||
lastx=cx+(baseR+outerR-pointR);
|
||||
r=0;
|
||||
ImageClearBackground(&trackImage,WHITE);
|
||||
ImageFillRectangleEx(&trackImage,0,0,900,900,LIGHTGRAY);
|
||||
ImageFillRectangleEx(&trackImage,5,5,890,890,WHITE);
|
||||
ImageFillRectangleEx(&trackImage,0,0,700,700,LIGHTGRAY);
|
||||
ImageFillRectangleEx(&trackImage,5,5,690,690,WHITE);
|
||||
} else if (doClear) {
|
||||
ImageClearBackground(&trackImage,WHITE);
|
||||
ImageFillRectangleEx(&trackImage,0,0,900,900,LIGHTGRAY);
|
||||
ImageFillRectangleEx(&trackImage,5,5,890,890,WHITE);
|
||||
ImageFillRectangleEx(&trackImage,0,0,700,700,LIGHTGRAY);
|
||||
ImageFillRectangleEx(&trackImage,5,5,690,690,WHITE);
|
||||
}
|
||||
//update datas
|
||||
r+=0.01;
|
||||
|
|
|
@ -11,6 +11,7 @@ Category[zh_CN]=游戏
|
|||
[Unit0]
|
||||
CName=main.c
|
||||
C=epitrochoid_c.txt
|
||||
C[zh_CN]=epitrochoid_zh_CN.c
|
||||
|
||||
[Project]
|
||||
UnitCount=1
|
||||
|
|
|
@ -17,7 +17,7 @@ void updateRadius(int baseL, int innerL,int pointL, int *pBaseR, int *pInnerR, i
|
|||
if (pointL>innerL)
|
||||
totalL = baseL-innerL+pointL;
|
||||
}
|
||||
int totalR = 420;
|
||||
int totalR = 320;
|
||||
int remainder = totalR % totalL;
|
||||
if (remainder!=0) {
|
||||
if (remainder < totalL / 2) {
|
||||
|
@ -37,21 +37,21 @@ int main() {
|
|||
int innerL=3;
|
||||
int pointL=6;
|
||||
int baseR,innerR,pointR;
|
||||
int cx=450,cy=450;
|
||||
int cx=350,cy=350;
|
||||
int speed = 1;
|
||||
Color trackColor = BLUE;
|
||||
updateRadius(baseL, innerL, pointL, &baseR, &innerR, &pointR);
|
||||
InitWindow(1300,900,"Hypotrochoid");
|
||||
InitWindow(1100,700,"Hypotrochoid");
|
||||
SetTraceLogLevel(LOG_WARNING);
|
||||
SetTargetFPS(60);
|
||||
GuiSetStyle(DEFAULT,TEXT_SIZE,20);
|
||||
|
||||
Image trackImage=GenImageColor(900,900,WHITE);
|
||||
Image trackImage=GenImageColor(700,700,WHITE);
|
||||
//border
|
||||
ImageFillRectangleEx(&trackImage,0,0,900,900,LIGHTGRAY);
|
||||
ImageFillRectangleEx(&trackImage,5,5,890,890,WHITE);
|
||||
ImageFillRectangleEx(&trackImage,0,0,700,700,LIGHTGRAY);
|
||||
ImageFillRectangleEx(&trackImage,5,5,690,690,WHITE);
|
||||
|
||||
Image circlesImage = GenImageColor(900,900,BLANK);
|
||||
Image circlesImage = GenImageColor(700,700,BLANK);
|
||||
float r=0;
|
||||
int lastx,lasty;
|
||||
bool skip=true;
|
||||
|
@ -64,9 +64,9 @@ int main() {
|
|||
int newBaseL = GuiSliderBar((Rectangle){ 70, 60, 200, 30 },"Base",TextFormat("%i", (int)baseL), baseL, 1, 50);
|
||||
int newPointL = GuiSliderBar((Rectangle){ 70, 100, 200, 30 },"Point",TextFormat("%i", (int)pointL), pointL, 1, 50);
|
||||
speed = GuiSliderBar((Rectangle){ 70, 150, 200, 30 },"Speed",TextFormat("%i", (int)speed), speed, 1, 50);
|
||||
GuiLabel((Rectangle){ 20, 220, 80, 30 },TextFormat("Color: 0x%X%X%X ",(int)(trackColor.r), (int)(trackColor.g),(int)(trackColor.b)));
|
||||
GuiLabel((Rectangle){ 20, 220, 200, 30 },TextFormat("Color: 0x%02X%02X%02X ",(int)(trackColor.r), (int)(trackColor.g),(int)(trackColor.b)));
|
||||
trackColor= GuiColorPicker((Rectangle){ 50, 250, 196, 192 }, NULL, trackColor);
|
||||
int doClear = GuiButton((Rectangle){ 120, 700, 80, 30 },"Clear");
|
||||
int doClear = GuiButton((Rectangle){ 120, 500, 80, 30 },"Clear");
|
||||
if (newInnerL!=innerL || newBaseL!=baseL || newPointL!=pointL) {
|
||||
if (newInnerL!=innerL)
|
||||
pointL=newInnerL;
|
||||
|
@ -78,12 +78,12 @@ int main() {
|
|||
r=0;
|
||||
skip=true;
|
||||
ImageClearBackground(&trackImage,WHITE);
|
||||
ImageFillRectangleEx(&trackImage,0,0,900,900,LIGHTGRAY);
|
||||
ImageFillRectangleEx(&trackImage,5,5,890,890,WHITE);
|
||||
ImageFillRectangleEx(&trackImage,0,0,700,700,LIGHTGRAY);
|
||||
ImageFillRectangleEx(&trackImage,5,5,690,690,WHITE);
|
||||
} else if (doClear) {
|
||||
ImageClearBackground(&trackImage,WHITE);
|
||||
ImageFillRectangleEx(&trackImage,0,0,900,900,LIGHTGRAY);
|
||||
ImageFillRectangleEx(&trackImage,5,5,890,890,WHITE);
|
||||
ImageFillRectangleEx(&trackImage,0,0,700,700,LIGHTGRAY);
|
||||
ImageFillRectangleEx(&trackImage,5,5,690,690,WHITE);
|
||||
}
|
||||
//update datas
|
||||
float innerCX=cx+ (baseR-innerR)*cos(r);
|
||||
|
@ -137,4 +137,4 @@ int main() {
|
|||
UnloadImage(circlesImage);
|
||||
UnloadImage(trackImage);
|
||||
CloseWindow();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue