source: 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Peli.cs @ 2276

Revision 2276, 1.7 KB checked in by teeevasa, 8 years ago (diff)

Removed wma versions

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    const int SCREEN_WIDTH = 50;
12    const int SCREEN_HEIGTH = 50;
13    Player player;
14
15    public override void Begin()
16    {
17        Gravity = new Vector(0, -1000);
18
19        createLevel();
20
21        //MediaPlayer.Play("SuperMetroidCrateriaSurface.wma");
22
23        Camera.Follow(player);
24        Camera.ZoomFactor = 1.2;
25        Camera.StayInLevel = true;
26    }
27
28    void createLevel()
29    {
30        TileMap levelSpec = TileMap.FromFile("ReactorEntrance.txt");
31        levelSpec['='] = createVerticalBlock;
32        levelSpec['|'] = createHorizontalBlock;
33        levelSpec['P'] = addPlayer;
34        levelSpec['a'] = addMeleeAlien;
35        levelSpec.Insert(SCREEN_WIDTH, SCREEN_HEIGTH);
36        Level.CreateBorders();
37    }
38
39    Player addPlayer()
40    {
41        player = new Player(33, 74, Shape.Rectangle);
42        //Image i = LoadImage("Images/character");
43        //player.Image = i;
44        return player;
45    }
46
47    MeleeAlien addMeleeAlien()
48    {
49        MeleeAlien meleeAlien = new MeleeAlien(45, 80, Shape.Rectangle, 10, "Patrol");
50        return meleeAlien;
51    }
52
53    PhysicsObject createHorizontalBlock()
54    {
55        PhysicsObject hBlock = PhysicsObject.CreateStaticObject(SCREEN_WIDTH, SCREEN_HEIGTH);
56        hBlock.Color = Color.Black;
57        return hBlock;
58    }
59
60    PhysicsObject createVerticalBlock()
61    {
62        PhysicsObject vBlock = PhysicsObject.CreateStaticObject(SCREEN_WIDTH, SCREEN_HEIGTH);
63        vBlock.Color = Color.Red;
64        return vBlock;
65    }
66}
Note: See TracBrowser for help on using the repository browser.