-- Scene: Classic Yoink -- created by Neil Carter -- converted to Lua by Charles McGarvey -- Scene API: -- -- Functions: -- SetPlayfieldBounds(point1, point2) -- SetMaximumBounds(point1, point2) -- ResetTransform() -- Translate(x, y, z) -- Scale(x, y, z) or Scale(xyz) -- Rotate(axis, degree) or Rotate(x, y, z) -- SetTexture(name) -- MakeTilemap({width = ..., surface_type = ..., tiles = {}}) -- MakeBillboard({tile = ..., u_scale = ...}) -- -- Globals: -- detail - level of detail of the scene SetPlayfieldBounds({0, 0, -100}, {1280, 500, 100}) SetMaximumBounds({-160, 0, -192}, {1440, 480, 224}) -- Left end tower block -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Front ResetTransform() Translate(-5, 0, 5) Scale(32) SetTexture("TowerBlock1") MakeTilemap({ width = 5, tiles = { 2, 2, 2, 2, 2, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 4, 4, 4, 4, 4 } }) -- Right side ResetTransform() Rotate(Y, 90) Translate(0, 0, 5) Scale(32) MakeTilemap({ width = 5, surface_type = RIGHT, tiles = { 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 4, 5, 5, 5, 4 } }) -- Top ResetTransform() Rotate(X, 90) Translate(-5, 15, 0) Scale(32) MakeTilemap({ width = 5, surface_type = TOP, tiles = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 } }) -- Leftmost background tower block -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Front if detail > 1 then ResetTransform() Scale(32) MakeTilemap({ width = 7, tiles = { 2, 2, 2, 2, 2, 2, 2, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 6, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 4, 4, 5, 5, 5, 4, 4 } }) -- Right side ResetTransform() Rotate(Y, 90) Translate(7, 0, 0) Scale(32) MakeTilemap({ width = 6, tiles = { 2, 2, 2, 2, 2, 2, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 4, 4, 4, 4, 4, 4 } }) -- Top ResetTransform() Rotate(X, 90) Translate(-2, 8, -6) Scale(32) MakeTilemap({ width = 9, tiles = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 } }) end -- Foreground building with pitched roof -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Left wall ResetTransform() Rotate(Y, -90) Translate(10, 0, 1) Scale(32) SetTexture("Building") MakeTilemap({ width = 4, surface_type = LEFT, tiles = { -1, 9, 11, -1, 9, 10, 12, 11, 15, 7, 7, 16, 3, 5, 6, 4, 3, 6, 5, 4 } }) -- Right wall ResetTransform() Rotate(Y, -90) Translate(13, 0, 1) Scale(32) MakeTilemap({ width = 4, surface_type = RIGHT, tiles = { -1, 9, 11, -1, 9, 10, 12, 11, 15, 7, 7, 16, 3, 5, 6, 4, 3, 8, 5, 4 } }) -- Front wall ResetTransform() Translate(10, 0, 5) Scale(32) MakeTilemap({ width = 3, tiles = { 15, 7, 16, 3, 5, 4, 3, 6, 4 } }) -- Pitched roof ResetTransform() Rotate(X, 135) Scale(1, 1.5, 1.5) Translate(10, 5, 3) Scale(32) MakeTilemap({ width = 3, tiles = { 13, 13, 13, 13, 13, 13 } }) -- Finial ResetTransform() Translate(10, 5, 3) Scale(32) MakeTilemap({ width = 3, tiles = { 18, 18, 18 } }) -- Cheaty invisible platform ResetTransform() Translate(10, 4, 3) Scale(32) MakeTilemap({ width = 3, surface_type = TOP, tiles = { -1, -1, -1 } }) -- The ground -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Courtyard ResetTransform() Rotate(X, 90) Translate(-3, 0, 0) Scale(32) SetTexture("Scenery") MakeTilemap({ width = 13, surface_type = TOP, tiles = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }) -- Front grass if detail > 2 then ResetTransform() Scale(8, 1, 1) Translate(1, -0.5, 5) Scale(32) MakeBillboard({ tile = 2, u_scale = 8 }) -- Back grass ResetTransform() Scale(8, 1, 1) Translate(1, -0.5, 1) Scale(32) MakeBillboard({ tile = 2, u_scale = 8 }) -- Left grass ResetTransform() Scale(4, 1, 1) Rotate(Y, -90) Translate(1, -0.5, 1) Scale(32) MakeBillboard({ tile = 2, u_scale = 4 }) -- Right grass ResetTransform() Scale(4, 1, 1) Rotate(Y, -90) Translate(9, -0.5, 1) Scale(32) MakeBillboard({ tile = 2, u_scale = 4 }) -- Fence behind house ResetTransform() Scale(11, 1, 1) Translate(7, 0, 0) Scale(32) MakeBillboard({ tile = 4, u_scale = 11 }) end -- Background building with pitched roof -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Front wall if detail > 1 then ResetTransform() Translate(19, 0, 0) Scale(32) SetTexture("Building") MakeTilemap({ width = 4, tiles = { -1, 9, 11, -1, 9, 10, 12, 11, 15, 7, 7, 16, 3, 6, 5, 4, 3, 5, 6, 4, 3, 8, 5, 4 } }) -- Left wall ResetTransform() Rotate(Y, -90) Translate(19, 0, -3) Scale(32) MakeTilemap({ width = 3, tiles = { 15, 1, 16, 3, 7, 4, 3, 5, 4, 3, 0, 4 } }) -- Right wall ResetTransform() Rotate(Y, -90) Translate(23, 0, -3) Scale(32) MakeTilemap({ width = 3, tiles = { 15, 0, 16, 3, 7, 4, 3, 6, 4, 3, 2, 4 } }) -- Left pitched roof ResetTransform() Rotate(X, 135) Scale(1, 1.5, 1.5) Rotate(Y, -90) Translate(21, 6, -3) Scale(32) MakeTilemap({ width = 3, tiles = { 13, 13, 13, 13, 13, 13 } }) -- Right pitched roof ResetTransform() Rotate(X, -135) Scale(1, 1.5, 1.5) Rotate(Y, -90) Translate(21, 6, -3) Scale(32) MakeTilemap({ width = 3, tiles = { 13, 13, 13, 13, 13, 13 } }) -- Finial ResetTransform() Rotate(Y, -90) Translate(21, 6, -3) Scale(32) MakeTilemap({ width = 3, tiles = { 18, 18, 18 } }) end -- More ground to the right -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Ground under house ResetTransform() Rotate(X, 90) Translate(10, 0, 0) Scale(32) SetTexture("Scenery") MakeTilemap({ width = 3, surface_type = TOP, tiles = { 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1 } }) -- Left part of center courtyard ResetTransform() Rotate(X, 90) Translate(13, 0, 0) Scale(32) MakeTilemap({ width = 8, surface_type = TOP, tiles = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0 } }) -- Front grass if detail > 2 then ResetTransform() Scale(12, 1, 1) Translate(14, -0.5, 5) Scale(32) MakeBillboard({ tile = 2, u_scale = 12 }) -- Back grass ResetTransform() Scale(4, 1, 1) Translate(14, -0.5, 1) Scale(32) MakeBillboard({ tile = 2, u_scale = 4 }) -- Front grass next to door ResetTransform() Translate(13, -0.5, 3) Scale(32) MakeBillboard({ tile = 2, u_scale = 1 }) -- Back grass next to door ResetTransform() Translate(13, -0.5, 2) Scale(32) MakeBillboard({ tile = 2, u_scale = 1 }) -- Left grass ResetTransform() Rotate(Y, -90) Translate(14, -0.5, 1) Scale(32) MakeTilemap({ width = 4, tiles = { 2, -1, 2, 2 } }) -- Grass left of house ResetTransform() Rotate(Y, -90) Translate(18, -0.5, 0) Scale(32) MakeBillboard({ tile = 2, u_scale = 1 }) -- Grass right of house ResetTransform() Rotate(Y, -90) Translate(24, -0.5, 0) Scale(32) MakeBillboard({ tile = 2, u_scale = 1 }) -- Front grass in center ResetTransform() Scale(4, 1, 1) Translate(19, -0.5, 4) Scale(32) MakeBillboard({ tile = 2, u_scale = 4 }) -- Back grass in center ResetTransform() Scale(4, 1, 1) Translate(19, -0.5, 2) Scale(32) MakeBillboard({ tile = 2, u_scale = 4 }) -- Left grass in center ResetTransform() Scale(2, 1, 1) Rotate(Y, -90) Translate(19, -0.5, 2) Scale(32) MakeBillboard({ tile = 2, u_scale = 2 }) -- Right grass in center ResetTransform() Scale(2, 1, 1) Rotate(Y, -90) Translate(23, -0.5, 2) Scale(32) MakeBillboard({ tile = 2, u_scale = 2 }) end -- Right part of center courtyard ResetTransform() Rotate(X, 90) Translate(21, 0, 0) Scale(32) MakeTilemap({ width = 7, surface_type = TOP, tiles = { 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 } }) -- Fence to right of back house if detail > 2 then ResetTransform() Scale(4, 1, 1) Translate(24, 0, 0) Scale(32) MakeBillboard({ tile = 4, u_scale = 4 }) -- Grass in front of fence ResetTransform() Scale(4, 1, 1) Translate(24, -0.5, 1) Scale(32) MakeBillboard({ tile = 2, u_scale = 4 }) -- Grass to left of tower block ResetTransform() Scale(2, 1, 1) Rotate(Y, -90) Translate(26, -0.5, 5) Scale(32) MakeBillboard({ tile = 2, u_scale = 2 }) -- Grass to right of tower block ResetTransform() Scale(2, 1, 1) Rotate(Y, -90) Translate(35, -0.5, 5) Scale(32) MakeBillboard({ tile = 2, u_scale = 2 }) -- Next bit of grass ResetTransform() Scale(5, 1, 1) Translate(35, -0.5, 5) Scale(32) MakeBillboard({ tile = 2, u_scale = 5 }) -- Back grass ResetTransform() Scale(6, 1, 1) Translate(34, -0.5, 1) Scale(32) MakeBillboard({ tile = 2, u_scale = 6 }) -- Extra bit of back grass ResetTransform() Rotate(Y, -90) Translate(34, -0.5, 0) Scale(32) MakeBillboard({ tile = 2, u_scale = 1 }) end -- Ground around tower block ResetTransform() Rotate(X, 90) Translate(28, 0, 4) Scale(32) MakeTilemap({ width = 5, surface_type = TOP, tiles = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }) -- Rightmost ground ResetTransform() Rotate(X, 90) Translate(33, 0, 0) Scale(32) MakeTilemap({ width = 10, surface_type = TOP, tiles = { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 1, 1, 1, 1, 1, 1, -1, -1, -1 } }) -- Right foreground tower block -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Front ResetTransform() Translate(28, 0, 4) Scale(32) SetTexture("TowerBlock1") MakeTilemap({ width = 5, tiles = { 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 4, 4, 4 } }) -- Right side ResetTransform() Rotate(Y, 90) Translate(33, 0, 4) Scale(32) MakeTilemap({ width = 6, surface_type = RIGHT, tiles = { 2, 2, 2, 2, 2, 2, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 5, 4, 5, 5, 4, 5 } }) -- Left side ResetTransform() Rotate(Y, 90) Translate(28, 0, 4) Scale(32) MakeTilemap({ width = 6, surface_type = LEFT, tiles = { 2, 2, 2, 2, 2, 2, 0, 1, 6, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 5, 4, 5, 5, 4, 5 } }) -- Top ResetTransform() Rotate(X, 90) Translate(28, 7, -2) Scale(32) MakeTilemap({ width = 5, surface_type = TOP, tiles = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 } }) -- Right end tower block -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Front ResetTransform() Translate(40, 0, 5) Scale(32) MakeTilemap({ width = 5, tiles = { 2, 2, 2, 2, 2, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 6, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 6, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 4, 4, 4, 4, 4 } }) -- Left side ResetTransform() Rotate(Y, 90) Translate(40, 0, 5) Scale(32) MakeTilemap({ width = 5, surface_type = LEFT, tiles = { 2, 2, 2, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 5, 5, 4 } }) -- Top ResetTransform() Rotate(X, 90) Translate(40, 15, 0) Scale(32) MakeTilemap({ width = 5, surface_type = TOP, tiles = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 } }) -- Background -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ResetTransform() Translate(-0.3, -0.17, -900) Scale(3200, 1600, 1) SetTexture("BackgroundFar") MakeBillboard() Translate(0, 0, 300) SetTexture("BackgroundNear") MakeBillboard({ blend = detail > 1 and true or false }) -- Trees -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SetTexture("Trees") -- Left courtyard if detail > 1 then ResetTransform() Scale(96) Translate(250, -2.5, 16) MakeBillboard({ tile = 1 }) end -- Center courtyard ResetTransform() Scale(96) Translate(610, -2.5, 85) MakeBillboard({ tile = 0 }) ResetTransform() Scale(96) Translate(650, -2.5, 115) MakeBillboard({ tile = 1 }) -- Right courtyard if detail > 1 then ResetTransform() Scale(96) Translate(1080, -2.5, 10) MakeBillboard({ tile = 1 }) ResetTransform() Scale(96) Translate(1120, -2.5, -15) MakeBillboard({ tile = 0 }) ResetTransform() Scale(96) Translate(1220, -2.5, -30) MakeBillboard({ tile = 1 }) end