X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=data%2Fscenes%2FClassic.lua;h=fb4765fc1e30fbca4136a04c91a8dd7bc61b0e4b;hp=68b7b660533b918db1db7aab4322c486768d8c1f;hb=837bae9f2bf7b25e1d3d2625eeaf39c1d2f48827;hpb=2d77fb5fb3480f522658f30af6addd5146530517 diff --git a/data/scenes/Classic.lua b/data/scenes/Classic.lua index 68b7b66..fb4765f 100644 --- a/data/scenes/Classic.lua +++ b/data/scenes/Classic.lua @@ -1,7 +1,9 @@ --- Scene: Classic Yoink --- created by Neil Carter --- converted to Lua by Charles McGarvey +LogInfo("-----", + "Scene: Classic", + "Created by Neil Carter", + "Converted to Lua by Charles McGarvey", + "-----") -- Scene API: -- @@ -23,12 +25,12 @@ SetBounds({-5, 0, -6}, {45, 15, 7}) -- Left end tower block --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Front ResetTransform() -Translate(-5, 0, 5) +Translate(-5, 0, 2) SetTexture("TowerBlock1") DrawTilemap({ width = 5, @@ -52,7 +54,7 @@ DrawTilemap({ ResetTransform() Rotate(Y, 90) -Translate(0, 0, 5) +Translate(0, 0, 2) DrawTilemap({ width = 5, surface = RIGHT, @@ -76,7 +78,7 @@ DrawTilemap({ ResetTransform() Rotate(X, 90) -Translate(-5, 15, 0) +Translate(-5, 15, -3) DrawTilemap({ width = 5, surface = TOP, @@ -87,12 +89,13 @@ DrawTilemap({ 3, 3, 3, 3, 3}) -- Leftmost background tower block --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Front if detail > LOW then ResetTransform() + Translate(0, 0, -3) DrawTilemap({ width = 7, 2, 2, 2, 2, 2, 2, 2, @@ -108,7 +111,7 @@ if detail > LOW then ResetTransform() Rotate(Y, 90) - Translate(7, 0, 0) + Translate(7, 0, -3) DrawTilemap({ width = 6, 2, 2, 2, 2, 2, 2, @@ -124,7 +127,7 @@ if detail > LOW then ResetTransform() Rotate(X, 90) - Translate(-2, 8, -6) + Translate(-2, 8, -9) DrawTilemap({ width = 9, 3, 3, 3, 3, 3, 3, 3, 3, 3, @@ -136,13 +139,13 @@ if detail > LOW then end -- Foreground building with pitched roof --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Left wall ResetTransform() Rotate(Y, -90) -Translate(10, 0, 1) +Translate(10, 0, -2) SetTexture("Building") DrawTilemap({ width = 4, @@ -157,7 +160,7 @@ DrawTilemap({ ResetTransform() Rotate(Y, -90) -Translate(13, 0, 1) +Translate(13, 0, -2) DrawTilemap({ width = 4, surface = RIGHT, @@ -170,7 +173,7 @@ DrawTilemap({ -- Front wall ResetTransform() -Translate(10, 0, 5) +Translate(10, 0, 2) DrawTilemap({ width = 3, 15, 7, 16, @@ -182,7 +185,7 @@ DrawTilemap({ ResetTransform() Rotate(X, 135) Scale(1, 1.5, 1.5) -Translate(10, 5, 3) +Translate(10, 5, 0) DrawTilemap({ width = 3, 13, 13, 13, @@ -191,28 +194,30 @@ DrawTilemap({ -- Finial ResetTransform() -Translate(10, 5, 3) +Translate(10, 5, -0.00001) DrawTilemap({ width = 3, 18, 18, 18}) -- Cheaty invisible platform +-- This draws nothing but creates a platform on the roof for walking. ResetTransform() -Translate(10, 4, 3) +Rotate(X, 90) +Translate(10, 5, 0) DrawTilemap({ width = 3, surface = TOP, -1, -1, -1}) -- The ground --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Courtyard ResetTransform() Rotate(X, 90) -Translate(-3, 0, 0) +Translate(-3, 0, -3) SetTexture("Scenery") DrawTilemap({ width = 13, @@ -230,7 +235,7 @@ DrawTilemap({ if detail > MEDIUM then ResetTransform() Scale(8, 1, 1) - Translate(1, -0.5, 5) + Translate(1, -0.5, 2) DrawTile({ 2, u_scale = 8}) @@ -239,7 +244,7 @@ if detail > MEDIUM then ResetTransform() Scale(8, 1, 1) - Translate(1, -0.5, 1) + Translate(1, -0.5, -2) DrawTile({ 2, u_scale = 8 @@ -250,7 +255,7 @@ if detail > MEDIUM then ResetTransform() Scale(4, 1, 1) Rotate(Y, -90) - Translate(1, -0.5, 1) + Translate(1, -0.5, -2) DrawTile({ 2, u_scale = 4 @@ -261,7 +266,7 @@ if detail > MEDIUM then ResetTransform() Scale(4, 1, 1) Rotate(Y, -90) - Translate(9, -0.5, 1) + Translate(9, -0.5, -2) DrawTile({ 2, u_scale = 4 @@ -271,7 +276,7 @@ if detail > MEDIUM then ResetTransform() Scale(11, 1, 1) - Translate(7, 0, 0) + Translate(7, 0, -3) DrawTile({ 4, u_scale = 11 @@ -279,13 +284,13 @@ if detail > MEDIUM then end -- Background building with pitched roof --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Front wall if detail > LOW then ResetTransform() - Translate(19, 0, 0) + Translate(19, 0, -3) SetTexture("Building") DrawTilemap({ width = 4, @@ -300,7 +305,7 @@ if detail > LOW then ResetTransform() Rotate(Y, -90) - Translate(19, 0, -3) + Translate(19, 0, -6) DrawTilemap({ width = 3, 15, 1, 16, @@ -312,7 +317,7 @@ if detail > LOW then ResetTransform() Rotate(Y, -90) - Translate(23, 0, -3) + Translate(23, 0, -6) DrawTilemap({ width = 3, 15, 0, 16, @@ -326,7 +331,7 @@ if detail > LOW then Rotate(X, 135) Scale(1, 1.5, 1.5) Rotate(Y, -90) - Translate(21, 6, -3) + Translate(21, 6, -6) DrawTilemap({ width = 3, 13, 13, 13, @@ -338,7 +343,7 @@ if detail > LOW then Rotate(X, -135) Scale(1, 1.5, 1.5) Rotate(Y, -90) - Translate(21, 6, -3) + Translate(21, 6, -6) DrawTilemap({ width = 3, 13, 13, 13, @@ -348,20 +353,20 @@ if detail > LOW then ResetTransform() Rotate(Y, -90) - Translate(21, 6, -3) + Translate(21, 6, -6) DrawTilemap({ width = 3, 18, 18, 18}) end -- More ground to the right --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Ground under house ResetTransform() Rotate(X, 90) -Translate(10, 0, 0) +Translate(10, 0, -3) SetTexture("Scenery") DrawTilemap({ width = 3, @@ -378,7 +383,7 @@ DrawTilemap({ ResetTransform() Rotate(X, 90) -Translate(13, 0, 0) +Translate(13, 0, -3) DrawTilemap({ width = 8, surface = TOP, @@ -395,7 +400,7 @@ DrawTilemap({ if detail > MEDIUM then ResetTransform() Scale(12, 1, 1) - Translate(14, -0.5, 5) + Translate(14, -0.5, 2) DrawTile({ 2, u_scale = 12 @@ -405,7 +410,7 @@ if detail > MEDIUM then ResetTransform() Scale(4, 1, 1) - Translate(14, -0.5, 1) + Translate(14, -0.5, -2) DrawTile({ 2, u_scale = 4 @@ -414,7 +419,7 @@ if detail > MEDIUM then -- Front grass next to door ResetTransform() - Translate(13, -0.5, 3) + Translate(13, -0.5, 0) DrawTile({ 2, u_scale = 1 @@ -423,7 +428,7 @@ if detail > MEDIUM then -- Back grass next to door ResetTransform() - Translate(13, -0.5, 2) + Translate(13, -0.5, -1) DrawTile({ 2, u_scale = 1 @@ -433,7 +438,7 @@ if detail > MEDIUM then ResetTransform() Rotate(Y, -90) - Translate(14, -0.5, 1) + Translate(14, -0.5, -2) DrawTilemap({ width = 4, 2, -1, 2, 2}) @@ -442,7 +447,7 @@ if detail > MEDIUM then ResetTransform() Rotate(Y, -90) - Translate(18, -0.5, 0) + Translate(18, -0.5, -3) DrawTile({ 2, u_scale = 1 @@ -452,7 +457,7 @@ if detail > MEDIUM then ResetTransform() Rotate(Y, -90) - Translate(24, -0.5, 0) + Translate(24, -0.5, -3) DrawTile({ 2, u_scale = 1 @@ -462,7 +467,7 @@ if detail > MEDIUM then ResetTransform() Scale(4, 1, 1) - Translate(19, -0.5, 4) + Translate(19, -0.5, 1) DrawTile({ 2, u_scale = 4 @@ -472,7 +477,7 @@ if detail > MEDIUM then ResetTransform() Scale(4, 1, 1) - Translate(19, -0.5, 2) + Translate(19, -0.5, -1) DrawTile({ 2, u_scale = 4 @@ -483,7 +488,7 @@ if detail > MEDIUM then ResetTransform() Scale(2, 1, 1) Rotate(Y, -90) - Translate(19, -0.5, 2) + Translate(19, -0.5, -1) DrawTile({ 2, u_scale = 2 @@ -494,7 +499,7 @@ if detail > MEDIUM then ResetTransform() Scale(2, 1, 1) Rotate(Y, -90) - Translate(23, -0.5, 2) + Translate(23, -0.5, -1) DrawTile({ 2, u_scale = 2 @@ -505,7 +510,7 @@ end ResetTransform() Rotate(X, 90) -Translate(21, 0, 0) +Translate(21, 0, -3) DrawTilemap({ width = 7, surface = TOP, @@ -522,7 +527,7 @@ DrawTilemap({ if detail > MEDIUM then ResetTransform() Scale(4, 1, 1) - Translate(24, 0, 0) + Translate(24, 0, -3) DrawTile({ 4, u_scale = 4 @@ -532,7 +537,7 @@ if detail > MEDIUM then ResetTransform() Scale(4, 1, 1) - Translate(24, -0.5, 1) + Translate(24, -0.5, -2) DrawTile({ 2, u_scale = 4 @@ -543,7 +548,7 @@ if detail > MEDIUM then ResetTransform() Scale(2, 1, 1) Rotate(Y, -90) - Translate(26, -0.5, 5) + Translate(26, -0.5, 2) DrawTile({ 2, u_scale = 2 @@ -554,7 +559,7 @@ if detail > MEDIUM then ResetTransform() Scale(2, 1, 1) Rotate(Y, -90) - Translate(35, -0.5, 5) + Translate(35, -0.5, 2) DrawTile({ 2, u_scale = 2 @@ -564,7 +569,7 @@ if detail > MEDIUM then ResetTransform() Scale(5, 1, 1) - Translate(35, -0.5, 5) + Translate(35, -0.5, 2) DrawTile({ 2, u_scale = 5 @@ -574,7 +579,7 @@ if detail > MEDIUM then ResetTransform() Scale(6, 1, 1) - Translate(34, -0.5, 1) + Translate(34, -0.5, -2) DrawTile({ 2, u_scale = 6 @@ -584,7 +589,7 @@ if detail > MEDIUM then ResetTransform() Rotate(Y, -90) - Translate(34, -0.5, 0) + Translate(34, -0.5, -3) DrawTile({ 2, u_scale = 1 @@ -595,7 +600,7 @@ end ResetTransform() Rotate(X, 90) -Translate(28, 0, 4) +Translate(28, 0, 1) DrawTilemap({ width = 5, surface = TOP, @@ -607,7 +612,7 @@ DrawTilemap({ ResetTransform() Rotate(X, 90) -Translate(33, 0, 0) +Translate(33, 0, -3) DrawTilemap({ width = 10, surface = TOP, @@ -620,12 +625,12 @@ DrawTilemap({ 0, 1, 1, 1, 1, 1, 1, -1, -1, -1}) -- Right foreground tower block --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Front ResetTransform() -Translate(28, 0, 4) +Translate(28, 0, 1) SetTexture("TowerBlock1") DrawTilemap({ width = 5, @@ -641,7 +646,7 @@ DrawTilemap({ ResetTransform() Rotate(Y, 90) -Translate(33, 0, 4) +Translate(33, 0, 1) DrawTilemap({ width = 6, surface = RIGHT, @@ -657,7 +662,7 @@ DrawTilemap({ ResetTransform() Rotate(Y, 90) -Translate(28, 0, 4) +Translate(28, 0, 1) DrawTilemap({ width = 6, surface = LEFT, @@ -673,7 +678,7 @@ DrawTilemap({ ResetTransform() Rotate(X, 90) -Translate(28, 7, -2) +Translate(28, 7, -5) DrawTilemap({ width = 5, surface = TOP, @@ -685,12 +690,12 @@ DrawTilemap({ 3, 3, 3, 3, 3}) -- Right end tower block --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Front ResetTransform() -Translate(40, 0, 5) +Translate(40, 0, 2) DrawTilemap({ width = 5, 2, 2, 2, 2, 2, @@ -713,7 +718,7 @@ DrawTilemap({ ResetTransform() Rotate(Y, 90) -Translate(40, 0, 5) +Translate(40, 0, 2) DrawTilemap({ width = 5, surface = LEFT, @@ -737,7 +742,7 @@ DrawTilemap({ ResetTransform() Rotate(X, 90) -Translate(40, 15, 0) +Translate(40, 15, -3) DrawTilemap({ width = 5, surface = TOP, @@ -748,10 +753,10 @@ DrawTilemap({ 3, 3, 3, 3, 3}) -- Background --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ResetTransform() -Translate(-0.32, -0.28, -24) +Translate(-0.3, -0.3, -35) Scale(105, 52, 1) SetTexture("BackgroundFar") DrawTile() @@ -763,7 +768,7 @@ DrawTile({ }) -- Trees --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SetTexture("Trees") @@ -772,21 +777,20 @@ SetTexture("Trees") if detail > LOW then ResetTransform() Scale(3) - Translate(7.75, -0.1, 0.5) + Translate(7.75, -0.1, -2.5) DrawTile(1) end -- Center courtyard ResetTransform() ---Translate(610, -2.5, 85) Scale(3) -Translate(19, -0.1, 2.5) +Translate(19, -0.1, -0.5) DrawTile(0) ResetTransform() Scale(3) -Translate(20.25, -0.1, 3.5) +Translate(20.25, -0.1, 0.5) DrawTile(1) -- Right courtyard @@ -794,27 +798,22 @@ DrawTile(1) if detail > LOW then ResetTransform() Scale(3) - Translate(34, -0.1, 0.25) + Translate(34, -0.1, -2.75) DrawTile(1) ResetTransform() Scale(3) - Translate(36, -0.1, -0.5) + Translate(36, -0.1, -3.5) DrawTile(0) ResetTransform() Scale(3) - Translate(37, -0.1, 0.75) + Translate(37, -0.1, -2.25) DrawTile(1) end -function GetZCoord(x, y) - return 3 -end - - -- Functions: -- DisplayText(text, seconds) -- Yield(seconds) @@ -827,23 +826,27 @@ end -- BeginNewWave() -- Events: +-- Think() is called periodically -- BadGuyDied(enemy) --- PlayedDied(player) --- SceneLoaded() +-- HeroineDied(player) -- Globals: -- numberOfBadGuys +--do + --SpawnHeroine({5, 5}) + --local waveNum = BeginNewWave() + --PopulateScene(waveNum) +--end + + -- Events --------- Event = {} -function Event:SceneLoaded() - SpawnHeroine({500, 500}) - local waveNum = BeginNewWave() - PopulateScene(waveNum) +function Event:Think() end function Event:BadGuyDied(enemy) @@ -885,10 +888,13 @@ function PopulateScene(waveNum) end function RandomSpawnPlace() - return {500, 500} + return {5, 5} end function RandomSkillLevel() return "dumb" end + +-- vim: ts=4 sw=4 tw=80 +