Changeset 8917 for code/branches/environment3/data/levels/includes
- Timestamp:
- Nov 2, 2011, 3:35:23 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/environment3/data/levels/includes/asteroidField.lua
r8889 r8917 1 function asteroidField(posX,posY,posZ,radius,count) 1 --[[ asteroid field generator 2 --[[ 3 --[[ generates asteroid field 4 --[[ posX, posY, posZ - position in space 5 --[[ minSize, maxSize - size boundaries of each asteroid 6 --[[ radius - size of the cube around position in space 7 --[[ count - number of asteroids 8 function asteroidField(posX, posY, posZ, minSize, maxSize, radius, count) 2 9 for i = 1, count, 1 3 10 do 4 size = math.random()5 print("< MovableEntity ")11 size = (math.random() * (maxSize - minSize)) + minSize 12 print("<StaticEntity ") 6 13 7 14 print("position = \"") … … 10 17 print((2 * math.random() * radius) - radius + posZ) print("\"") 11 18 12 print("scale = \"") print(size * 150) print("\"")19 print("scale = \"") print(size) print("\"") 13 20 14 print("collisionType = dynamic linearDamping = 0.8 angularDamping = 0 collisiondamage = 1 enablecollisiondamage = true>") 15 print("<attached> <Model mass=\"") print(size * 1000) print("\" mesh=\"ast") print(math.mod(i,6) + 1) print(".mesh\" /> </attached>") 16 print("<collisionShapes> <SphereCollisionShape radius=\"") print(size * 350) print("\" /> </collisionShapes>") 17 print("</MovableEntity>") 21 print("collisionType = static linearDamping = 0.8 angularDamping = 0 collisiondamage = 1 enablecollisiondamage = true>") 22 print("<attached> <Model mass=\"") print(size * 10) print("\" mesh=\"ast") print(math.mod(i,6) + 1) print(".mesh\" /> </attached>") 23 print("<attached> <ForceField position=\"0,0,0\" mode=\"newtonianGravity\" diameter=\"") print(size + (size * 0.2)) print("\" massDiameter=\"") print(size) print("\" mass=\"") print(size * 1000) print("\" /> </attached>") 24 print("<collisionShapes> <SphereCollisionShape radius=\"") print(size) print("\" /> </collisionShapes>") 25 print("</StaticEntity>") 18 26 end 19 27
Note: See TracChangeset
for help on using the changeset viewer.