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

            SetTarget(target);
        }
Beispiel #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;
        }
Beispiel #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");
        }
Beispiel #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();
        }
Beispiel #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();
        }
 public TransformableGameObject(Game game, Vector2f position)
 {
     this.game = game;
     Position = position;
 }
 public GameObject(Game game)
 {
     this.game = game;
 }
 public InputHandler(Game game, string keyConfigFile)
     : this(game, keyConfigFile, null)
 {
 }
Beispiel #10
0
 public Actor(Game game, Vector2f position)
     : base(game, position)
 {
     Speed = 1f;
 }
 public MapObject(Game game, Vector2f position)
     : base(game, position)
 {
     this.Position = position;
 }