]>
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})
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 --local mysound = yoink.sound()
72 --mysound:sample("Explosion")
74 function Event
.Think()
75 if count
% 300 == 0 then
83 classic_mesh
= yoink
.mesh("classic")
87 --world = classic_mesh:object(1)
89 --local object = world:kid(i)
90 --if object then table.insert(drawme, object) end
93 --lawn = classic_mesh:object(1):kid("M-Lawn")
95 --Event.Draw = function() tower:draw(false) end
96 Event
.Draw
= function()
97 --for i,object in ipairs(drawme) do
104 function Event
:BadGuyDied(enemy
)
105 if numberOfBadGuys
== 0 then
106 local waveNum
= BeginNewWave()
107 PopulateScene(waveNum
)
109 if math
.random() <= 0.2 then
110 SpawnRandomItem(enemy
.position
)
118 function PopulateScene(waveNum
)
119 -- spawn some robot troopers
120 local numBadGuys
= math
.random(3, 2 * waveNum
)
121 for i
= 0, numBadGuys
do
122 SpawnCharacter("RobotTrooper", RandomSpawnPlace(), RandomSkillLevel())
125 -- spawn some alien warriors
126 if waveNum
>= 10 then
127 numBadGuys
= math
.random(3, 2 * waveNum
)
128 for i
= 0, numBadGuys
do
129 SpawnCharacter("AlienWarrior", RandomSpawnPlace(), RandomSkillLevel())
133 -- spawn some jetbots
134 if waveNum
>= 20 then
135 numBadGuys
= math
.random(3, 2 * waveNum
)
136 for i
= 0, numBadGuys
do
137 SpawnCharacter("Jetbot", RandomSpawnPlace(), RandomSkillLevel())
142 function RandomSpawnPlace()
146 function RandomSkillLevel()
151 -- vim: ts=4 sw=4 tw=80
This page took 0.035459 seconds and 4 git commands to generate.