Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11509


Ignore:
Timestamp:
Oct 23, 2017, 4:19:11 PM (7 years ago)
Author:
merholzl
Message:

small changes and prep for XML

Location:
code/branches/FlappyOrx_HS17
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FlappyOrx_HS17/data/levels/FlappyOrx.oxw

    r11503 r11509  
    4343    <!-- <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"/> -->
    4444    <Light type=directional position="1100, 11000, -7000" lookat="0, 0, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
    45     <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=FlappyOrxShip pawndesign=spaceshipFlappyOrx />
     45    <SpawnPoint team=0 position="0,0,0" lookat="0,0,0" spawnclass=FlappyOrxShip pawndesign=spaceshipFlappyOrx />
    4646
    4747   
    4848    <FlappyOrxCenterPoint name=flappyorxcenter />
    4949   
     50     <?lua
     51      for i = 1, 30, 1 do
     52        j = math.random()
     53    ?>
    5054
     55    <MovableEntity
     56      position = "<?lua print(i* 300) ?>,0, <?lua print(j* 200) ?>"
     57      collisionType = dynamic
     58      linearDamping = 0.8
     59      angularDamping = 0
     60      scale = "<?lua print(10)?>"
     61      collisiondamage = 0
     62      enablecollisiondamage = true
     63    >
     64   
     65      <attached>
     66        <Model mass="1000" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
     67      </attached>
     68      <collisionShapes>
     69        <SphereCollisionShape radius="<?lua print(10) ?>" />
     70      </collisionShapes>
     71    </MovableEntity>
     72
     73     <MovableEntity
     74      position = "<?lua print(i* 300) ?>,0,<?lua print(-150 + j* 200) ?>"
     75      collisionType = dynamic
     76      linearDamping = 0.8
     77      angularDamping = 0
     78      scale = "<?lua print(10)?>"
     79      collisiondamage = 0
     80      enablecollisiondamage = true
     81    >
     82   
     83      <attached>
     84        <Model mass="1000" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
     85      </attached>
     86      <collisionShapes>
     87        <SphereCollisionShape radius="<?lua print(10) ?>" />
     88      </collisionShapes>
     89    </MovableEntity>
     90
     91    <?lua
     92      end
     93    ?>
     94   
    5195   
    5296  </Scene>
  • code/branches/FlappyOrx_HS17/data/levels/Invaders.oxw

    r11504 r11509  
    4545    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=InvaderShip pawndesign=spaceshipinvader />
    4646
    47     <DistanceTrigger name="start" position="-200,0,0" target="Pawn" distance=10 stayActive="true" delay=0 />
    48     <Model position="0,0,0" mesh="Coordinates.mesh" scale="20"/>
     47    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=FlappyOrxShip pawndesign=spaceshipFlappyOrx />
    4948
    50     <InvaderCenterPoint name=invadercenter />
    5149   
     50    <FlappyOrxCenterPoint name=flappyorxcenter />
    5251    <?lua
    5352      for i = 1, 30, 1 do
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxShip.cc

    r11505 r11509  
    5050
    5151        UpwardThrust = 250;
    52         speed = 1;
     52        speed = 50;
    5353        gravity = 20;
     54         void AutonomousDrone::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     55        {   
     56            SUPER(AutonomousDrone, XMLPort, xmlelement, mode);
     57            XMLPortParam(FlappyOrxShip, "speed", setSpeed, getSpeed, xmlelement, mode);
     58            XMLPortParam(FlappyOrxShip, "UpwardThrust", setUpwardThrust, getUpwardThrust, xmlelement, mode);
     59            XMLPortParam(FlappyOrxShip, "gravity", setGravity, getGravity, xmlelement, mode);
     60        }
    5461    }
    55 
    5662    void FlappyOrxShip::tick(float dt)
    5763    {  //Execute movement
     
    94100           
    95101        }
     102
    96103
    97104        SUPER(FlappyOrxShip, tick, dt);
Note: See TracChangeset for help on using the changeset viewer.