- Timestamp:
- Oct 30, 2017, 2:33:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxShip.cc
r11509 r11514 49 49 RegisterObject(FlappyOrxShip); 50 50 51 UpwardThrust = 250; 52 speed = 50; 53 gravity = 20; 54 void AutonomousDrone::XMLPort(Element& xmlelement, XMLPort::Mode mode) 51 this->UpwardThrust = 1; 52 this->speed = 1;orxout() << "constr speed set: " << 1 << endl; 53 this->gravity = 1; 54 55 } 56 void FlappyOrxShip::XMLPort(Element& xmlelement, XMLPort::Mode mode) 55 57 { 56 SUPER( AutonomousDrone, XMLPort, xmlelement, mode);58 SUPER(FlappyOrxShip, XMLPort, xmlelement, mode); 57 59 XMLPortParam(FlappyOrxShip, "speed", setSpeed, getSpeed, xmlelement, mode); 58 60 XMLPortParam(FlappyOrxShip, "UpwardThrust", setUpwardThrust, getUpwardThrust, xmlelement, mode); 59 61 XMLPortParam(FlappyOrxShip, "gravity", setGravity, getGravity, xmlelement, mode); 60 }61 62 } 63 62 64 void FlappyOrxShip::tick(float dt) 63 { //Execute movement 65 { 66 SUPER(FlappyOrxShip, tick, dt); 67 //Execute movement 64 68 if (this->hasLocalController()) 65 69 { … … 72 76 } 73 77 74 75 78 pos += Vector3(speed + velocity.x, 0, velocity.y) * dt; 76 79 … … 100 103 101 104 } 102 103 104 SUPER(FlappyOrxShip, tick, dt);105 105 } 106 106
Note: See TracChangeset
for help on using the changeset viewer.