Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct typos #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[default.extend-identifiers]
inout = "inout"

[files]
extend-exclude = [
"*.c",
"*.h",
"*.hpp",
"*.cpp",
"*.txt",
]
12 changes: 6 additions & 6 deletions Sources/01_UserInput/UserInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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}) {
Expand Down Expand 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
Expand All @@ -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)
}

Expand Down
8 changes: 4 additions & 4 deletions Sources/02_MultipleWindows/MultipleWindows.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)")
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions Sources/2D_01_AnimatedSprite/AnimatedSprite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Sources/3D_01_RotatingCube/RotatingCube.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Sources/3D_02_SkinnedCharacter/SkinnedCharacter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}
Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Sources/3D_03_MousePicking/MousePicking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions Sources/3D_FirstPerson/FirstPerson.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
}
}
Expand Down Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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))
Expand Down