]>
Dogcows Code - chaz/yoink/blob - data/scenes/Classic.lua
4 "Created by Neil Carter",
5 "Converted to Lua by Charles McGarvey",
8 --for key,value in pairs(_G) do print(key, value) end
11 print(meh
:myStr(3.1415))
16 -- SetBounds(point1, point2)
19 -- Scale(x, y, z) or Scale(xyz)
20 -- Rotate(axis, degree) or Rotate(x, y, z)
22 -- DrawTilemap({width = $num, [surface = TOP | LEFT | RIGHT], tiles})
23 -- DrawTile(tile, [u_scale])
26 -- detail - level of detail of the scene (HIGH, MEDIUM, or LOW)
29 SetBounds({-5, 0, -6}, {45, 15, 7})
32 -- Left end tower block
33 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 SetTexture("TowerBlock1")
96 -- Leftmost background tower block
97 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113 4, 4, 5, 5, 5, 4, 4})
138 3, 3, 3, 3, 3, 3, 3, 3, 3,
139 3, 3, 3, 3, 3, 3, 3, 3, 3,
140 3, 3, 3, 3, 3, 3, 3, 3, 3,
141 3, 3, 3, 3, 3, 3, 3, 3, 3,
142 3, 3, 3, 3, 3, 3, 3, 3, 3,
143 3, 3, 3, 3, 3, 3, 3, 3, 3})
146 -- Foreground building with pitched roof
147 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154 SetTexture("Building")
202 Translate(10, 5, -0.00001)
207 -- Cheaty invisible platform
208 -- This draws nothing but creates a platform on the roof for walking.
219 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
226 SetTexture("Scenery")
230 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
231 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
232 -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
233 -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
234 -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
235 -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
236 -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1})
240 if detail
> MEDIUM
then
243 Translate(1, -0.5, 2)
252 Translate(1, -0.5, -2)
263 Translate(1, -0.5, -2)
274 Translate(9, -0.5, -2)
280 -- Fence behind house
291 -- Background building with pitched roof
292 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
299 SetTexture("Building")
345 -- Right pitched roof
367 -- More ground to the right
368 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
370 -- Ground under house
375 SetTexture("Scenery")
387 -- Left part of center courtyard
395 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 0, 0, 0, 0, 0, 0, 0,
398 1, 0, 0, 0, 0, 0, 1, 1,
399 0, 0, 0, 0, 0, 0, 1, 1,
400 1, 0, 0, 0, 0, 0, 0, 0,
401 1, 1, 1, 1, 1, 0, 0, 0})
405 if detail
> MEDIUM
then
408 Translate(14, -0.5, 2)
418 Translate(14, -0.5, -2)
424 -- Front grass next to door
427 Translate(13, -0.5, 0)
433 -- Back grass next to door
436 Translate(13, -0.5, -1)
446 Translate(14, -0.5, -2)
451 -- Grass left of house
455 Translate(18, -0.5, -3)
461 -- Grass right of house
465 Translate(24, -0.5, -3)
471 -- Front grass in center
475 Translate(19, -0.5, 1)
481 -- Back grass in center
485 Translate(19, -0.5, -1)
491 -- Left grass in center
496 Translate(19, -0.5, -1)
502 -- Right grass in center
507 Translate(23, -0.5, -1)
514 -- Right part of center courtyard
528 0, 0, 0, 1, 1, 1, 1})
530 -- Fence to right of back house
532 if detail
> MEDIUM
then
541 -- Grass in front of fence
545 Translate(24, -0.5, -2)
551 -- Grass to left of tower block
556 Translate(26, -0.5, 2)
562 -- Grass to right of tower block
567 Translate(35, -0.5, 2)
577 Translate(35, -0.5, 2)
587 Translate(34, -0.5, -2)
593 -- Extra bit of back grass
597 Translate(34, -0.5, -3)
604 -- Ground around tower block
624 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
625 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
626 0, 0, 0, 0, 0, 0, 0, -1, -1, -1,
627 0, 0, 0, 0, 0, 0, 0, -1, -1, -1,
628 0, 0, 0, 0, 0, 0, 0, -1, -1, -1,
629 0, 0, 0, 0, 0, 0, 0, -1, -1, -1,
630 0, 1, 1, 1, 1, 1, 1, -1, -1, -1})
632 -- Right foreground tower block
633 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
639 SetTexture("TowerBlock1")
697 -- Right end tower block
698 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
750 Translate(40, 15, -3)
761 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
764 Translate(-0.3, -0.3, -35)
766 SetTexture("BackgroundFar")
770 SetTexture("BackgroundNear")
772 blend
= detail
> LOW
and true or false
776 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
785 Translate(7.75, -0.1, -2.5)
793 Translate(19, -0.1, -0.5)
798 Translate(20.25, -0.1, 0.5)
806 Translate(34, -0.1, -2.75)
811 Translate(36, -0.1, -3.5)
816 Translate(37, -0.1, -2.25)
823 -- DisplayText(text, seconds)
825 -- SpawnItem(what, coords, timeout)
826 -- SpawnRandomItem(coords, timeout)
827 -- SpawnCharacter(what, coords, ai level)
828 -- SpawnHeroine(coords)
834 -- Think() is called periodically
836 -- HeroineDied(player)
843 --SpawnHeroine({5, 5})
844 --local waveNum = BeginNewWave()
845 --PopulateScene(waveNum)
854 function Event
:Think()
857 function Event
:BadGuyDied(enemy
)
858 if numberOfBadGuys
== 0 then
859 local waveNum
= BeginNewWave()
860 PopulateScene(waveNum
)
862 if math
.random() <= 0.2 then
863 SpawnRandomItem(enemy
.position
)
871 function PopulateScene(waveNum
)
872 -- spawn some robot troopers
873 local numBadGuys
= math
.random(3, 2 * waveNum
)
874 for i
= 0, numBadGuys
do
875 SpawnCharacter("RobotTrooper", RandomSpawnPlace(), RandomSkillLevel())
878 -- spawn some alien warriors
879 if waveNum
>= 10 then
880 numBadGuys
= math
.random(3, 2 * waveNum
)
881 for i
= 0, numBadGuys
do
882 SpawnCharacter("AlienWarrior", RandomSpawnPlace(), RandomSkillLevel())
886 -- spawn some jetbots
887 if waveNum
>= 20 then
888 numBadGuys
= math
.random(3, 2 * waveNum
)
889 for i
= 0, numBadGuys
do
890 SpawnCharacter("Jetbot", RandomSpawnPlace(), RandomSkillLevel())
895 function RandomSpawnPlace()
899 function RandomSkillLevel()
904 -- vim: ts=4 sw=4 tw=80
This page took 0.0810070000000001 seconds and 4 git commands to generate.