Revision 45,
1.4 KB
checked in by akpekorh, 12 years ago
(diff) |
pallo pomppii randomina
|
Line | |
---|
1 | #region Usings |
---|
2 | using System; |
---|
3 | using System.Collections.Generic; |
---|
4 | using System.Linq; |
---|
5 | using Microsoft.Xna.Framework; |
---|
6 | using Microsoft.Xna.Framework.Audio; |
---|
7 | using Microsoft.Xna.Framework.Content; |
---|
8 | using Microsoft.Xna.Framework.Graphics; |
---|
9 | using Microsoft.Xna.Framework.Input; |
---|
10 | using Microsoft.Xna.Framework.Media; |
---|
11 | using Jypeli; |
---|
12 | using Jypeli.ScreenObjects; |
---|
13 | using Jypeli.Assets; |
---|
14 | using AdvanceMath; |
---|
15 | using Physics2DDotNet; |
---|
16 | using Physics2DDotNet.Shapes; |
---|
17 | #endregion |
---|
18 | |
---|
19 | namespace Aliohjelma |
---|
20 | { |
---|
21 | public class Peli : RealTimeGame |
---|
22 | { |
---|
23 | protected override void LoadContent() |
---|
24 | { |
---|
25 | |
---|
26 | int i = 0; |
---|
27 | |
---|
28 | while (i < 100) |
---|
29 | { |
---|
30 | p = new pallo(); |
---|
31 | } |
---|
32 | |
---|
33 | int summa = LaskeYhteen(3, 10); |
---|
34 | string merkkijono = summa.ToString(); |
---|
35 | MessageDisplay.Add(merkkijono); |
---|
36 | LisaaYmpyra(); |
---|
37 | |
---|
38 | |
---|
39 | } |
---|
40 | int LaskeYhteen(int a, int b) |
---|
41 | { |
---|
42 | int summa = a + b; |
---|
43 | return summa; |
---|
44 | } |
---|
45 | |
---|
46 | void LisaaYmpyra() |
---|
47 | { |
---|
48 | IShape ympyra = Shapes.CreateCircle(10.0); |
---|
49 | PhysicsObject pallo = new PhysicsObject(10.0, ympyra); |
---|
50 | pallo.X =RandomGen.NextDouble (5.0, 600.0); |
---|
51 | pallo.Y =RandomGen.NextDouble (5.0, 600.0); |
---|
52 | Level.Objects.Add(pallo); |
---|
53 | |
---|
54 | |
---|
55 | |
---|
56 | } |
---|
57 | |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | |
---|
62 | |
---|
63 | |
---|
64 | |
---|
65 | |
---|
66 | |
---|
67 | |
---|
68 | } |
---|
69 | |
---|
70 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.