source: 2011/31/OnniP/PerusPeli3/PerusPeli3/Peli.cs @ 2512

Revision 2512, 1.5 KB checked in by onpernu, 8 years ago (diff)

Talletus.

Line 
1using System;
2using System.Collections.Generic;
3using Jypeli;
4using Jypeli.Assets;
5using Jypeli.Controls;
6using Jypeli.Effects;
7using Jypeli.Widgets;
8
9public class Peli : PhysicsGame
10{
11    Image MansikanKuva = LoadImage("Transparent Mansikka");
12    Image PilviKuva = LoadImage("Pillvi");
13    Image Pilvikuva2 = LoadImage ("Pillvi3");
14    public override void Begin()
15
16    {
17       
18        PhysicsObject katto = PhysicsObject.CreateStaticObject(1300, 100);
19        katto.X = 0;
20        katto.Y = 500;
21        katto.IsVisible = false;
22        Add(katto);
23        katto.Color = Color.Cyan;
24        PhysicsObject lattia =  PhysicsObject.CreateStaticObject(1300, 100);
25        lattia.Y = -500;
26        Add(lattia);
27        lattia.IsVisible = true;
28        luoMansikka ();
29        Level.BackgroundColor = Color.SkyBlue;
30        luoPilvi();
31}
32    void luoMansikka()
33    {
34        PhysicsObject Mansikka = new PhysicsObject(80, 90);
35        Mansikka.Image = MansikanKuva;
36        Mansikka.Y = 500;
37        Add(Mansikka);
38        Vector impulssi = new Vector(0, -200);
39        Mansikka.Hit(impulssi);
40   
41    }
42    void luoPilvi()
43   
44{
45    GameObject Pilvi = new GameObject (800, 400);
46    Pilvi.Image = PilviKuva;
47    Pilvi.Y = 200;
48    Pilvi.X = 300;
49    Add(Pilvi);
50    Pilvi.IsVisible = true;
51
52    GameObject Pilvi3 = new GameObject(800, 400);
53    Pilvi3.Image = Pilvikuva2;
54    Add (Pilvi3);
55    Pilvi3.X = -400;
56    Pilvi3.Y = 300;
57
58        }
59   
60
61
62
63
64}
65
66
Note: See TracBrowser for help on using the repository browser.