]>
Dogcows Code - chaz/yoink/blob - data/scenes/Classic.lua
2 -- Scene: Classic Yoink
3 -- created by Neil Carter
4 -- converted to Lua by Charles McGarvey
9 -- SetBounds(point1, point2)
12 -- Scale(x, y, z) or Scale(xyz)
13 -- Rotate(axis, degree) or Rotate(x, y, z)
15 -- DrawTilemap({width = $num, [surface = TOP | LEFT | RIGHT], tiles})
16 -- DrawTile(tile, [u_scale])
19 -- detail - level of detail of the scene (HIGH, MEDIUM, or LOW)
22 SetBounds({-5, 0, -6}, {45, 15, 7})
25 -- Left end tower block
26 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 SetTexture("TowerBlock1")
89 -- Leftmost background tower block
90 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105 4, 4, 5, 5, 5, 4, 4})
130 3, 3, 3, 3, 3, 3, 3, 3, 3,
131 3, 3, 3, 3, 3, 3, 3, 3, 3,
132 3, 3, 3, 3, 3, 3, 3, 3, 3,
133 3, 3, 3, 3, 3, 3, 3, 3, 3,
134 3, 3, 3, 3, 3, 3, 3, 3, 3,
135 3, 3, 3, 3, 3, 3, 3, 3, 3})
138 -- Foreground building with pitched roof
139 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
146 SetTexture("Building")
199 -- Cheaty invisible platform
200 -- This draws nothing but creates a platform on the roof for walking.
211 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
218 SetTexture("Scenery")
222 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
223 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
224 -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
225 -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
226 -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
227 -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
228 -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1})
232 if detail
> MEDIUM
then
235 Translate(1, -0.5, 5)
244 Translate(1, -0.5, 1)
255 Translate(1, -0.5, 1)
266 Translate(9, -0.5, 1)
272 -- Fence behind house
283 -- Background building with pitched roof
284 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
291 SetTexture("Building")
337 -- Right pitched roof
359 -- More ground to the right
360 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
362 -- Ground under house
367 SetTexture("Scenery")
379 -- Left part of center courtyard
387 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 0, 0, 0, 0, 0, 0, 0,
390 1, 0, 0, 0, 0, 0, 1, 1,
391 0, 0, 0, 0, 0, 0, 1, 1,
392 1, 0, 0, 0, 0, 0, 0, 0,
393 1, 1, 1, 1, 1, 0, 0, 0})
397 if detail
> MEDIUM
then
400 Translate(14, -0.5, 5)
410 Translate(14, -0.5, 1)
416 -- Front grass next to door
419 Translate(13, -0.5, 3)
425 -- Back grass next to door
428 Translate(13, -0.5, 2)
438 Translate(14, -0.5, 1)
443 -- Grass left of house
447 Translate(18, -0.5, 0)
453 -- Grass right of house
457 Translate(24, -0.5, 0)
463 -- Front grass in center
467 Translate(19, -0.5, 4)
473 -- Back grass in center
477 Translate(19, -0.5, 2)
483 -- Left grass in center
488 Translate(19, -0.5, 2)
494 -- Right grass in center
499 Translate(23, -0.5, 2)
506 -- Right part of center courtyard
520 0, 0, 0, 1, 1, 1, 1})
522 -- Fence to right of back house
524 if detail
> MEDIUM
then
533 -- Grass in front of fence
537 Translate(24, -0.5, 1)
543 -- Grass to left of tower block
548 Translate(26, -0.5, 5)
554 -- Grass to right of tower block
559 Translate(35, -0.5, 5)
569 Translate(35, -0.5, 5)
579 Translate(34, -0.5, 1)
585 -- Extra bit of back grass
589 Translate(34, -0.5, 0)
596 -- Ground around tower block
616 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
617 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
618 0, 0, 0, 0, 0, 0, 0, -1, -1, -1,
619 0, 0, 0, 0, 0, 0, 0, -1, -1, -1,
620 0, 0, 0, 0, 0, 0, 0, -1, -1, -1,
621 0, 0, 0, 0, 0, 0, 0, -1, -1, -1,
622 0, 1, 1, 1, 1, 1, 1, -1, -1, -1})
624 -- Right foreground tower block
625 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
631 SetTexture("TowerBlock1")
689 -- Right end tower block
690 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
753 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
756 Translate(-0.32, -0.28, -24)
758 SetTexture("BackgroundFar")
762 SetTexture("BackgroundNear")
764 blend
= detail
> LOW
and true or false
768 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
777 Translate(7.75, -0.1, 0.5)
784 --Translate(610, -2.5, 85)
786 Translate(19, -0.1, 2.5)
791 Translate(20.25, -0.1, 3.5)
799 Translate(34, -0.1, 0.25)
804 Translate(36, -0.1, -0.5)
809 Translate(37, -0.1, 0.75)
815 function GetZCoord(x
, y
)
821 -- DisplayText(text, seconds)
823 -- SpawnItem(what, coords, timeout)
824 -- SpawnRandomItem(coords, timeout)
825 -- SpawnCharacter(what, coords, ai level)
826 -- SpawnHeroine(coords)
833 -- PlayedDied(player)
845 function Event
:SceneLoaded()
846 SpawnHeroine({500, 500})
847 local waveNum
= BeginNewWave()
848 PopulateScene(waveNum
)
851 function Event
:BadGuyDied(enemy
)
852 if numberOfBadGuys
== 0 then
853 local waveNum
= BeginNewWave()
854 PopulateScene(waveNum
)
856 if math
.random() <= 0.2 then
857 SpawnRandomItem(enemy
.position
)
865 function PopulateScene(waveNum
)
866 -- spawn some robot troopers
867 local numBadGuys
= math
.random(3, 2 * waveNum
)
868 for i
= 0, numBadGuys
do
869 SpawnCharacter("RobotTrooper", RandomSpawnPlace(), RandomSkillLevel())
872 -- spawn some alien warriors
873 if waveNum
>= 10 then
874 numBadGuys
= math
.random(3, 2 * waveNum
)
875 for i
= 0, numBadGuys
do
876 SpawnCharacter("AlienWarrior", RandomSpawnPlace(), RandomSkillLevel())
880 -- spawn some jetbots
881 if waveNum
>= 20 then
882 numBadGuys
= math
.random(3, 2 * waveNum
)
883 for i
= 0, numBadGuys
do
884 SpawnCharacter("Jetbot", RandomSpawnPlace(), RandomSkillLevel())
889 function RandomSpawnPlace()
893 function RandomSkillLevel()
This page took 0.079504 seconds and 4 git commands to generate.