Changeset 89
- Timestamp:
- 12/04/07 19:12:14 (1 year ago)
- Files:
-
- trunk/src/tank.d (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/tank.d
r85 r89 73 73 loadResources(); 74 74 75 physics = new Circle(image_body.getFrame.getSize.h/2, 1000);//new Box(image_body.getFrame.getSize, 10);75 physics = new Box(image_body.getFrame.getSize, 1000);//new Box(image_body.getFrame.getSize, 10); 76 76 physics.sigCollideStart.attach(&onCollideStart); 77 77 physics.translation = translation; … … 94 94 //physics.force = Point.fromPolar(0.005, physics.rotation - PI/2); 95 95 //Cout("player: "~.toUtf8(radToPlayer)~" tank: "~.toUtf8(physics.rotation)); 96 if(physics.rotation +PI_2 + PI_4 - tilemap.playerLoc.angle(transform.translation) == 0)96 /*if(physics.rotation +PI_2 + PI_4 - tilemap.playerLoc.angle(transform.translation) == 0) 97 97 { 98 98 physics.angularVelocity = 0.0; … … 105 105 { 106 106 physics.angularVelocity = -0.001; 107 }*/ 108 Cout("Tank: "~transform.translation.toUtf8()~" - "~tango.text.convert.Float.toUtf8(physics.rotation)); 109 if(transform.translation.x < (-tilemap.pixWidth/2 + 10)) 110 { 111 physics.force = Point(0,0); 107 112 } 108 /*if(radToPlayer > -0.1 && radToPlayer < 0.1) 109 physics.angularVelocity = 0.0; 110 else if(radToPlayer > 0) 111 physics.angularVelocity = -0.005; 113 else if(transform.translation.x > (tilemap.pixWidth/2 + 10)) 114 { 115 physics.force = Point(0,0); 116 } 117 else if(transform.translation.y < (-tilemap.pixHeight/2 + 10)) 118 { 119 physics.force = Point(0,0); 120 } 121 else if(transform.translation.y > (tilemap.pixHeight/2 + 10)) 122 { 123 physics.force = Point(0,0); 124 } 112 125 else 113 physics.angularVelocity = 0.005;*/ 114 126 { 127 if(tilemap.playerLoc.distance(transform.translation) > 1000.0) 128 { 129 physics.velocity = Point.fromPolar(0.005, physics.rotation - PI/2); 130 physics.angularVelocity = 0.0; 131 } 132 else 133 { 134 physics.velocity = Point(0.0,0); 135 physics.angularVelocity = 0.0; 136 } 115 137 } 138 } 116 139 117 140 /*void drawScenegraph ()
