Changeset 8917 for code/branches/environment3/data
- Timestamp:
- Nov 2, 2011, 3:35:23 PM (13 years ago)
- Location:
- code/branches/environment3/data/levels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/environment3/data/levels/asteroidField.oxw
r8889 r8917 28 28 ambientlight = "0.8, 0.8, 0.8" 29 29 skybox = "Orxonox/Starbox" 30 hasPhysics = true 30 31 > 31 32 32 33 <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> 33 34 <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff2 /> 34 35 36 <!-- Generate asteroid field with diameter 12000 containing 250 asteroids --> 35 37 <?lua 36 38 dofile("includes/asteroidField.lua") 37 asteroidField(0, 0, 0, 1 2000, 250)39 asteroidField(0, 0, 0, 150, 50,12000, 250) 38 40 ?> 39 41 -
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.