]>
Dogcows Code - chaz/yoink/blob - 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
209 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216 SetTexture("Scenery")
220 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
221 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
222 -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
223 -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1})
230 if detail
> MEDIUM
then
233 Translate(1, -0.5, 5)
242 Translate(1, -0.5, 1)
253 Translate(1, -0.5, 1)
264 Translate(9, -0.5, 1)
270 -- Fence behind house
281 -- Background building with pitched roof
282 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
289 SetTexture("Building")
335 -- Right pitched roof
357 -- More ground to the right
358 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
360 -- Ground under house
365 SetTexture("Scenery")
377 -- Left part of center courtyard
385 1, 1, 1, 1, 1, 1, 1, 1,
386 1, 1, 1, 1, 1, 1, 1, 1,
387 1, 0, 0, 0, 0, 0, 0, 0,
388 1, 0, 0, 0, 0, 0, 1, 1,
389 0, 0, 0, 0, 0, 0, 1, 1,
390 1, 0, 0, 0, 0, 0, 0, 0,
391 1, 1, 1, 1, 1, 0, 0, 0})
395 if detail
> MEDIUM
then
398 Translate(14, -0.5, 5)
408 Translate(14, -0.5, 1)
414 -- Front grass next to door
417 Translate(13, -0.5, 3)
423 -- Back grass next to door
426 Translate(13, -0.5, 2)
436 Translate(14, -0.5, 1)
441 -- Grass left of house
445 Translate(18, -0.5, 0)
451 -- Grass right of house
455 Translate(24, -0.5, 0)
461 -- Front grass in center
465 Translate(19, -0.5, 4)
471 -- Back grass in center
475 Translate(19, -0.5, 2)
481 -- Left grass in center
486 Translate(19, -0.5, 2)
492 -- Right grass in center
497 Translate(23, -0.5, 2)
504 -- Right part of center courtyard
518 0, 0, 0, 1, 1, 1, 1})
520 -- Fence to right of back house
522 if detail
> MEDIUM
then
531 -- Grass in front of fence
535 Translate(24, -0.5, 1)
541 -- Grass to left of tower block
546 Translate(26, -0.5, 5)
552 -- Grass to right of tower block
557 Translate(35, -0.5, 5)
567 Translate(35, -0.5, 5)
577 Translate(34, -0.5, 1)
583 -- Extra bit of back grass
587 Translate(34, -0.5, 0)
594 -- Ground around tower block
614 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
615 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
616 0, 0, 0, 0, 0, 0, 0, -1, -1, -1,
617 0, 0, 0, 0, 0, 0, 0, -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, 1, 1, 1, 1, 1, 1, -1, -1, -1})
622 -- Right foreground tower block
623 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
629 SetTexture("TowerBlock1")
687 -- Right end tower block
688 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
751 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
754 Translate(-0.3, -0.17, -28)
756 SetTexture("BackgroundFar")
760 SetTexture("BackgroundNear")
762 blend
= detail
> LOW
and true or false
766 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
775 Translate(7.75, -0.1, 0.5)
782 --Translate(610, -2.5, 85)
784 Translate(19, -0.1, 2.5)
789 Translate(20.25, -0.1, 3.5)
797 Translate(34, -0.1, 0.25)
802 Translate(36, -0.1, -0.5)
807 Translate(37, -0.1, 0.75)
813 function GetZCoord(x
, y
)
819 -- DisplayText(text, seconds)
821 -- SpawnItem(what, coords, timeout)
822 -- SpawnRandomItem(coords, timeout)
823 -- SpawnCharacter(what, coords, ai level)
824 -- SpawnHeroine(coords)
831 -- PlayedDied(player)
843 function Event
:SceneLoaded()
844 SpawnHeroine({500, 500})
845 local waveNum
= BeginNewWave()
846 PopulateScene(waveNum
)
849 function Event
:BadGuyDied(enemy
)
850 if numberOfBadGuys
== 0 then
851 local waveNum
= BeginNewWave()
852 PopulateScene(waveNum
)
854 if math
.random() <= 0.2 then
855 SpawnRandomItem(enemy
.position
)
863 function PopulateScene(waveNum
)
864 -- spawn some robot troopers
865 local numBadGuys
= math
.random(3, 2 * waveNum
)
866 for i
= 0, numBadGuys
do
867 SpawnCharacter("RobotTrooper", RandomSpawnPlace(), RandomSkillLevel())
870 -- spawn some alien warriors
871 if waveNum
>= 10 then
872 numBadGuys
= math
.random(3, 2 * waveNum
)
873 for i
= 0, numBadGuys
do
874 SpawnCharacter("AlienWarrior", RandomSpawnPlace(), RandomSkillLevel())
878 -- spawn some jetbots
879 if waveNum
>= 20 then
880 numBadGuys
= math
.random(3, 2 * waveNum
)
881 for i
= 0, numBadGuys
do
882 SpawnCharacter("Jetbot", RandomSpawnPlace(), RandomSkillLevel())
887 function RandomSpawnPlace()
891 function RandomSkillLevel()
This page took 0.075721 seconds and 4 git commands to generate.