diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000..d80747f --- /dev/null +++ b/.typos.toml @@ -0,0 +1,11 @@ +[default.extend-identifiers] +inout = "inout" + +[files] +extend-exclude = [ + "*.c", + "*.h", + "*.hpp", + "*.cpp", + "*.txt", +] \ No newline at end of file diff --git a/Sources/01_UserInput/UserInput.swift b/Sources/01_UserInput/UserInput.swift index 8092fa4..47835d3 100644 --- a/Sources/01_UserInput/UserInput.swift +++ b/Sources/01_UserInput/UserInput.swift @@ -10,10 +10,10 @@ import GateEngine @main final class UserInputGameDelegate: GameDelegate { - // didFinishLaunching() is executed immediatley after the game is ready to start + // didFinishLaunching() is executed immediately after the game is ready to start func didFinishLaunching(game: Game, options: LaunchOptions) { - // Add our projects sytem which is implemented below + // Add our projects system which is implemented below game.insertSystem(UserInputSystem.self) // Add the projects rendering system to the game which implementation is below @@ -42,7 +42,7 @@ final class TextComponent: Component { class UserInputSystem: System { // This value stores Input states and is used to check when an input has changed - var inputRecipts = InputRecipts() + var inputRecipts = InputReceipts() // setup() is executed a single time when the System is added to the game override func setup(game: Game, input: HID) async { @@ -160,7 +160,7 @@ class UserInputSystem: System { // MARK: - Touch - // Touches can be on screen, indirect such as a trackpad or gamepad. Use the Touch.kind property to ensure you treat the touch appropriatley + // Touches can be on screen, indirect such as a trackpad or gamepad. Use the Touch.kind property to ensure you treat the touch appropriately // as the user will expect certain things like screens to be pixel perfect and trackpads to be relative. // A Touch.phase is valid for this update only. The .up phase is available exactly once before the Touch is removed, so be sure to check the phase every frame. if let touch = input.screen.touches.first(where: {$0.phase == .up}) { @@ -197,7 +197,7 @@ class TextRenderingSystem: RenderingSystem { // Canvas is light weight and you're meant to create a new one every frame var canvas = Canvas() - // Loop through all entites in the game + // Loop through all entities in the game for entity in game.entities { // Make sure the entity has a TextComponent, otherwise move on @@ -213,7 +213,7 @@ class TextRenderingSystem: RenderingSystem { // to get a position that will center the text let position = windowCenter - halfTextSize - // Add the text to the canvas at our centerd position + // Add the text to the canvas at our centered position canvas.insert(text, at: position) } diff --git a/Sources/02_MultipleWindows/MultipleWindows.swift b/Sources/02_MultipleWindows/MultipleWindows.swift index ed0fab3..bbd065b 100644 --- a/Sources/02_MultipleWindows/MultipleWindows.swift +++ b/Sources/02_MultipleWindows/MultipleWindows.swift @@ -10,7 +10,7 @@ import GateEngine @main final class MultipleWindowsGameDelegate: GameDelegate { - /// didFinishLaunching() is executed immediatley after the game is ready to start + /// didFinishLaunching() is executed immediately after the game is ready to start func didFinishLaunching(game: Game, options: LaunchOptions) { game.insertSystem(SomeRenderingSystem.self) } @@ -20,7 +20,7 @@ final class MultipleWindowsGameDelegate: GameDelegate { return try game.windowManager.createWindow(identifier: identifier, style: .bestForGames, options: []) } - /// This GameDelegate func allows you to provide a window on platfroms where a user can manually create one. + /// This GameDelegate func allows you to provide a window on platforms where a user can manually create one. func userRequestedWindow(game: Game) throws -> Window? { let id = userWindowNumber.generateID() let window = try game.windowManager.createWindow(identifier: "user\(id)") @@ -57,11 +57,11 @@ class SomeRenderingSystem: RenderingSystem { do { let window2 = try game.windowManager.createWindow(identifier: "window2") - window2.title = "Programatic Window #2" + window2.title = "Programmatic Window #2" window2.clearColor = .lightRed let window3 = try game.windowManager.createWindow(identifier: "window3") - window3.title = "Programatic Window #3" + window3.title = "Programmatic Window #3" window3.clearColor = .lightRed }catch{ print(error) diff --git a/Sources/2D_01_AnimatedSprite/AnimatedSprite.swift b/Sources/2D_01_AnimatedSprite/AnimatedSprite.swift index b5ef4d1..ba19dc4 100644 --- a/Sources/2D_01_AnimatedSprite/AnimatedSprite.swift +++ b/Sources/2D_01_AnimatedSprite/AnimatedSprite.swift @@ -13,13 +13,13 @@ import GateEngine @main final class AnimatedSpriteGameDelegate: GameDelegate { - // didFinishLaunching() is executed immediatley after the game is ready to start + // didFinishLaunching() is executed immediately after the game is ready to start func didFinishLaunching(game: Game, options: LaunchOptions) { // Add the engine provided SpriteSystem so our sprites get updated game.insertSystem(SpriteSystem.self) - // Add our projects sytem which is implemented below + // Add our projects system which is implemented below game.insertSystem(AnimatedSpriteSystem.self) // Add the projects rendering system to the game which implementation is below @@ -86,7 +86,7 @@ class AnimatedSpriteSystem: System { component.position.x = halfVerticalHeight * mainWindow.size.aspectRatio } - // we chose the vertical resoluton so we know where vertical center is + // we chose the vertical resolution so we know where vertical center is component.position.y = halfVerticalHeight } } @@ -116,7 +116,7 @@ class AnimatedSpriteRenderingSystem: RenderingSystem { // Canvas is light weight and you're meant to create a new one every frame var canvas = Canvas() - // Loop through all entites in the game + // Loop through all entities in the game for entity in game.entities { // Make sure the entity has a SpriteComponent, otherwise move on diff --git a/Sources/3D_01_RotatingCube/RotatingCube.swift b/Sources/3D_01_RotatingCube/RotatingCube.swift index 890288e..f3e88ac 100644 --- a/Sources/3D_01_RotatingCube/RotatingCube.swift +++ b/Sources/3D_01_RotatingCube/RotatingCube.swift @@ -11,7 +11,7 @@ import GateEngine @main final class RotatingCubeGameDelegate: GameDelegate { - // didFinishLaunching() is executed immediatley after the game is ready to start + // didFinishLaunching() is executed immediately after the game is ready to start func didFinishLaunching(game: Game, options: LaunchOptions) { // Add the cube update system to the game. System implementation is below @@ -79,7 +79,7 @@ class RotatingCubeSystem: System { // update() is executed every simulation tick, which may or may not be every frame override func update(game: Game, input: HID, withTimePassed deltaTime: Float) async { - // Loop through all entites in the game + // Loop through all entities in the game for entity in game.entities { // Make sure the entity is not the camera @@ -107,7 +107,7 @@ class RotatingCubeSystem: System { // In these cases RenderingSystems do not get updated class RotatingCubeRenderingSystem: RenderingSystem { - // render() is called only wehn drawing needs to be done + // render() is called only when drawing needs to be done override func render(game: Game, window: Window, withTimePassed deltaTime: Float) { // To draw something in GateEngine you must create a container to store the renderable objects @@ -119,7 +119,7 @@ class RotatingCubeRenderingSystem: RenderingSystem { // Scene is light weight and you're meant to create a new one every frame var scene = Scene(camera: camera) - // Loop through all entites in the game + // Loop through all entities in the game for entity in game.entities { // Make sure the entity has a material, otherwise move on diff --git a/Sources/3D_02_SkinnedCharacter/SkinnedCharacter.swift b/Sources/3D_02_SkinnedCharacter/SkinnedCharacter.swift index ab5fdab..cfdab52 100644 --- a/Sources/3D_02_SkinnedCharacter/SkinnedCharacter.swift +++ b/Sources/3D_02_SkinnedCharacter/SkinnedCharacter.swift @@ -13,7 +13,7 @@ import GateEngine @main final class SkinnedCharacterGameDelegate: GameDelegate { - // didFinishLaunching() is executed immediatley after the game is ready to start + // didFinishLaunching() is executed immediately after the game is ready to start func didFinishLaunching(game: Game, options: LaunchOptions) { // Add the engine provided RigSystem so our character can animate game.insertSystem(RigSystem.self) @@ -107,7 +107,7 @@ class SkinnedCharacterSystem: System { // update() is executed every simulation tick, which may or may not be every frame override func update(game: Game, input: HID, withTimePassed deltaTime: Float) async { - // Loop through all entites in the game + // Loop through all entities in the game for entity in game.entities { // Make sure the entity is not the camera guard entity.hasComponent(CameraComponent.self) == false else {continue} @@ -131,7 +131,7 @@ class SkinnedCharacterSystem: System { // In these cases RenderingSystems do not get updated class SkinnedCharacterRenderingSystem: RenderingSystem { - // render() is called only wehn drawing needs to be done + // render() is called only when drawing needs to be done override func render(game: Game, window: Window, withTimePassed deltaTime: Float) { // To draw something in GateEngine you must create a container to store the renderable objects @@ -143,7 +143,7 @@ class SkinnedCharacterRenderingSystem: RenderingSystem { // Scene is light weight and you're meant to create a new one every frame var scene = Scene(camera: camera) - // Loop through all entites in the game + // Loop through all entities in the game for entity in game.entities { // Make sure the entity has a material, otherwise move on diff --git a/Sources/3D_03_MousePicking/MousePicking.swift b/Sources/3D_03_MousePicking/MousePicking.swift index 51165b9..d75ad50 100644 --- a/Sources/3D_03_MousePicking/MousePicking.swift +++ b/Sources/3D_03_MousePicking/MousePicking.swift @@ -11,7 +11,7 @@ import GateEngine @main final class MousePickingGameDelegate: GameDelegate { - // didFinishLaunching() is executed immediatley after the game is ready to start + // didFinishLaunching() is executed immediately after the game is ready to start func didFinishLaunching(game: Game, options: LaunchOptions) { // Add the engine provided 3D collision system @@ -20,7 +20,7 @@ final class MousePickingGameDelegate: GameDelegate { // Add the engine provided rendering system game.insertSystem(StandardRenderingSystem.self) - // Add the world system. Implemetation below. + // Add the world system. Implementation below. game.insertSystem(WorldSystem.self) // Create a new entity to store the camera @@ -63,7 +63,7 @@ class WorldSystem: System { let y: Float = Float((-10 ..< 10).randomElement()!) // Keep all cube Z locations the same let z: Float = 0 - // Set the cubs postion + // Set the cubs position component.position = Position3(x, y, z) } @@ -112,7 +112,7 @@ class WorldSystem: System { let ray = canvas.convertTo3DSpace(mousePosition) // Ask the game for collision and get the first hit from our ray. - // We only care about entites, so we'll grab the hit.entity + // We only care about entities, so we'll grab the hit.entity if let entity = game.collision3DSystem.closestHit(from: ray)?.entity { // Change the color of the hit cube to yellow entity[MaterialComponent.self].channel(0) { channel in diff --git a/Sources/3D_FirstPerson/FirstPerson.swift b/Sources/3D_FirstPerson/FirstPerson.swift index 2f9e92e..8b29f99 100644 --- a/Sources/3D_FirstPerson/FirstPerson.swift +++ b/Sources/3D_FirstPerson/FirstPerson.swift @@ -13,7 +13,7 @@ import GateEngine @main final class FirstPersonGameDelegate: GameDelegate { - // didFinishLaunching() is executed immediatley after the game is ready to start + // didFinishLaunching() is executed immediately after the game is ready to start func didFinishLaunching(game: Game, options: LaunchOptions) { // Add our LevelLoadingSystem system to the game. Implementation is below @@ -70,7 +70,7 @@ class LevelLoadingSystem: System { level.configure(MaterialComponent.self) { material in // Begin modifying material channel zero material.channel(0) { channel in - // Load the texture from our game's resoruces + // Load the texture from our game's resources channel.texture = Texture(path: "Resources/Atlas.png") } } @@ -125,7 +125,7 @@ class PlayerControllerSystem: System { component.kind = .dynamic // Robust protection applies a more expensiove collision check // This helps reduce the chance of an entity passing through a wall - // Use this option for entites that move with controls or move at higher speeds + // Use this option for entities that move with controls or move at higher speeds component.options = .robustProtection // The collider is the primitive shape used for collision checking @@ -142,7 +142,7 @@ class PlayerControllerSystem: System { game.cameraEntity?.position3.move(0.5, toward: .up) } - // shouldUpdate() is executed immediatley before update(), and determines if update() is skipped + // shouldUpdate() is executed immediately before update(), and determines if update() is skipped override func shouldUpdate(game: Game, input: HID, withTimePassed deltaTime: Float) async -> Bool { if input.mouse.mode == .standard { if input.mouse.button(.button1).isPressed { @@ -193,7 +193,7 @@ class PlayerControllerSystem: System { // Update the camera so it's in the correct position and looking in the correct direction game.cameraEntity?.configure(Transform3Component.self, { cameraTransform in - // Rotate the players roation by our vertical rotation giving us a rotation with both + // Rotate the players rotation by our vertical rotation giving us a rotation with both let newCameraRotation = playerTransform.rotation * Quaternion(-yAngle, axis: .right) // interpolate the rotation so the movement is smooth cameraTransform.rotation.interpolate(to: newCameraRotation, .linear(deltaTime * 30))