]>
Dogcows Code - chaz/yoink/blob - data/scenes/Classic.lua
8476279e0d3aefd94ae4e7746dcc541cf35173ce
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")
72 function Event
.Think()
73 if count
% 300 == 0 then
81 classic_mesh
= yoink
.mesh("classic")
85 --world = classic_mesh:object(1)
87 --local object = world:kid(i)
88 --if object then table.insert(drawme, object) end
91 --lawn = classic_mesh:object(1):kid("M-Lawn")
93 --Event.Draw = function() tower:draw(false) end
94 Event
.Draw
= function()
95 --for i,object in ipairs(drawme) do
102 function Event
:BadGuyDied(enemy
)
103 if numberOfBadGuys
== 0 then
104 local waveNum
= BeginNewWave()
105 PopulateScene(waveNum
)
107 if math
.random() <= 0.2 then
108 SpawnRandomItem(enemy
.position
)
116 function PopulateScene(waveNum
)
117 -- spawn some robot troopers
118 local numBadGuys
= math
.random(3, 2 * waveNum
)
119 for i
= 0, numBadGuys
do
120 SpawnCharacter("RobotTrooper", RandomSpawnPlace(), RandomSkillLevel())
123 -- spawn some alien warriors
124 if waveNum
>= 10 then
125 numBadGuys
= math
.random(3, 2 * waveNum
)
126 for i
= 0, numBadGuys
do
127 SpawnCharacter("AlienWarrior", RandomSpawnPlace(), RandomSkillLevel())
131 -- spawn some jetbots
132 if waveNum
>= 20 then
133 numBadGuys
= math
.random(3, 2 * waveNum
)
134 for i
= 0, numBadGuys
do
135 SpawnCharacter("Jetbot", RandomSpawnPlace(), RandomSkillLevel())
140 function RandomSpawnPlace()
144 function RandomSkillLevel()
149 -- vim: ts=4 sw=4 tw=80
This page took 0.045925 seconds and 4 git commands to generate.