Changeset 5204 for 2014/27/AleksanteriV/Protokolla236
- Timestamp:
- 2014-07-01 11:01:08 (9 years ago)
- Location:
- 2014/27/AleksanteriV/Protokolla236/Protokolla236/Protokolla236
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/27/AleksanteriV/Protokolla236/Protokolla236/Protokolla236/MikonPhysicsObject.cs
r5199 r5204 21 21 var pieceWidth = this.Width / pieceCountX; 22 22 var pieceHeight = this.Height / pieceCountY; 23 if (pieceWidth < 1 || pieceHeight < 1) { return; } 23 if (pieceWidth < 3 || pieceHeight < 3) { return; } 24 var useCollisions = true; 25 if (pieceWidth < 10 || pieceHeight < 10) { useCollisions = false; } 24 26 //loop x and y through 25 27 //calc left corner … … 31 33 { 32 34 MikonPhysicsObject childBox = new MikonPhysicsObject(this.game, pieceWidth, pieceHeight); 35 childBox.CollisionIgnoreGroup = 2; 33 36 childBox.Color = this.Color; 37 childBox.Tag = this.Tag; 34 38 childBox.AbsoluteAngle = this.AbsoluteAngle; 35 39 childBox.AngularVelocity = this.AngularVelocity; 36 40 37 41 childBox.Position = this.Position + startCorner 38 + Vector.FromLengthAndAngle(x * pieceWidth, this.AbsoluteAngle) //plus x 39 + Vector.FromLengthAndAngle(y * pieceHeight, this.AbsoluteAngle + Angle.RightAngle); //plus y 42 + Vector.FromLengthAndAngle(x * pieceWidth, this.AbsoluteAngle) //plus x 43 + Vector.FromLengthAndAngle(y * pieceHeight, this.AbsoluteAngle + Angle.RightAngle); //plus y 40 44 41 45 childBox.Velocity = this.Velocity; 42 46 43 //childBox.Position += offset; 47 //childBox.Position += offset; 44 48 45 49 Game.Add(childBox); -
2014/27/AleksanteriV/Protokolla236/Protokolla236/Protokolla236/Protokolla236.cs
r5199 r5204 198 198 199 199 200 Gravity = new Vector(0.0, -150.0);200 //Gravity = new Vector(0.0, -150.0); 201 201 Level.CreateBorders(0.5, true); 202 202 LisaaNappaimet(pelaajat);
Note: See TracChangeset
for help on using the changeset viewer.