]>
Dogcows Code - chaz/yoink/blob - data/scenes/Classic.lua
c60f68b5987c1180e1c67ca5aad9c7eb8d893822
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})
27 --geometry = yoink.mesh("classic.ac")
29 --geometry = yoink.mesh.fromstring([[
38 -- DisplayText(text, seconds)
40 -- SpawnItem(what, coords, timeout)
41 -- SpawnRandomItem(coords, timeout)
42 -- SpawnCharacter(what, coords, ai level)
43 -- SpawnHeroine(coords)
49 -- Think() is called periodically
51 -- HeroineDied(player)
58 --SpawnHeroine({5, 5})
59 --local waveNum = BeginNewWave()
60 --PopulateScene(waveNum)
70 local mysound
= yoink
.sound("Explosion")
71 mysound
= yoink
.sound()
74 function Event
.Think()
75 if count
% 300 == 0 then
77 LogDebug("Hello world!")
84 classic_mesh
= yoink
.mesh("classic")
88 --world = classic_mesh:object(1)
90 --local object = world:kid(i)
91 --if object then table.insert(drawme, object) end
94 --lawn = classic_mesh:object(1):kid("M-Lawn")
96 --Event.Draw = function() tower:draw(false) end
97 Event
.Draw
= function()
98 --for i,object in ipairs(drawme) do
105 function Event
:BadGuyDied(enemy
)
106 if numberOfBadGuys
== 0 then
107 local waveNum
= BeginNewWave()
108 PopulateScene(waveNum
)
110 if math
.random() <= 0.2 then
111 SpawnRandomItem(enemy
.position
)
119 function PopulateScene(waveNum
)
120 -- spawn some robot troopers
121 local numBadGuys
= math
.random(3, 2 * waveNum
)
122 for i
= 0, numBadGuys
do
123 SpawnCharacter("RobotTrooper", RandomSpawnPlace(), RandomSkillLevel())
126 -- spawn some alien warriors
127 if waveNum
>= 10 then
128 numBadGuys
= math
.random(3, 2 * waveNum
)
129 for i
= 0, numBadGuys
do
130 SpawnCharacter("AlienWarrior", RandomSpawnPlace(), RandomSkillLevel())
134 -- spawn some jetbots
135 if waveNum
>= 20 then
136 numBadGuys
= math
.random(3, 2 * waveNum
)
137 for i
= 0, numBadGuys
do
138 SpawnCharacter("Jetbot", RandomSpawnPlace(), RandomSkillLevel())
143 function RandomSpawnPlace()
147 function RandomSkillLevel()
152 -- vim: ts=4 sw=4 tw=80
This page took 0.040822 seconds and 4 git commands to generate.