Line | |
---|
1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using System.Text; |
---|
5 | using Jypeli; |
---|
6 | |
---|
7 | public class Pallo |
---|
8 | { |
---|
9 | public PhysicsObject physicsObject; |
---|
10 | public Vector vector; |
---|
11 | |
---|
12 | public Pallo() |
---|
13 | { |
---|
14 | Vector point = new Vector(RandomGen.NextDouble(-5, 5), RandomGen.NextDouble(-5, 5)); |
---|
15 | |
---|
16 | float length = (float)Math.Sqrt(Math.Pow(point.X, 2) + Math.Pow(point.Y, 2)); |
---|
17 | |
---|
18 | vector = new Vector(point.X / length, point.Y / length); |
---|
19 | |
---|
20 | physicsObject = new PhysicsObject(40, 40); |
---|
21 | physicsObject.Shape = Shape.Circle; |
---|
22 | physicsObject.Restitution = 20; |
---|
23 | physicsObject.Hit(vector * 100); |
---|
24 | } |
---|
25 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.