/// <summary> /// Initiates the game by painting the background /// and initiating the hero /// </summary> public void InitGame() { ClearBackground(); actor = new Sprite { X = 10, Y = 38 }; CreateObstacles(); DrawObstacles(); }
private void CreateObstacles() { int start = 40; Sprite o; for (var i = 0; i < obstacles.Length; i++) { o = new Sprite(); o.X = start; o.Y = actor.Y; if (obstacles[i] == 0) { o.IsActive = false; } Obstacles.Add(o); start++; } }