]>
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
6 LogInfo("-----", "Scene: Classic", "Created by Neil Carter",
7 "Converted to Lua by Charles McGarvey", "-----")
12 -- SetBounds(point1, point2)
15 -- Scale(x, y, z) or Scale(xyz)
16 -- Rotate(axis, degree) or Rotate(x, y, z)
18 -- DrawTilemap({width = $num, [surface = TOP | LEFT | RIGHT], tiles})
19 -- DrawTile(tile, [u_scale])
22 -- detail - level of detail of the scene (HIGH, MEDIUM, or LOW)
25 SetBounds({-5, 0, -6}, {45, 15, 7})
28 -- Left end tower block
29 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 SetTexture("TowerBlock1")
92 -- Leftmost background tower block
93 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
109 4, 4, 5, 5, 5, 4, 4})
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,
138 3, 3, 3, 3, 3, 3, 3, 3, 3,
139 3, 3, 3, 3, 3, 3, 3, 3, 3})
142 -- Foreground building with pitched roof
143 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150 SetTexture("Building")
198 Translate(10, 5, -0.00001)
203 -- Cheaty invisible platform
204 -- This draws nothing but creates a platform on the roof for walking.
215 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
222 SetTexture("Scenery")
226 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
227 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 1,
231 -1, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
232 -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1})
236 if detail
> MEDIUM
then
239 Translate(1, -0.5, 2)
248 Translate(1, -0.5, -2)
259 Translate(1, -0.5, -2)
270 Translate(9, -0.5, -2)
276 -- Fence behind house
287 -- Background building with pitched roof
288 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
295 SetTexture("Building")
341 -- Right pitched roof
363 -- More ground to the right
364 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
366 -- Ground under house
371 SetTexture("Scenery")
383 -- Left part of center courtyard
391 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 0, 0, 0, 0, 0, 0, 0,
394 1, 0, 0, 0, 0, 0, 1, 1,
395 0, 0, 0, 0, 0, 0, 1, 1,
396 1, 0, 0, 0, 0, 0, 0, 0,
397 1, 1, 1, 1, 1, 0, 0, 0})
401 if detail
> MEDIUM
then
404 Translate(14, -0.5, 2)
414 Translate(14, -0.5, -2)
420 -- Front grass next to door
423 Translate(13, -0.5, 0)
429 -- Back grass next to door
432 Translate(13, -0.5, -1)
442 Translate(14, -0.5, -2)
447 -- Grass left of house
451 Translate(18, -0.5, -3)
457 -- Grass right of house
461 Translate(24, -0.5, -3)
467 -- Front grass in center
471 Translate(19, -0.5, 1)
477 -- Back grass in center
481 Translate(19, -0.5, -1)
487 -- Left grass in center
492 Translate(19, -0.5, -1)
498 -- Right grass in center
503 Translate(23, -0.5, -1)
510 -- Right part of center courtyard
524 0, 0, 0, 1, 1, 1, 1})
526 -- Fence to right of back house
528 if detail
> MEDIUM
then
537 -- Grass in front of fence
541 Translate(24, -0.5, -2)
547 -- Grass to left of tower block
552 Translate(26, -0.5, 2)
558 -- Grass to right of tower block
563 Translate(35, -0.5, 2)
573 Translate(35, -0.5, 2)
583 Translate(34, -0.5, -2)
589 -- Extra bit of back grass
593 Translate(34, -0.5, -3)
600 -- Ground around tower block
620 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
621 0, 0, 1, 1, 1, 1, 1, 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, 0, 0, 0, 0, 0, 0, -1, -1, -1,
625 0, 0, 0, 0, 0, 0, 0, -1, -1, -1,
626 0, 1, 1, 1, 1, 1, 1, -1, -1, -1})
628 -- Right foreground tower block
629 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
635 SetTexture("TowerBlock1")
693 -- Right end tower block
694 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
746 Translate(40, 15, -3)
757 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
760 Translate(-0.32, -0.28, -27)
762 SetTexture("BackgroundFar")
766 SetTexture("BackgroundNear")
768 blend
= detail
> LOW
and true or false
772 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
781 Translate(7.75, -0.1, -2.5)
789 Translate(19, -0.1, -0.5)
794 Translate(20.25, -0.1, 0.5)
802 Translate(34, -0.1, -2.75)
807 Translate(36, -0.1, -3.5)
812 Translate(37, -0.1, -2.25)
819 -- DisplayText(text, seconds)
821 -- SpawnItem(what, coords, timeout)
822 -- SpawnRandomItem(coords, timeout)
823 -- SpawnCharacter(what, coords, ai level)
824 -- SpawnHeroine(coords)
830 -- Think() is called periodically
832 -- HeroineDied(player)
839 --SpawnHeroine({5, 5})
840 --local waveNum = BeginNewWave()
841 --PopulateScene(waveNum)
850 function Event
:Think()
853 function Event
:BadGuyDied(enemy
)
854 if numberOfBadGuys
== 0 then
855 local waveNum
= BeginNewWave()
856 PopulateScene(waveNum
)
858 if math
.random() <= 0.2 then
859 SpawnRandomItem(enemy
.position
)
867 function PopulateScene(waveNum
)
868 -- spawn some robot troopers
869 local numBadGuys
= math
.random(3, 2 * waveNum
)
870 for i
= 0, numBadGuys
do
871 SpawnCharacter("RobotTrooper", RandomSpawnPlace(), RandomSkillLevel())
874 -- spawn some alien warriors
875 if waveNum
>= 10 then
876 numBadGuys
= math
.random(3, 2 * waveNum
)
877 for i
= 0, numBadGuys
do
878 SpawnCharacter("AlienWarrior", RandomSpawnPlace(), RandomSkillLevel())
882 -- spawn some jetbots
883 if waveNum
>= 20 then
884 numBadGuys
= math
.random(3, 2 * waveNum
)
885 for i
= 0, numBadGuys
do
886 SpawnCharacter("Jetbot", RandomSpawnPlace(), RandomSkillLevel())
891 function RandomSpawnPlace()
895 function RandomSkillLevel()
900 -- vim: ts=4 sw=4 tw=80
This page took 0.07478 seconds and 5 git commands to generate.