using System.Collections.Generic; using SideScrollerGame.Content.Definitions; namespace SideScrollerGame.Content.Samples; public static class SampleContent { public static ContentRegistry CreateRegistry() { IReadOnlyList difficulties = [ CreateDifficulty("difficulty.easy", "Easy", 0.8, 4, 4, 0.75), CreateDifficulty("difficulty.normal", "Normal", 1.0, 3, 3, 1.0), CreateDifficulty("difficulty.hard", "Hard", 1.35, 2, 2, 1.5) ]; IReadOnlyList cameraPaths = [ new("camera.test.path", "Test Camera Path", [ new CameraPathPointDefinition(0.0, 0.0, 0.0, 120.0), new CameraPathPointDefinition(10.0, 1200.0, 0.0, 180.0), new CameraPathPointDefinition(20.0, 2400.0, 96.0, 90.0) ], 120.0) ]; IReadOnlyList levelLayers = [ new("layer.background.stars", "Repeating Background", LayerKind.Background, 0.35, true), new("layer.foreground.clouds", "Repeating Foreground", LayerKind.Foreground, 1.4, true) ]; IReadOnlyList enemyBehaviors = [ new("behavior.enemy.serial", "Serial Movement", [ new BehaviorTrackDefinition("track.main", BehaviorTrackMode.Serial, [ new BehaviorEventDefinition(BehaviorEventKind.MovePath, 0.0, 2.0), new BehaviorEventDefinition(BehaviorEventKind.Wait, 2.0, 0.5), new BehaviorEventDefinition(BehaviorEventKind.FireProjectile, 2.5, 0.1, "weapon.enemy.placeholder") ]) ]), new("behavior.enemy.parallel", "Parallel Movement And Fire", [ new BehaviorTrackDefinition("track.move", BehaviorTrackMode.Parallel, [ new BehaviorEventDefinition(BehaviorEventKind.MovePath, 0.0, 5.0) ]), new BehaviorTrackDefinition("track.fire", BehaviorTrackMode.Parallel, [ new BehaviorEventDefinition(BehaviorEventKind.FireProjectile, 0.5, 4.0, "weapon.enemy.placeholder") ]) ]) ]; IReadOnlyList collectibles = [ new("collectible.points.small", "Small Points", CollectibleKind.Points, 100), new("collectible.squadron.orbit", "Orbit Squadron Mate", CollectibleKind.SquadronMate, 1, "squadron.orbit") ]; IReadOnlyList enemyTypes = [ new("enemy.serial", "Serial Enemy", 12, 150, ["behavior.enemy.serial"], ["collectible.points.small"]), new("enemy.parallel", "Parallel Enemy", 18, 250, ["behavior.enemy.parallel"], ["collectible.squadron.orbit"]) ]; IReadOnlyList enemyClusters = [ new("cluster.opening", "Opening Cluster", [ new SpawnScheduleEntryDefinition("enemy.serial", 1.0, 1.1, 0.25), new SpawnScheduleEntryDefinition("enemy.parallel", 3.0, 1.15, 0.7) ], 500, ClusterEscapeRule.PreventReward) ]; IReadOnlyList weapons = [ new("weapon.primary.basic", "Basic Primary", WeaponKind.PrimaryBallistic, 3, 0.18, 640.0, 1, false), new("weapon.secondary.vertical", "Vertical Secondary", WeaponKind.SecondaryVertical, 2, 0.35, 500.0, 1, false) ]; IReadOnlyList specialWeapons = [ new("weapon.special.bomb", "Bomb Special", SpecialWeaponKind.Bomb, 12, 3, 30) ]; IReadOnlyList squadronMateTypes = [ new("squadron.orbit", "Orbit Mate", SquadronMateFormationKind.Orbit, 48.0, 10.0) ]; IReadOnlyList missions = [ new("mission.test", "Test Mission", "difficulty.normal", "camera.test.path", ["layer.background.stars"], ["layer.foreground.clouds"], ["cluster.opening"], ["collectible.points.small", "collectible.squadron.orbit"], ["weapon.special.bomb"], ["intro", "cluster.opening", "boss.intro", "outro"]) ]; return new ContentRegistry(missions, difficulties, cameraPaths, levelLayers, enemyTypes, enemyBehaviors, enemyClusters, collectibles, weapons, specialWeapons, squadronMateTypes); } private static DifficultyDefinition CreateDifficulty(string id, string displayName, double challengeMultiplier, int shields, int retries, double scoreMultiplier) { return new DifficultyDefinition(id, displayName, new DifficultyModifierSet(challengeMultiplier, challengeMultiplier, challengeMultiplier, challengeMultiplier, 1.0 / challengeMultiplier, challengeMultiplier, 1.0 / challengeMultiplier, 1.0, 1.0, scoreMultiplier), shields, retries); } }