]>
Dogcows Code - chaz/yoink/blob - data/scenes/Classic.lua
4 "Created by Neil Carter",
5 "Converted to Lua by Charles McGarvey",
11 -- SetBounds(point1, point2)
14 -- Scale(x, y, z) or Scale(xyz)
15 -- Rotate(axis, degree) or Rotate(x, y, z)
17 -- DrawTilemap({width = $num, [surface = TOP | LEFT | RIGHT], tiles})
18 -- DrawTile(tile, [u_scale])
21 -- detail - level of detail of the scene (HIGH, MEDIUM, or LOW)
24 SetBounds({-5, 0, -6}, {45, 15, 4})
26 -- Left end tower block
27 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 SetTexture("TowerBlock1")
90 -- Leftmost background tower block
91 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107 4, 4, 5, 5, 5, 4, 4})
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,
136 3, 3, 3, 3, 3, 3, 3, 3, 3,
137 3, 3, 3, 3, 3, 3, 3, 3, 3})
140 -- Foreground building with pitched roof
141 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
148 SetTexture("Building")
196 Translate(10, 5, -0.00001)
201 -- Cheaty invisible platform
202 -- This draws nothing but creates a platform on the roof for walking.
213 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
220 SetTexture("Scenery")
224 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
225 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 1,
229 -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
230 -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1})
234 if detail
> MEDIUM
then
237 Translate(1, -0.5, 2)
246 Translate(1, -0.5, -2)
257 Translate(1, -0.5, -2)
268 Translate(9, -0.5, -2)
274 -- Fence behind house
285 -- Background building with pitched roof
286 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
293 SetTexture("Building")
339 -- Right pitched roof
361 -- More ground to the right
362 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
364 -- Ground under house
369 SetTexture("Scenery")
381 -- Left part of center courtyard
389 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 0, 0, 0, 0, 0, 0, 0,
392 1, 0, 0, 0, 0, 0, 1, 1,
393 0, 0, 0, 0, 0, 0, 1, 1,
394 1, 0, 0, 0, 0, 0, 0, 0,
395 1, 1, 1, 1, 1, 0, 0, 0})
399 if detail
> MEDIUM
then
402 Translate(14, -0.5, 2)
412 Translate(14, -0.5, -2)
418 -- Front grass next to door
421 Translate(13, -0.5, 0)
427 -- Back grass next to door
430 Translate(13, -0.5, -1)
440 Translate(14, -0.5, -2)
445 -- Grass left of house
449 Translate(18, -0.5, -3)
455 -- Grass right of house
459 Translate(24, -0.5, -3)
465 -- Front grass in center
469 Translate(19, -0.5, 1)
475 -- Back grass in center
479 Translate(19, -0.5, -1)
485 -- Left grass in center
490 Translate(19, -0.5, -1)
496 -- Right grass in center
501 Translate(23, -0.5, -1)
508 -- Right part of center courtyard
522 0, 0, 0, 1, 1, 1, 1})
524 -- Fence to right of back house
526 if detail
> MEDIUM
then
535 -- Grass in front of fence
539 Translate(24, -0.5, -2)
545 -- Grass to left of tower block
550 Translate(26, -0.5, 2)
556 -- Grass to right of tower block
561 Translate(35, -0.5, 2)
571 Translate(35, -0.5, 2)
581 Translate(34, -0.5, -2)
587 -- Extra bit of back grass
591 Translate(34, -0.5, -3)
598 -- Ground around tower block
618 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
619 0, 0, 1, 1, 1, 1, 1, 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, 0, 0, 0, 0, 0, 0, -1, -1, -1,
623 0, 0, 0, 0, 0, 0, 0, -1, -1, -1,
624 0, 1, 1, 1, 1, 1, 1, -1, -1, -1})
626 -- Right foreground tower block
627 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
633 SetTexture("TowerBlock1")
691 -- Right end tower block
692 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
744 Translate(40, 15, -3)
755 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
758 Translate(-0.3, -0.3, -35)
760 SetTexture("BackgroundFar")
764 SetTexture("BackgroundNear")
766 blend
= detail
> LOW
and true or false
770 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
779 Translate(7.75, -0.1, -2.5)
787 Translate(19, -0.1, -0.5)
792 Translate(20.25, -0.1, 0.5)
800 Translate(34, -0.1, -2.75)
805 Translate(36, -0.1, -3.5)
810 Translate(37, -0.1, -2.25)
817 -- DisplayText(text, seconds)
819 -- SpawnItem(what, coords, timeout)
820 -- SpawnRandomItem(coords, timeout)
821 -- SpawnCharacter(what, coords, ai level)
822 -- SpawnHeroine(coords)
828 -- Think() is called periodically
830 -- HeroineDied(player)
837 --SpawnHeroine({5, 5})
838 --local waveNum = BeginNewWave()
839 --PopulateScene(waveNum)
848 function Event
:Think()
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()
898 -- vim: ts=4 sw=4 tw=80
This page took 0.072936 seconds and 5 git commands to generate.