source: 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor.cs @ 5218

Revision 5218, 1.1 KB checked in by mijoilmo, 9 years ago (diff)
Line 
1using System;
2using System.Collections.Generic;
3using Jypeli;
4using Jypeli.Assets;
5using Jypeli.Controls;
6using Jypeli.Effects;
7using Jypeli.Widgets;
8
9public class Proto236b : PhysicsGame //true survivor
10{
11    Image[] images = new Image[1];
12    void AssignKeys()
13    {
14        Keyboard.Listen(Key.Escape, ButtonState.Down, Exit, "Lopeta Peli");
15    }
16    void LoadAllImages()
17    {
18        images[0] = LoadImage("graphics/backgrounds/space_background");
19    }
20    void LoadLevel(int level)
21    {
22        ClearAll();
23        AssignKeys();
24        LevelFromImage("graphics/levels/" + level);
25    }
26    void LevelFromImage(string levelName)
27    {
28        ColorTileMap tileMap = ColorTileMap.FromLevelAsset(levelName);
29        tileMap.SetTileMethod(Color.FromHexCode("000000"), createTile, "seina");
30        tileMap.Execute();
31    }
32    void createTile(Vector position, double w, double h, string type)
33    {
34
35    }
36    public override void Begin()
37    {
38        // TODO: Kirjoita peli tähän
39        LoadAllImages();
40        LoadLevel(0);
41    }
42}
Note: See TracBrowser for help on using the repository browser.