Ejemplo n.º 1
0
 static void Main(string[] args)
 {
     using (var game = new Game(800, 600, "Roguelike-like-like"))
     {
         game.Start();
     }
 }
Ejemplo n.º 2
0
        public InputHandler(Game game, string keyConfigFile, Actor target)
            : base(game)
        {
            keyConfig = new KeyConfig();
            LoadKeyConfig(keyConfigFile);

            SetTarget(target);
        }
Ejemplo n.º 3
0
        public Player(Game game, string keyConfigFile)
            : base(game, game.GameWorld.PointToWorld(new Vector2f(0, 0)))
        {
            input = new InputHandler(game, keyConfigFile, this);

            graphic = new Sprite(new Texture(new Image(64, 64, Color.White)));
            graphic.Position = new Vector2f(-32, -64);

            Speed = 3f;
        }
Ejemplo n.º 4
0
        public World(Game game)
            : base(game)
        {
            this.game = game;

            maps = new Dictionary<string, Map>();
            actors = new List<Actor>();

            maps.Add("map1", new Map(game, "YOLO"));
            SetMap("map1");
        }
Ejemplo n.º 5
0
        public Map(Game game, string path)
            : base(game)
        {
            tiles = new List<Tile>();

            var size = new Vector2f(128, 128);
            for (var y = 0; y < 8; y += 1)
                for (var x = 0; x < 8; x += 1)
                    tiles.Add(new Tile(game, new Vector2f(x, y), size));

            transform = GetTransform();
        }
Ejemplo n.º 6
0
        public Tile(Game game, Vector2f mapPos, Vector2f size)
            : base(game, new Vector2f(mapPos.X * size.X, mapPos.Y * size.Y))
        {
            this.mapPos = mapPos;
            this.size = size;

            if ((mapPos.X + mapPos.Y % 2) % 2 == 0)
                color = new Color(190, 190, 190);
            else
                color = new Color(90, 90, 90);

            GenerateVerts();
        }
Ejemplo n.º 7
0
 public TransformableGameObject(Game game, Vector2f position)
 {
     this.game = game;
     Position = position;
 }
Ejemplo n.º 8
0
 public GameObject(Game game)
 {
     this.game = game;
 }
Ejemplo n.º 9
0
 public InputHandler(Game game, string keyConfigFile)
     : this(game, keyConfigFile, null)
 {
 }
Ejemplo n.º 10
0
 public Actor(Game game, Vector2f position)
     : base(game, position)
 {
     Speed = 1f;
 }
Ejemplo n.º 11
0
 public MapObject(Game game, Vector2f position)
     : base(game, position)
 {
     this.Position = position;
 }