source: 2016/30/JoonasL/Pong/Pong/Pong/Pallo.cs @ 8084

Revision 8084, 673 bytes checked in by karkaite, 4 years ago (diff)
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Jypeli;
6
7public 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.