replace BrickEdge object with triangle drawing function

shapetextures
Maikel de Vries 2015-12-28 10:19:39 +01:00
parent 3f7e05caa6
commit 5a02cd049f
8 changed files with 13 additions and 48 deletions

View File

@ -137,20 +137,10 @@ global func PlaceEdges()
var x=[124, 116, 116, 236, 236, 223, 308, 364, 380, 353, 353, 336, 388, 724, 37, 45, 53, 356, 348, 118, 118, 732, 437, 437, 126, 118, 137, 145, 183, 175, 156, 164, 221, 194, 213, 202, 107, 99, 80, 88, 69, 46, 54, 74, 66, 86, 94, 45, 45, 45, 45, 45, 45, 140, 231, 677, 733, 212, 204, 122, 130, 234, 226, 239, 247, 217, 188, 188, 373, 353, 353, 389, 365, 397, 206, 214, 194, 186, 227, 219, 196, 204, 154, 146, 166, 174, 134, 126, 106, 114, 45, 45, 316, 308, 327, 335, 308, 194, 187, 174, 166, 53, 53, 394, 404, 386, 373, 270, 259, 240, 232, 278, 251, 297, 289, 308, 308, 53, 53, 130, 122, 146, 154, 167, 174, 186, 194, 205, 213, 224, 232, 196, 205, 225, 237, 257, 245, 205, 336, 336, 336, 373, 386, 420, 394, 357, 69, 69, 157, 157, 205, 347, 355, 375, 367, 407, 395, 387, 415, 435, 427, 429, 297, 305, 285, 277, 265, 325, 317, 267, 259, 279, 287, 307, 299, 340, 327, 319, 348, 356, 396, 353, 336, 353, 336];
var y=[261, 261, 269, 313, 305, 300, 388, 156, 148, 218, 210, 210, 140, 357, 301, 269, 261, 309, 301, 305, 313, 349, 301, 309, 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, 157, 157, 157, 157, 157, 157, 173, 165, 185, 193, 213, 205, 277, 300, 300, 308, 300, 300, 301, 301, 157, 157, 188, 188, 205, 237, 229, 165, 205, 223, 157, 189, 148, 157, 157, 157, 157, 188, 188, 188, 188, 157, 157, 157, 157, 157, 157, 157, 157, 225, 232, 348, 349, 348, 348, 356, 300, 300, 300, 300, 328, 321, 317, 317, 317, 317, 388, 388, 388, 388, 388, 388, 388, 388, 366, 374, 338, 346, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 237, 205, 205, 205, 205, 205, 215, 205, 223, 218, 300, 300, 300, 300, 276, 377, 369, 268, 276, 223, 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, 317, 205, 205, 205, 205, 205, 205, 205, 188, 188, 188, 188, 188, 188, 188, 188, 188, 180, 164, 140, 231, 231, 237, 237];
var d=[0, 1, 3, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 2, 2, 2, 2, 3, 3, 1, 3, 2, 0, 2, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 3, 2, 2, 3, 3, 2, 2, 0, 0, 2, 2, 0, 3, 0, 0, 0, 0, 1, 1, 0, 2, 3, 1, 0, 3, 3, 1, 2, 2, 0, 2, 2, 2, 3, 2, 2, 3, 0, 1, 1, 0, 2, 3, 3, 2, 2, 3, 3, 2, 0, 2, 0, 1, 1, 0, 3, 0, 1, 0, 1, 2, 0, 2, 3, 3, 2, 1, 0, 0, 1, 0, 1, 0, 1, 1, 3, 0, 2, 2, 3, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 2, 2, 3, 3, 2, 0, 3, 1, 3, 0, 1, 1, 0, 0, 2, 0, 0, 2, 2, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 2, 3, 2, 2, 3, 2, 2, 3, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 2, 3, 0, 1];
var o=[1,0,3,2];
for (var i = 0; i < GetLength(x); i++)
{
var edge=CreateObjectAbove(BrickEdge, x[i], y[i] + 5, NO_OWNER);
edge->Initialize();
edge->SetP(d[i]);
edge->SetPosition(x[i],y[i]);
edge->PermaEdge();
edge=CreateObjectAbove(BrickEdge, x[i], y[i] + 5, NO_OWNER);
edge->Initialize();
edge->SetP(o[d[i]]);
edge->SetPosition(LandscapeWidth()-x[i],y[i]);
edge->PermaEdge();
DrawMaterialTriangle("Brick-brick", x[i], y[i], [0,3,1,2][d[i]]);
DrawMaterialTriangle("Brick-brick", LandscapeWidth() + 1 - x[i], y[i], [3,0,2,1][d[i]]);
}
return 1;
}

View File

@ -21,17 +21,11 @@ protected func Initialize()
Sound("Environment::BirdsLoop", true, 100, nil, 1);
// Brick edges at horizontal moving bricks.
var x=[525, 436, 436, 525, 812, 812, 716, 716, 573, 573, 213, 213];
var y=[692, 677, 692, 677, 653, 668, 500, 485, 500, 485, 677, 692];
var d=[2, 1, 3, 0, 1, 3, 3, 1, 2, 0, 0, 2];
var x = [524, 436, 436, 524, 812, 812, 716, 716, 572, 572, 212, 212];
var y = [692, 676, 692, 676, 652, 668, 500, 484, 500, 484, 676, 692];
var d = [1, 3, 2, 0, 3, 2, 2, 3, 1, 0, 0, 1];
for (var i = 0; i < GetLength(x); i++)
{
var edge=CreateObjectAbove(BrickEdge, x[i], y[i], NO_OWNER);
edge->Initialize();
edge->SetP(d[i]);
edge->SetPosition(x[i],y[i]);
edge->PermaEdge();
}
DrawMaterialTriangle("Brick-brick", x[i], y[i], d[i]);
// Vertically moving bricks
var brick = CreateObjectAbove(MovingBrick, 660, 90);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -33,19 +33,6 @@ protected func Initialize()
// Objects fade after 5 seconds.
CreateObject(Rule_ObjectFade)->DoFadeTime(5 * 36);
// Smooth brick edges.
var x=[188, 205, 261, 244, 308, 325];
var y=[124, 124, 132, 132, 108, 108];
var d=[3, 2, 2, 3, 3, 2];
for (var i = 0; i < GetLength(x); i++)
{
var edge=CreateObjectAbove(BrickEdge, x[i], y[i], NO_OWNER);
edge->Initialize();
edge->SetP(d[i]);
edge->SetPosition(x[i],y[i]);
edge->PermaEdge();
}
AddEffect("DryTime",nil,100,2);
return;
}

View File

@ -24,7 +24,7 @@ protected func Initialize()
AddEffect("RandomMeteor", nil, 100, 20);
AddEffect("DangerousLava", nil, 100, 1);
// Smooth brick edges.
PlaceEdges();
PlaceGras();
return;
@ -47,17 +47,11 @@ global func FxRandomMeteorTimer()
private func PlaceEdges()
{
var x=[69, 69, 76, 84, 484, 76, 565, 565, 532, 68, 68, 476, 468, 235, 665, 675, 685, 775, 685, 775, 532, 765, 695, 765, 765, 365, 525, 505];
var y=[357, 349, 364, 364, 260, 300, 305, 313, 313, 300, 308, 260, 268, 495, 375, 365, 355, 355, 275, 415, 305, 345, 345, 255, 285, 445, 445, 435];
var d=[3, 1, 3, 2, 0, 0, 1, 3, 2, 1, 3, 1, 1, 3, 1, 1, 1, 0, 3, 2, 0, 0, 1, 1, 3, 3, 2, 3];
var x = [69, 69, 76, 84, 484, 76, 565, 565, 532, 68, 68, 476, 468, 532];
var y = [357, 349, 364, 364, 260, 300, 305, 313, 313, 300, 308, 260, 268, 305];
var d = [2, 3, 2, 1, 0, 0, 3, 2, 1, 3, 2, 3, 3, 0];
for (var i = 0; i < GetLength(x); i++)
{
var edge=CreateObjectAbove(BrickEdge, x[i], y[i] + 4, NO_OWNER);
edge->Initialize();
edge->SetP(d[i]);
edge->SetPosition(x[i],y[i]);
edge->PermaEdge();
}
DrawMaterialTriangle("Brick-brick", x[i], y[i], d[i]);
return;
}

View File

@ -38,7 +38,6 @@ protected func Initialize()
CreateObjectAbove(Chest, 355, 390, NO_OWNER)->MakeInvincible();
AddEffect("IntFillChests", nil, 100, 2 * 36, nil);
// Smooth brick edges.
AddEffect("ChanneledWind", nil, 1, 1, nil);
AddEffect("Balloons", nil, 100, 100, nil);
@ -49,7 +48,8 @@ protected func Initialize()
brick = CreateObjectAbove(MovingBrick,550,250);
brick->MoveVertical(240, 296);
CreateObjectAbove(BrickEdge, 380, 416)->PermaEdge();
// Smooth brick edges.
DrawMaterialTriangle("Brick-brick", 380, 412, 0);
PlaceGras();