source: 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/TheDungeonGame.cs @ 3489

Revision 3489, 1.2 KB checked in by dezhidki, 9 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;
8using MathHelper;
9using Entity;
10using Rooms;
11
12public class TheDungeonGame : PhysicsGame
13{
14    public const double ROOMWIDTH = 850;
15    public const double ROOMHEIGHT = 500;
16    public const double ROOMTHICKNESS = 70;
17    public static Vector roomSize = new Vector(ROOMWIDTH, ROOMHEIGHT);
18    private Player player;
19
20    public override void Begin()
21    {
22        IsMouseVisible = true;
23        SetWindowSize(800, 600);
24        Level.Width = ROOMWIDTH * 20;
25        Level.Height = ROOMHEIGHT * 20;
26     //   Level.CreateBorders();
27        Camera.ZoomToLevel();
28
29        LevelGenerator generator = new LevelGenerator(this, Level.Size, new Vector(20, 20));
30        generator.generateRandomLevel(5, 10);
31        generator.buildLevel();
32
33        player = new Player(Vector.Zero);
34        Add(player, 1);
35
36        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Lopeta peli");   
37    }
38
39    protected override void Update(Time time)
40    {
41        player.Update(time);
42        base.Update(time);
43    }
44}
Note: See TracBrowser for help on using the repository browser.