summaryrefslogtreecommitdiffhomepage
path: root/samples
diff options
context:
space:
mode:
authorSimon Chiang <[email protected]>2021-04-23 09:46:41 -0600
committerAmir Rajan <[email protected]>2021-05-26 16:08:45 -0500
commitd5115606c96b0fe0affd72e6e0b72edce7e51042 (patch)
tree5d750d974dc947163dc4cb37a0c9bbac9266a207 /samples
parent1404fd05a99cf745c33a4316b9d5e1562083c3ae (diff)
downloaddragonruby-game-toolkit-contrib-d5115606c96b0fe0affd72e6e0b72edce7e51042.tar.gz
dragonruby-game-toolkit-contrib-d5115606c96b0fe0affd72e6e0b72edce7e51042.zip
Typo fixes
Diffstat (limited to 'samples')
-rw-r--r--samples/01_rendering_basics/01_labels/app/main.rb6
-rw-r--r--samples/02_input_basics/01_keyboard/app/main.rb4
-rw-r--r--samples/02_input_basics/03_mouse_point_to_rect/app/main.rb2
-rw-r--r--samples/03_rendering_sprites/01_animation_using_separate_pngs/app/main.rb4
-rw-r--r--samples/03_rendering_sprites/04_color_and_rotation/app/main.rb4
-rw-r--r--samples/04_physics_and_collisions/01_simple/app/main.rb6
-rw-r--r--samples/04_physics_and_collisions/02_moving_objects/app/main.rb2
-rw-r--r--samples/04_physics_and_collisions/04_box_collision/app/main.rb6
-rw-r--r--samples/04_physics_and_collisions/05_box_collision_2/app/main.rb4
-rw-r--r--samples/04_physics_and_collisions/06_jump_physics/app/main.rb2
-rw-r--r--samples/04_physics_and_collisions/07_jump_physics/app/main.rb2
-rw-r--r--samples/04_physics_and_collisions/08_bouncing_on_collision/app/block.rb8
-rw-r--r--samples/04_physics_and_collisions/08_bouncing_on_collision/app/main.rb2
-rw-r--r--samples/04_physics_and_collisions/08_bouncing_on_collision/app/peg.rb18
-rw-r--r--samples/04_physics_and_collisions/08_bouncing_on_collision/app/vector2d.rb2
-rw-r--r--samples/04_physics_and_collisions/09_arbitrary_collision/app/linear_collider.rb4
-rw-r--r--samples/04_physics_and_collisions/09_arbitrary_collision/app/main.rb2
-rw-r--r--samples/04_physics_and_collisions/09_arbitrary_collision/app/vector2d.rb2
-rw-r--r--samples/04_physics_and_collisions/10_collision_with_object_removal/app/linear_collider.rb6
-rw-r--r--samples/04_physics_and_collisions/10_collision_with_object_removal/app/vector2d.rb2
-rw-r--r--samples/05_mouse/01_mouse_click/app/main.rb2
-rw-r--r--samples/05_mouse/02_mouse_move/app/main.rb4
-rw-r--r--samples/05_mouse/03_mouse_move_paint_app/app/main.rb2
-rw-r--r--samples/06_save_load/01_save_load_game/app/main.rb8
-rw-r--r--samples/07_advanced_rendering/03_render_target_viewports/app/main.rb4
-rw-r--r--samples/09_performance/02_sprites_as_entities/app/main.rb2
-rw-r--r--samples/09_performance/04_sprites_as_classes/app/main.rb2
-rw-r--r--samples/09_performance/05_static_sprites_as_classes/app/main.rb2
-rw-r--r--samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb2
-rw-r--r--samples/13_path_finding_algorithms/01_breadth_first_search/app/main.rb2
-rw-r--r--samples/13_path_finding_algorithms/02_detailed_breadth_first_search/app/main.rb2
-rw-r--r--samples/13_path_finding_algorithms/06_heuristic/app/main.rb2
-rw-r--r--samples/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb2
-rw-r--r--samples/99_genre_arcade/snakemoji/app/main.rb6
-rw-r--r--samples/99_genre_arcade/twinstick/app/main.rb2
-rw-r--r--samples/99_genre_crafting/craft_game_starting_point/app/main.rb32
-rw-r--r--samples/99_genre_lowrez/nokia_3310/app/main.rb6
-rw-r--r--samples/99_genre_lowrez/resolution_64x64/app/main.rb6
-rw-r--r--samples/99_genre_platformer/clepto_frog/app/main.rb2
-rw-r--r--samples/99_genre_rpg_narrative/choose_your_own_adventure/app/decision.rb2
-rw-r--r--samples/99_genre_rpg_narrative/choose_your_own_adventure/app/main.rb2
-rw-r--r--samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/main.rb2
-rw-r--r--samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/sprite_lookup.rb2
-rw-r--r--samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb2
-rw-r--r--samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/main.rb2
-rw-r--r--samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/sprite_lookup.rb2
-rw-r--r--samples/99_genre_rpg_roguelike/roguelike_starting_point/app/main.rb2
-rw-r--r--samples/99_genre_rpg_tactical/isometric_grid/app/main.rb8
48 files changed, 101 insertions, 101 deletions
diff --git a/samples/01_rendering_basics/01_labels/app/main.rb b/samples/01_rendering_basics/01_labels/app/main.rb
index c3e1afc..8a5e866 100644
--- a/samples/01_rendering_basics/01_labels/app/main.rb
+++ b/samples/01_rendering_basics/01_labels/app/main.rb
@@ -2,12 +2,12 @@
APIs listing that haven't been encountered in a previous sample apps:
-- args.outputs.labels: An array. Values in this array generate labels
+- args.outputs.labels: An array. Values in this array generate labels on
the screen.
- args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual
720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720).
- Numeric#shift_(left|right|up|down): Shifts the Numeric in the correct direction
- by adding or subracting.
+ by adding or subtracting.
=end
@@ -27,7 +27,7 @@ APIs listing that haven't been encountered in a previous sample apps:
# The tick method is called by DragonRuby every frame
# args contains all the information regarding the game.
def tick args
- tick_instructions args, "Sample app shows different version of label sizes and alignments. And how to use hashes instead of arrays."
+ tick_instructions args, "Sample app shows different versions of label sizes and alignments. And how to use hashes instead of arrays."
# Here are some examples of simple labels, with the minimum number of parameters
# Note that the default values for the other parameters are 0, except for Alpha which is 255 and Font Style which is the default font
args.outputs.labels << [400, 620, "Here is a label with just an x, y, and text"]
diff --git a/samples/02_input_basics/01_keyboard/app/main.rb b/samples/02_input_basics/01_keyboard/app/main.rb
index 3c5e1b4..d0321ef 100644
--- a/samples/02_input_basics/01_keyboard/app/main.rb
+++ b/samples/02_input_basics/01_keyboard/app/main.rb
@@ -4,7 +4,7 @@ APIs listing that haven't been encountered in a previous sample apps:
- args.inputs.keyboard.key_up.KEY: The value of the properties will be set
to the frame that the key_up event occurred (the frame correlates
- to args.state.tick_count). Otherwise the value will be nil.
+ to args.state.tick_count). Otherwise the value will be nil.
- args.state.PROPERTY: The state property on args is a dynamic
structure. You can define ANY property here with ANY type of
arbitrary nesting. Properties defined on args.state will be retained
@@ -28,7 +28,7 @@ def tick args
args.outputs.labels << [460, row_to_px(args, 2), "Keyboard input: args.inputs.keyboard.key_up.h", small_font]
args.outputs.labels << [460, row_to_px(args, 3), "Press \"h\" on the keyboard.", small_font]
- # Input on a specifc key can be found through args.inputs.keyboard.key_up followed by the key
+ # Input on a specific key can be found through args.inputs.keyboard.key_up followed by the key
if args.inputs.keyboard.key_up.h
args.state.h_pressed_at = args.state.tick_count
end
diff --git a/samples/02_input_basics/03_mouse_point_to_rect/app/main.rb b/samples/02_input_basics/03_mouse_point_to_rect/app/main.rb
index 7dd627f..1e30943 100644
--- a/samples/02_input_basics/03_mouse_point_to_rect/app/main.rb
+++ b/samples/02_input_basics/03_mouse_point_to_rect/app/main.rb
@@ -36,7 +36,7 @@ APIs that haven't been encountered in a previous sample apps:
# This is useful to determine if a click occurred in a rect
def tick args
- tick_instructions args, "Sample app shows how to determing if a click happened inside a rectangle."
+ tick_instructions args, "Sample app shows how to determine if a click happened inside a rectangle."
x = 460
diff --git a/samples/03_rendering_sprites/01_animation_using_separate_pngs/app/main.rb b/samples/03_rendering_sprites/01_animation_using_separate_pngs/app/main.rb
index c5622e8..1f88366 100644
--- a/samples/03_rendering_sprites/01_animation_using_separate_pngs/app/main.rb
+++ b/samples/03_rendering_sprites/01_animation_using_separate_pngs/app/main.rb
@@ -69,7 +69,7 @@ end
# This function shows how to animate a sprite that executes
# only once when the "f" key is pressed.
def one_time_animation args
- # This is just a label the shows instructions within the game.
+ # This is just a label that shows instructions within the game.
args.outputs.labels << [220, 350, "(press f to animate)"]
# If "f" is pressed on the keyboard...
@@ -104,7 +104,7 @@ def one_time_animation args
# This line sets the frame index to zero, if
# the animation duration has passed (frame_index returned nil).
- # Remeber: we are not looping forever here.
+ # Remember: we are not looping forever here.
sprite_index ||= 0
# Present the sprite.
diff --git a/samples/03_rendering_sprites/04_color_and_rotation/app/main.rb b/samples/03_rendering_sprites/04_color_and_rotation/app/main.rb
index 072feaf..7e0fc3c 100644
--- a/samples/03_rendering_sprites/04_color_and_rotation/app/main.rb
+++ b/samples/03_rendering_sprites/04_color_and_rotation/app/main.rb
@@ -117,7 +117,7 @@ def create_sprite path, options = {}
source_w: -1,
source_h: -1,
- # flip horiztonally, flip vertically
+ # flip horizontally, flip vertically
flip_h: false,
flip_v: false,
@@ -153,7 +153,7 @@ end
def calc_wrap state
# car returns to left side of screen if it disappears on right side of screen
- # sprite.width refers to tile's size, which is multipled by scale (4) to make it bigger
+ # sprite.width refers to tile's size, which is multiplied by scale (4) to make it bigger
state.x = -state.sprite.width * state.sprite.scale if state.x - 20 > 1280
# car wraps around to right side of screen if it disappears on the left side
diff --git a/samples/04_physics_and_collisions/01_simple/app/main.rb b/samples/04_physics_and_collisions/01_simple/app/main.rb
index 5e3f9b7..9075d89 100644
--- a/samples/04_physics_and_collisions/01_simple/app/main.rb
+++ b/samples/04_physics_and_collisions/01_simple/app/main.rb
@@ -10,7 +10,7 @@
# This sample app shows collisions between two boxes.
-# Runs methods needed for game to run properly.
+# Runs methods needed for the game to run properly.
def tick args
tick_instructions args, "Sample app shows how to move a square over time and determine collision."
defaults args
@@ -33,7 +33,7 @@ def defaults args
end
def render args
- # If the game state denotes that a collision has occured,
+ # If the game state denotes that a collision has occurred,
# render a solid square, otherwise render a border instead.
if args.state.center_box_collision
args.outputs.solids << args.state.center_box
@@ -47,7 +47,7 @@ end
# Generally in a pipeline for a game engine, you have rendering,
# game simulation (calculation), and input processing.
-# This fuction represents the game simulation.
+# This function represents the game simulation.
def calc args
position_moving_box args
determine_collision_center_box args
diff --git a/samples/04_physics_and_collisions/02_moving_objects/app/main.rb b/samples/04_physics_and_collisions/02_moving_objects/app/main.rb
index e3e9261..9c39363 100644
--- a/samples/04_physics_and_collisions/02_moving_objects/app/main.rb
+++ b/samples/04_physics_and_collisions/02_moving_objects/app/main.rb
@@ -56,7 +56,7 @@
=end
-# Calls methods needed for game to run properly
+# Calls methods needed for the game to run properly
def tick args
tick_instructions args, "Use LEFT and RIGHT arrow keys to move and SPACE to jump."
defaults args
diff --git a/samples/04_physics_and_collisions/04_box_collision/app/main.rb b/samples/04_physics_and_collisions/04_box_collision/app/main.rb
index af85fef..e407f0d 100644
--- a/samples/04_physics_and_collisions/04_box_collision/app/main.rb
+++ b/samples/04_physics_and_collisions/04_box_collision/app/main.rb
@@ -42,7 +42,7 @@ class PoorManPlatformerPhysics
# Sets default values for variables.
# The ||= sign means that the variable will only be set to the value following the = sign if the value has
- # not already been set before. Intialization happens only in the first frame.
+ # not already been set before. Initialization happens only in the first frame.
def defaults
state.tile_size = 64
state.gravity = -0.2
@@ -161,7 +161,7 @@ class PoorManPlatformerPhysics
# Calls methods needed to determine collisions between player and world_collision rects.
def calc_box_collision
- return unless state.world_lookup.keys.length > 0 # return unless hash has atleast 1 key
+ return unless state.world_lookup.keys.length > 0 # return unless hash has at least 1 key
collision_floor!
collision_left!
collision_right!
@@ -189,7 +189,7 @@ class PoorManPlatformerPhysics
return unless state.dx < 0 # return unless player is moving left
player_rect = [state.x - 0.1, state.y, state.tile_size, state.tile_size]
- # Goes through world_collision_rects to find all intersections beween the player's left side and the
+ # Goes through world_collision_rects to find all intersections between the player's left side and the
# right side of a world_collision_rect.
left_side_collisions = state.world_collision_rects
.find_all { |r| r[:left_right].intersect_rect?(player_rect, collision_tollerance) }
diff --git a/samples/04_physics_and_collisions/05_box_collision_2/app/main.rb b/samples/04_physics_and_collisions/05_box_collision_2/app/main.rb
index 126759a..42ccf22 100644
--- a/samples/04_physics_and_collisions/05_box_collision_2/app/main.rb
+++ b/samples/04_physics_and_collisions/05_box_collision_2/app/main.rb
@@ -91,7 +91,7 @@ class MetroidvaniaStarter
state.sprite_selected ||= 1
state.map_saved_at ||= 0
- # Sets all the cordinate values for the sprite selection screen into a grid
+ # Sets all the coordinate values for the sprite selection screen into a grid
# Displayed when 's' is pressed by player to access sprites
if state.sprite_coords == [] # if sprite_coords is an empty array
count = 1
@@ -223,7 +223,7 @@ class MetroidvaniaStarter
# Calls methods that determine whether the player collides with any world_collision_rects.
def calc_box_collision
- return unless state.world_lookup.keys.length > 0 # return unless hash has atleast 1 key
+ return unless state.world_lookup.keys.length > 0 # return unless hash has at least 1 key
collision_floor
collision_left
collision_right
diff --git a/samples/04_physics_and_collisions/06_jump_physics/app/main.rb b/samples/04_physics_and_collisions/06_jump_physics/app/main.rb
index da01e91..9d7a976 100644
--- a/samples/04_physics_and_collisions/06_jump_physics/app/main.rb
+++ b/samples/04_physics_and_collisions/06_jump_physics/app/main.rb
@@ -36,7 +36,7 @@ class VerticalPlatformer
s.new_entity_strict(:platform, hash) # platform key
end
- # calls methods needed for game to run properly
+ # calls methods needed for the game to run properly
def tick
defaults
render
diff --git a/samples/04_physics_and_collisions/07_jump_physics/app/main.rb b/samples/04_physics_and_collisions/07_jump_physics/app/main.rb
index da01e91..9d7a976 100644
--- a/samples/04_physics_and_collisions/07_jump_physics/app/main.rb
+++ b/samples/04_physics_and_collisions/07_jump_physics/app/main.rb
@@ -36,7 +36,7 @@ class VerticalPlatformer
s.new_entity_strict(:platform, hash) # platform key
end
- # calls methods needed for game to run properly
+ # calls methods needed for the game to run properly
def tick
defaults
render
diff --git a/samples/04_physics_and_collisions/08_bouncing_on_collision/app/block.rb b/samples/04_physics_and_collisions/08_bouncing_on_collision/app/block.rb
index 9254ee4..db6687a 100644
--- a/samples/04_physics_and_collisions/08_bouncing_on_collision/app/block.rb
+++ b/samples/04_physics_and_collisions/08_bouncing_on_collision/app/block.rb
@@ -110,8 +110,8 @@ class Block
#Find the vector that is perpendicular to the slope
perpVect = { x: x, y: y }
- mag = (perpVect.x**2 + perpVect.y**2)**0.5 # find the magniude of the perpVect
- perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)} # divide the perpVect by the magniude to make it a unit vector
+ mag = (perpVect.x**2 + perpVect.y**2)**0.5 # find the magnitude of the perpVect
+ perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)} # divide the perpVect by the magnitude to make it a unit vector
previousPosition = { # calculate an ESTIMATE of the previousPosition of the ball
x:args.state.ball.center.x-args.state.ball.velocity.x,
@@ -140,7 +140,7 @@ class Block
dampener = 0.3
ynew *= dampener * 0.5
- #If the bounce is very low, that means the ball is rolling and we don't want to dampenen the X velocity
+ #If the bounce is very low, that means the ball is rolling and we don't want to dampen the X velocity
if ynew > -0.1
xnew *= dampener
end
@@ -152,7 +152,7 @@ class Block
args.state.ball.velocity.x = -xnew
args.state.ball.velocity.y = -ynew
- #Set the position of the ball to the previous position so it doesn't warp throught the block
+ #Set the position of the ball to the previous position so it doesn't warp through the block
args.state.ball.center.x = previousPosition.x
args.state.ball.center.y = previousPosition.y
end
diff --git a/samples/04_physics_and_collisions/08_bouncing_on_collision/app/main.rb b/samples/04_physics_and_collisions/08_bouncing_on_collision/app/main.rb
index f5883ad..22d3711 100644
--- a/samples/04_physics_and_collisions/08_bouncing_on_collision/app/main.rb
+++ b/samples/04_physics_and_collisions/08_bouncing_on_collision/app/main.rb
@@ -60,7 +60,7 @@ begin :default_methods
center = args.grid.w / 2
for i in (0...5)
- #Create a ramp of blocks. Not going to be perfect because of the float to integer conversion and anisotropic to isotropic coversion
+ #Create a ramp of blocks. Not going to be perfect because of the float to integer conversion and anisotropic to isotropic conversion
args.state.blocks.append(Block.new((center + 100 + (i * horizontal_offset)).to_i, 100 + (vertical_offset * i) + (i * block_size), block_size, rotation))
args.state.blocks.append(Block.new((center - 100 - (i * horizontal_offset)).to_i, 100 + (vertical_offset * i) + (i * block_size), block_size, -rotation))
end
diff --git a/samples/04_physics_and_collisions/08_bouncing_on_collision/app/peg.rb b/samples/04_physics_and_collisions/08_bouncing_on_collision/app/peg.rb
index 52045de..daf95ec 100644
--- a/samples/04_physics_and_collisions/08_bouncing_on_collision/app/peg.rb
+++ b/samples/04_physics_and_collisions/08_bouncing_on_collision/app/peg.rb
@@ -1,11 +1,11 @@
class Peg
def initialize(x, y, block_size)
- @x = x # x cordinate of the LEFT side of the peg
- @y = y # y cordinate of the RIGHT side of the peg
+ @x = x # x coordinate of the LEFT side of the peg
+ @y = y # y coordinate of the RIGHT side of the peg
@block_size = block_size # diameter of the peg
@radius = @block_size/2.0 # radius of the peg
- @center = { # cordinatees of the CENTER of the peg
+ @center = { # coordinatees of the CENTER of the peg
x: @x+@block_size/2.0,
y: @y+@block_size/2.0
}
@@ -116,8 +116,8 @@ class Peg
}
perpVect = {x: pointB.x - pointA.x, y:pointB.y - pointA.y} # perpVect is to be VECTOR of the perpendicular tangent
- mag = (perpVect.x**2 + perpVect.y**2)**0.5 # find the magniude of the perpVect
- perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)} # divide the perpVect by the magniude to make it a unit vector
+ mag = (perpVect.x**2 + perpVect.y**2)**0.5 # find the magnitude of the perpVect
+ perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)} # divide the perpVect by the magnitude to make it a unit vector
perpVect = {x: -perpVect.y, y: perpVect.x} # swap the x and y and multiply by -1 to make the vector perpendicular
args.state.display_value = perpVect
if perpVect.y > 0 #ensure perpVect points upward
@@ -130,12 +130,12 @@ class Peg
}
yInterc = pointA.y + -slope*pointA.x
- if slope == INFINITY # the perpVect presently either points in the correct dirrection or it is 180 degrees off we need to correct this
+ if slope == INFINITY # the perpVect presently either points in the correct direction or it is 180 degrees off we need to correct this
if previousPosition.x < pointA.x
perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}
yInterc = -INFINITY
end
- elsif previousPosition.y < slope*previousPosition.x + yInterc # check if ball is bellow or above the collider to determine if perpVect is - or +
+ elsif previousPosition.y < slope*previousPosition.x + yInterc # check if ball is below or above the collider to determine if perpVect is - or +
perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}
end
@@ -148,7 +148,7 @@ class Peg
fbx = velocityMag * Math.cos(theta_ball) #the x component of the ball's velocity
fby = velocityMag * Math.sin(theta_ball) #the y component of the ball's velocity
- repelMag = getRepelMagnitude( # the magniude of the collision vector
+ repelMag = getRepelMagnitude( # the magnitude of the collision vector
args,
fbx,
fby,
@@ -173,7 +173,7 @@ class Peg
if args.state.ball.center.y > @center.y # if the ball is above the middle of the peg we need to temporarily ignore some of the gravity
args.state.ball.velocity.y = ynew + GRAVITY * 0.01
else
- args.state.ball.velocity.y = ynew - GRAVITY * 0.01 # if the ball is bellow the middle of the peg we need to temporarily increase the power of the gravity
+ args.state.ball.velocity.y = ynew - GRAVITY * 0.01 # if the ball is below the middle of the peg we need to temporarily increase the power of the gravity
end
args.state.ball.center.x+= args.state.ball.velocity.x # update the position of the ball so it never looks like the ball is intersecting the circle
diff --git a/samples/04_physics_and_collisions/08_bouncing_on_collision/app/vector2d.rb b/samples/04_physics_and_collisions/08_bouncing_on_collision/app/vector2d.rb
index 9cb1954..0b302f3 100644
--- a/samples/04_physics_and_collisions/08_bouncing_on_collision/app/vector2d.rb
+++ b/samples/04_physics_and_collisions/08_bouncing_on_collision/app/vector2d.rb
@@ -42,7 +42,7 @@ class Vector2d
Vector2d.new(@x/mag, @y/mag)
end
- #TODO delet?
+ #TODO delete?
def distABS vect
(((vect.x-@x)**2+(vect.y-@y)**2)**0.5).abs()
end
diff --git a/samples/04_physics_and_collisions/09_arbitrary_collision/app/linear_collider.rb b/samples/04_physics_and_collisions/09_arbitrary_collision/app/linear_collider.rb
index 9571669..679f3a4 100644
--- a/samples/04_physics_and_collisions/09_arbitrary_collision/app/linear_collider.rb
+++ b/samples/04_physics_and_collisions/09_arbitrary_collision/app/linear_collider.rb
@@ -82,7 +82,7 @@ class LinearCollider
#if at least on point is in the rectangle then collision? is true - otherwise false
for point in points
#Check whether a given point lies inside a rectangle or not:
- #if the sum of the area of traingls, PAB, PBC, PCD, PAD equal the area of the rec, then an intersection has occured
+ #if the sum of the area of traingls, PAB, PBC, PCD, PAD equal the area of the rec, then an intersection has occurred
areaRec = triArea.call(rpointA, rpointB, rpointC)+triArea.call(rpointA, rpointC, rpointD)
areaSum = [
triArea.call(point, rpointA, rpointB),triArea.call(point, rpointB, rpointC),
@@ -148,7 +148,7 @@ class LinearCollider
perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}
yInterc = -INFINITY
end
- elsif previousPosition.y < slope*previousPosition.x + yInterc #check if ball is bellow or above the collider to determine if perpVect is - or +
+ elsif previousPosition.y < slope*previousPosition.x + yInterc #check if ball is below or above the collider to determine if perpVect is - or +
perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}
end
diff --git a/samples/04_physics_and_collisions/09_arbitrary_collision/app/main.rb b/samples/04_physics_and_collisions/09_arbitrary_collision/app/main.rb
index b2905fb..228eb9d 100644
--- a/samples/04_physics_and_collisions/09_arbitrary_collision/app/main.rb
+++ b/samples/04_physics_and_collisions/09_arbitrary_collision/app/main.rb
@@ -29,7 +29,7 @@ end
begin :default_methods
def init_blocks args
block_size = args.state.board_width / 8
- #Space inbetween each block
+ #Space in between each block
block_offset = 4
args.state.squares ||=[
diff --git a/samples/04_physics_and_collisions/09_arbitrary_collision/app/vector2d.rb b/samples/04_physics_and_collisions/09_arbitrary_collision/app/vector2d.rb
index 9cb1954..0b302f3 100644
--- a/samples/04_physics_and_collisions/09_arbitrary_collision/app/vector2d.rb
+++ b/samples/04_physics_and_collisions/09_arbitrary_collision/app/vector2d.rb
@@ -42,7 +42,7 @@ class Vector2d
Vector2d.new(@x/mag, @y/mag)
end
- #TODO delet?
+ #TODO delete?
def distABS vect
(((vect.x-@x)**2+(vect.y-@y)**2)**0.5).abs()
end
diff --git a/samples/04_physics_and_collisions/10_collision_with_object_removal/app/linear_collider.rb b/samples/04_physics_and_collisions/10_collision_with_object_removal/app/linear_collider.rb
index 69ada5b..0a20583 100644
--- a/samples/04_physics_and_collisions/10_collision_with_object_removal/app/linear_collider.rb
+++ b/samples/04_physics_and_collisions/10_collision_with_object_removal/app/linear_collider.rb
@@ -1,4 +1,4 @@
-#The LinearCollider (theoretically) produces collisions upon a line segment defined point.y two x,y cordinates
+#The LinearCollider (theoretically) produces collisions upon a line segment defined point.y two x,y coordinates
class LinearCollider
@@ -6,13 +6,13 @@ class LinearCollider
#last [Array of length 2] end of the line segment as a x,y cordinate
#inorder for the LinearCollider to be functional the line segment must be said to have a thickness
- #(as it is unlikly that a colliding object will land exactly on the linesegment)
+ #(as it is unlikely that a colliding object will land exactly on the linesegment)
#extension defines if the line's thickness extends negatively or positively
#extension :pos extends positively
#extension :neg extends negatively
- #thickness [float] how thick the line should be (should always be atleast as large as the magnitude of the colliding object)
+ #thickness [float] how thick the line should be (should always be at least as large as the magnitude of the colliding object)
def initialize (pointA, pointB, extension=:neg, thickness=10)
@pointA = pointA
@pointB = pointB
diff --git a/samples/04_physics_and_collisions/10_collision_with_object_removal/app/vector2d.rb b/samples/04_physics_and_collisions/10_collision_with_object_removal/app/vector2d.rb
index 97cf286..37ea141 100644
--- a/samples/04_physics_and_collisions/10_collision_with_object_removal/app/vector2d.rb
+++ b/samples/04_physics_and_collisions/10_collision_with_object_removal/app/vector2d.rb
@@ -43,7 +43,7 @@ class Vector2d
Vector2d.new(@x/mag, @y/mag)
end
- #TODO delet?
+ #TODO delete?
def distABS vect
(((vect.x-@x)**2+(vect.y-@y)**2)**0.5).abs()
end
diff --git a/samples/05_mouse/01_mouse_click/app/main.rb b/samples/05_mouse/01_mouse_click/app/main.rb
index c1a6e29..80b91df 100644
--- a/samples/05_mouse/01_mouse_click/app/main.rb
+++ b/samples/05_mouse/01_mouse_click/app/main.rb
@@ -120,7 +120,7 @@ class TicTacToe
space.piece = state.current_turn
# This ternary operator statement allows us to change the current player's turn.
- # If it is currently x's turn, it becomes o's turn. If it is not x's turn, it become's x's turn.
+ # If it is currently x's turn, it becomes o's turn. If it is not x's turn, it becomes x's turn.
state.current_turn = state.current_turn == :x ? :o : :x
end
diff --git a/samples/05_mouse/02_mouse_move/app/main.rb b/samples/05_mouse/02_mouse_move/app/main.rb
index b015277..684928b 100644
--- a/samples/05_mouse/02_mouse_move/app/main.rb
+++ b/samples/05_mouse/02_mouse_move/app/main.rb
@@ -198,13 +198,13 @@ class ProtectThePuppiesFromTheZombies
state.zombies = state.zombies - killed_this_frame # remove newly killed zombies from zombies collection
state.killed_zombies += killed_this_frame # add newly killed zombies to killed zombies
- if killed_this_frame.length > 0 # if atleast one zombie was killed in the frame
+ if killed_this_frame.length > 0 # if at least one zombie was killed in the frame
state.flash_at = state.tick_count # flash_at set to the frame when the zombie was killed
# Don't forget, the rendered flash lasts for 10 frames after the zombie is killed (look at render_flash method)
end
# Sets the tick_count (passage of time) as the value of the death_at variable for each killed zombie.
- # Death_at stores the frame a zombie was killed.
+ # Death_at stores the frame where a zombie was killed.
killed_this_frame.each do |z|
z.death_at = state.tick_count
end
diff --git a/samples/05_mouse/03_mouse_move_paint_app/app/main.rb b/samples/05_mouse/03_mouse_move_paint_app/app/main.rb
index b177fd6..be983a8 100644
--- a/samples/05_mouse/03_mouse_move_paint_app/app/main.rb
+++ b/samples/05_mouse/03_mouse_move_paint_app/app/main.rb
@@ -40,7 +40,7 @@
=end
# This sample app shows an empty grid that the user can paint on.
-# To paint, the user must keep their mouse presssed and drag it around the grid.
+# To paint, the user must keep their mouse pressed and drag it around the grid.
# The "clear" button allows users to clear the grid so they can start over.
class PaintApp
diff --git a/samples/06_save_load/01_save_load_game/app/main.rb b/samples/06_save_load/01_save_load_game/app/main.rb
index cc52770..2d2bc41 100644
--- a/samples/06_save_load/01_save_load_game/app/main.rb
+++ b/samples/06_save_load/01_save_load_game/app/main.rb
@@ -48,7 +48,7 @@
class TextedBasedGame
- # Contains methods needed for game to run properly.
+ # Contains methods needed for the game to run properly.
# Increments tick count by 1 each time it runs (60 times in a single second)
def tick
default
@@ -59,7 +59,7 @@ class TextedBasedGame
# Sets default values.
# The ||= ensures that a variable's value is only set to the value following the = sign
- # if the value has not already been set before. Intialization happens only in the first frame.
+ # if the value has not already been set before. Initialization happens only in the first frame.
def default
state.engine_tick_count ||= 0
state.active_module ||= :room
@@ -286,7 +286,7 @@ class TextedBasedGamePresenter
end
# instructions for users on how to add the missing method_to_call to the code
- puts "It looks like #{method_to_call} doesn't exists on TextedBasedGamePresenter. Please add this method:"
+ puts "It looks like #{method_to_call} doesn't exist on TextedBasedGamePresenter. Please add this method:"
puts "Just copy the code below and put it in the #{TextedBasedGamePresenter} class definition."
puts ""
puts "```"
@@ -345,7 +345,7 @@ class TextedBasedGamePresenter
@game
end
- # Initalizes the game and creates an empty list of buttons.
+ # Initializes the game and creates an empty list of buttons.
def initialize
@game = TextedBasedGame.new self
@button_list ||= {}
diff --git a/samples/07_advanced_rendering/03_render_target_viewports/app/main.rb b/samples/07_advanced_rendering/03_render_target_viewports/app/main.rb
index 5c38d6c..0dd6c18 100644
--- a/samples/07_advanced_rendering/03_render_target_viewports/app/main.rb
+++ b/samples/07_advanced_rendering/03_render_target_viewports/app/main.rb
@@ -25,7 +25,7 @@
would print "How are you, Ruby?" to the console.
(Remember, string interpolation only works with double quotes!)
- - Ternary operator (?): Similar to if statement; first evalulates whether a statement is
+ - Ternary operator (?): Similar to if statement; first evaluates whether a statement is
true or false, and then executes a command depending on that result.
For example, if we had a variable
grade = 75
@@ -39,7 +39,7 @@
720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720).
- Numeric#shift_(left|right|up|down): Shifts the Numeric in the correct direction
- by adding or subracting.
+ by adding or subtracting.
- ARRAY#inside_rect?: An array with at least two values is considered a point. An array
with at least four values is considered a rect. The inside_rect? function returns true
diff --git a/samples/09_performance/02_sprites_as_entities/app/main.rb b/samples/09_performance/02_sprites_as_entities/app/main.rb
index 21babda..203dbe0 100644
--- a/samples/09_performance/02_sprites_as_entities/app/main.rb
+++ b/samples/09_performance/02_sprites_as_entities/app/main.rb
@@ -1,5 +1,5 @@
# Sprites represented as Entities using the queue ~args.outputs.sprites~
-# yields nicer access apis over Hashes, but require a bit more code upfront.
+# yields nicer access apis over Hashes, but requires a bit more code upfront.
# The hash sample has to use star[:s] to get the speed of the star, but
# an entity can use .s instead.
def random_x args
diff --git a/samples/09_performance/04_sprites_as_classes/app/main.rb b/samples/09_performance/04_sprites_as_classes/app/main.rb
index 2b43a98..d69dc66 100644
--- a/samples/09_performance/04_sprites_as_classes/app/main.rb
+++ b/samples/09_performance/04_sprites_as_classes/app/main.rb
@@ -22,7 +22,7 @@ class Star
end
end
-# calls methods needed for game to run properly
+# calls methods needed for the game to run properly
def tick args
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
diff --git a/samples/09_performance/05_static_sprites_as_classes/app/main.rb b/samples/09_performance/05_static_sprites_as_classes/app/main.rb
index cbfe00a..f87b110 100644
--- a/samples/09_performance/05_static_sprites_as_classes/app/main.rb
+++ b/samples/09_performance/05_static_sprites_as_classes/app/main.rb
@@ -23,7 +23,7 @@ class Star
end
end
-# calls methods needed for game to run properly
+# calls methods needed for the game to run properly
def tick args
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
diff --git a/samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb b/samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb
index 4d8719d..31f5c9f 100644
--- a/samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb
+++ b/samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb
@@ -47,7 +47,7 @@ class Star
end
end
-# calls methods needed for game to run properly
+# calls methods needed for the game to run properly
def tick args
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
diff --git a/samples/13_path_finding_algorithms/01_breadth_first_search/app/main.rb b/samples/13_path_finding_algorithms/01_breadth_first_search/app/main.rb
index 7f98509..c8e1633 100644
--- a/samples/13_path_finding_algorithms/01_breadth_first_search/app/main.rb
+++ b/samples/13_path_finding_algorithms/01_breadth_first_search/app/main.rb
@@ -251,7 +251,7 @@ class BreadthFirstSearch
outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line
# The circle needs to be offset so that the center of the circle
# overlaps the line instead of the upper right corner of the circle
- # The circle's x value is also moved based on the current seach step
+ # The circle's x value is also moved based on the current search step
circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing)
circle_y = (slider.y - slider.offset)
circle_rect = [circle_x, circle_y, 37, 37]
diff --git a/samples/13_path_finding_algorithms/02_detailed_breadth_first_search/app/main.rb b/samples/13_path_finding_algorithms/02_detailed_breadth_first_search/app/main.rb
index 810ff7b..d4c9c1c 100644
--- a/samples/13_path_finding_algorithms/02_detailed_breadth_first_search/app/main.rb
+++ b/samples/13_path_finding_algorithms/02_detailed_breadth_first_search/app/main.rb
@@ -168,7 +168,7 @@ class DetailedBreadthFirstSearch
outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line
# The circle needs to be offset so that the center of the circle
# overlaps the line instead of the upper right corner of the circle
- # The circle's x value is also moved based on the current seach step
+ # The circle's x value is also moved based on the current search step
circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing)
circle_y = (slider.y - slider.offset)
circle_rect = [circle_x, circle_y, 37, 37]
diff --git a/samples/13_path_finding_algorithms/06_heuristic/app/main.rb b/samples/13_path_finding_algorithms/06_heuristic/app/main.rb
index af466a5..10beba3 100644
--- a/samples/13_path_finding_algorithms/06_heuristic/app/main.rb
+++ b/samples/13_path_finding_algorithms/06_heuristic/app/main.rb
@@ -242,7 +242,7 @@ class Heuristic_With_Walls
outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line
# The circle needs to be offset so that the center of the circle
# overlaps the line instead of the upper right corner of the circle
- # The circle's x value is also moved based on the current seach step
+ # The circle's x value is also moved based on the current search step
circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing)
circle_y = (slider.y - slider.offset)
circle_rect = [circle_x, circle_y, 37, 37]
diff --git a/samples/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb b/samples/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb
index 5fc0804..7b8f653 100644
--- a/samples/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb
+++ b/samples/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb
@@ -275,7 +275,7 @@ class Heuristic
outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line
# The circle needs to be offset so that the center of the circle
# overlaps the line instead of the upper right corner of the circle
- # The circle's x value is also moved based on the current seach step
+ # The circle's x value is also moved based on the current search step
circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing)
circle_y = (slider.y - slider.offset)
circle_rect = [circle_x, circle_y, 37, 37]
diff --git a/samples/99_genre_arcade/snakemoji/app/main.rb b/samples/99_genre_arcade/snakemoji/app/main.rb
index 3bffa22..648b728 100644
--- a/samples/99_genre_arcade/snakemoji/app/main.rb
+++ b/samples/99_genre_arcade/snakemoji/app/main.rb
@@ -10,8 +10,8 @@
# https://gist.github.com/scorp200
#############LICENSE############
# Feel free to use this anywhere and however you want
-# You can sell this to EA for $1,000,000 if you want, its completely free.
-# Just rememeber you are helping this... thing... to spread...
+# You can sell this to EA for $1,000,000 if you want, it's completely free.
+# Just remember you are helping this... thing... to spread...
# ALSO! I am not liable for any mental, physical or financial damage caused.
#############LICENSE############
@@ -156,7 +156,7 @@ def defaults 🎮
🎮.🐍 ||= []
#Direction the head moves to
🎮.🚗 ||= [0, 0]
- #Next_Direction, during input check only change this variable and then when game updates asign this to Direction
+ #Next_Direction, during input check only change this variable and then when game updates assign this to Direction
🎮.🚦 ||= [*🎮.🚗]
#Your score
🎮.💰 ||= 0
diff --git a/samples/99_genre_arcade/twinstick/app/main.rb b/samples/99_genre_arcade/twinstick/app/main.rb
index 4edef92..2ce1d50 100644
--- a/samples/99_genre_arcade/twinstick/app/main.rb
+++ b/samples/99_genre_arcade/twinstick/app/main.rb
@@ -64,7 +64,7 @@ def move_enemies args
theta = Math.atan2(enemy.y - args.state.player.y, enemy.x - args.state.player.x)
# Convert the angle to a vector pointing at the player
dx, dy = theta.to_degrees.vector 5
- # Move the enemy towards thr player
+ # Move the enemy towards the player
enemy.x -= dx
enemy.y -= dy
end
diff --git a/samples/99_genre_crafting/craft_game_starting_point/app/main.rb b/samples/99_genre_crafting/craft_game_starting_point/app/main.rb
index d7478e4..549e73d 100644
--- a/samples/99_genre_crafting/craft_game_starting_point/app/main.rb
+++ b/samples/99_genre_crafting/craft_game_starting_point/app/main.rb
@@ -1,13 +1,13 @@
# ==================================================
# A NOTE TO JAM CRAFT PARTICIPANTS:
-# The comments and code in here are just as small piece of DragonRuby's capabilities.
+# The comments and code in here are just a small piece of DragonRuby's capabilities.
# Be sure to check out the rest of the sample apps. Start with README.txt and go from there!
# ==================================================
# def tick args is the entry point into your game. This function is called at
# a fixed update time of 60hz (60 fps).
def tick args
- # The defaults function intitializes the game.
+ # The defaults function initializes the game.
defaults args
# After the game is initialized, render it.
@@ -38,7 +38,7 @@ def defaults args
# Bottom left is 0, 0. Top right is 1280, 720.
# The inventory area is at the top of the screen
# the number 80 is the size of all the sprites, so that is what is being
- # used to decide the with and height
+ # used to decide the width and height
args.state.sprite_size = 80
args.state.inventory_border.w = args.state.sprite_size * 10
@@ -49,7 +49,7 @@ def defaults args
# define the borders for where the crafting area is located
# the crafting area is below the inventory area
# the number 80 is the size of all the sprites, so that is what is being
- # used to decide the with and height
+ # used to decide the width and height
args.state.craft_border.x = 10
args.state.craft_border.y = 220
args.state.craft_border.w = args.state.sprite_size * 3
@@ -92,12 +92,12 @@ def defaults args
},
]
- # after initializing the oridinal positions, derive the pixel
+ # after initializing the ordinal positions, derive the pixel
# locations assuming that the width and height are 80
args.state.items.each { |item| set_inventory_position args, item }
end
- # define all the oridinal positions of the inventory slots
+ # define all the ordinal positions of the inventory slots
if !args.state.inventory_area
args.state.inventory_area = [
{ ordinal_x: 0, ordinal_y: 0 },
@@ -132,7 +132,7 @@ def defaults args
{ ordinal_x: 9, ordinal_y: 2 },
]
- # after initializing the oridinal positions, derive the pixel
+ # after initializing the ordinal positions, derive the pixel
# locations assuming that the width and height are 80
args.state.inventory_area.each { |i| set_inventory_position args, i }
@@ -144,7 +144,7 @@ def defaults args
# To bring up DragonRuby's Console, press the ~ key within the game.
end
- # define all the oridinal positions of the craft slots
+ # define all the ordinal positions of the craft slots
if !args.state.craft_area
args.state.craft_area = [
{ ordinal_x: 0, ordinal_y: 0 },
@@ -158,7 +158,7 @@ def defaults args
{ ordinal_x: 2, ordinal_y: 2 },
]
- # after initializing the oridinal positions, derive the pixel
+ # after initializing the ordinal positions, derive the pixel
# locations assuming that the width and height are 80
args.state.craft_area.each { |c| set_craft_position args, c }
end
@@ -244,7 +244,7 @@ def input args
found[:location] = :held
end
- # if the mouse is clicked and an item is currently beign held....
+ # if the mouse is clicked and an item is currently being held....
elsif args.state.held_item
# determine if a slot within the craft area was clicked
craft_area = args.state.craft_area.find { |a| args.inputs.mouse.click.point.inside_rect? a }
@@ -255,7 +255,7 @@ def input args
# if the click was within a craft area
if craft_area
# check to see if an item is already there and ignore the click if an item is found
- # item_at_craft_slot is a helper method that returns an item or nil for a given oridinal
+ # item_at_craft_slot is a helper method that returns an item or nil for a given ordinal
# position
item_already_there = item_at_craft_slot args, craft_area[:ordinal_x], craft_area[:ordinal_y]
@@ -263,8 +263,8 @@ def input args
if !item_already_there
# if the quantity they are currently holding is greater than 1
if args.state.held_item[:quantity] > 1
- # remove one item (creating a seperate item of the same type), and place it
- # at the oridinal position and location of the craft area
+ # remove one item (creating a separate item of the same type), and place it
+ # at the ordinal position and location of the craft area
# the .merge method on Hash creates a new Hash, but updates any values
# passed as arguments to merge
new_item = args.state.held_item.merge(quantity: 1,
@@ -272,7 +272,7 @@ def input args
ordinal_x: craft_area[:ordinal_x],
ordinal_y: craft_area[:ordinal_y])
- # after the item is crated, place it into the args.state.items collection
+ # after the item is created, place it into the args.state.items collection
args.state.items << new_item
# then subtract one from the held item
@@ -281,7 +281,7 @@ def input args
# if the craft area is available and there is only one item being held
elsif args.state.held_item[:quantity] == 1
# instead of creating any new items just set the location of the held item
- # to the oridinal position of the craft area, and then nil out the
+ # to the ordinal position of the craft area, and then nil out the
# held item state so that a new item can be picked up
args.state.held_item[:location] = :craft
args.state.held_item[:ordinal_x] = craft_area[:ordinal_x]
@@ -326,7 +326,7 @@ end
def calc args
# make sure that the real position of the inventory
# items are updated every frame to ensure that they
- # are placed correctly given their location and oridinal positions
+ # are placed correctly given their location and ordinal positions
# instead of using .map, here we use .each (since we are not returning a new item and just updating the items in place)
args.state.items.each do |item|
# based on the location of the item, invoke the correct pixel conversion method
diff --git a/samples/99_genre_lowrez/nokia_3310/app/main.rb b/samples/99_genre_lowrez/nokia_3310/app/main.rb
index d275ada..683539e 100644
--- a/samples/99_genre_lowrez/nokia_3310/app/main.rb
+++ b/samples/99_genre_lowrez/nokia_3310/app/main.rb
@@ -67,7 +67,7 @@ def tick args
# =======================================================================
- # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ==========================
+ # ==== HOW TO ANIMATE A SPRITE (SEPARATE PNGS) ==========================
# =======================================================================
# Remove the "#" at the beginning of the line below
# how_to_animate_a_sprite args
@@ -248,7 +248,7 @@ def how_to_render_sprites args
end
# =============================================================================
-# ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ==========================
+# ==== HOW TO ANIMATE A SPRITE (SEPARATE PNGS) ==========================
# =============================================================================
def how_to_animate_a_sprite args
# STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds
@@ -472,7 +472,7 @@ def how_to_determine_collision args
text: "Collision!",
alignment_enum: 1)
else
- # if collision occurred, render the words no collision.
+ # if no collision occurred, render the words no collision.
args.nokia.labels << args.nokia
.default_label
.merge(x: 42,
diff --git a/samples/99_genre_lowrez/resolution_64x64/app/main.rb b/samples/99_genre_lowrez/resolution_64x64/app/main.rb
index a30d75a..9208120 100644
--- a/samples/99_genre_lowrez/resolution_64x64/app/main.rb
+++ b/samples/99_genre_lowrez/resolution_64x64/app/main.rb
@@ -62,7 +62,7 @@ def tick args
# =======================================================================
- # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ==========================
+ # ==== HOW TO ANIMATE A SPRITE (SEPARATE PNGS) ==========================
# Remove the "#" at the beginning of the line below
# how_to_animate_a_sprite args
# =======================================================================
@@ -242,7 +242,7 @@ def how_to_render_sprites args
end
## # =============================================================================
-## # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ==========================
+## # ==== HOW TO ANIMATE A SPRITE (SEPARATE PNGS) ==========================
## # =============================================================================
def how_to_animate_a_sprite args
# STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds
@@ -462,7 +462,7 @@ def how_to_determine_collision args
text: "Collision!",
alignment_enum: 1)
else
- # if collision occurred, render the words no collision.
+ # if no collision occurred, render the words no collision.
args.lowrez.labels << args.lowrez
.default_label
.merge(x: 31,
diff --git a/samples/99_genre_platformer/clepto_frog/app/main.rb b/samples/99_genre_platformer/clepto_frog/app/main.rb
index a4eb069..e1ddffb 100644
--- a/samples/99_genre_platformer/clepto_frog/app/main.rb
+++ b/samples/99_genre_platformer/clepto_frog/app/main.rb
@@ -485,7 +485,7 @@ class CleptoFrog
return if state.world_lookup.keys.length > 0
return unless state.world.length > 0
- # Searches through the world and finds the cordinates that exist
+ # Searches through the world and finds the coordinates that exist
state.world_lookup = {}
state.world.each do |x, y, w, h|
state.world_lookup[[x, y, w || state.tile_size, h || state.tile_size]] = true
diff --git a/samples/99_genre_rpg_narrative/choose_your_own_adventure/app/decision.rb b/samples/99_genre_rpg_narrative/choose_your_own_adventure/app/decision.rb
index 2921076..0d23668 100644
--- a/samples/99_genre_rpg_narrative/choose_your_own_adventure/app/decision.rb
+++ b/samples/99_genre_rpg_narrative/choose_your_own_adventure/app/decision.rb
@@ -1,5 +1,5 @@
# Hey there! Welcome to Four Decisions. Here is how you
-# create your decision tree. Remove =being and =end from the text to
+# create your decision tree. Remove =begin and =end from the text to
# enable the game (just save the file). Change stuff and see what happens!
def game
diff --git a/samples/99_genre_rpg_narrative/choose_your_own_adventure/app/main.rb b/samples/99_genre_rpg_narrative/choose_your_own_adventure/app/main.rb
index 9da0f38..953b121 100644
--- a/samples/99_genre_rpg_narrative/choose_your_own_adventure/app/main.rb
+++ b/samples/99_genre_rpg_narrative/choose_your_own_adventure/app/main.rb
@@ -53,7 +53,7 @@ def tick args
end
end
-# Runs methods needed for game to function properly
+# Runs methods needed for the game to function properly
# Creates a rectangular border around the screen
def tick_game args
defaults args
diff --git a/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/main.rb b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/main.rb
index bd5f521..15a381b 100644
--- a/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/main.rb
+++ b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/main.rb
@@ -14,7 +14,7 @@ def tick_game args
# set up your game
# initialize the game/game defaults. ||= means that you only initialize it if
- # the value isn't alread initialized
+ # the value isn't already initialized
args.state.player.x ||= 0
args.state.player.y ||= 0
diff --git a/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/sprite_lookup.rb b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/sprite_lookup.rb
index f129e25..579e133 100644
--- a/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/sprite_lookup.rb
+++ b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/sprite_lookup.rb
@@ -97,7 +97,7 @@ def tile_extended x, y, w, h, r, g, b, a, tile_row_column_or_key
if !row
member_name = member_name_as_code tile_row_column_or_key
- raise "Unabled to find a sprite for #{member_name}. Make sure the value exists in app/sprite_lookup.rb."
+ raise "Unable to find a sprite for #{member_name}. Make sure the value exists in app/sprite_lookup.rb."
end
# Sprite provided by Rogue Yun
diff --git a/samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb b/samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb
index 66ff027..c2c364b 100644
--- a/samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb
+++ b/samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb
@@ -339,7 +339,7 @@ class Game
state.enemies.find { |e| e.x == x && e.y == y && !e.is_dead }
end
- #M oves the user based on their keyboard input and sets values for target cell
+ # Moves the user based on their keyboard input and sets values for target cell
def input_target_cell
if inputs.keyboard.key_down.up # if "up" key is in "down" state
[state.x, state.y + 1, 0, 1] # user moves up
diff --git a/samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/main.rb b/samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/main.rb
index bd5f521..15a381b 100644
--- a/samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/main.rb
+++ b/samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/main.rb
@@ -14,7 +14,7 @@ def tick_game args
# set up your game
# initialize the game/game defaults. ||= means that you only initialize it if
- # the value isn't alread initialized
+ # the value isn't already initialized
args.state.player.x ||= 0
args.state.player.y ||= 0
diff --git a/samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/sprite_lookup.rb b/samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/sprite_lookup.rb
index f129e25..579e133 100644
--- a/samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/sprite_lookup.rb
+++ b/samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/sprite_lookup.rb
@@ -97,7 +97,7 @@ def tile_extended x, y, w, h, r, g, b, a, tile_row_column_or_key
if !row
member_name = member_name_as_code tile_row_column_or_key
- raise "Unabled to find a sprite for #{member_name}. Make sure the value exists in app/sprite_lookup.rb."
+ raise "Unable to find a sprite for #{member_name}. Make sure the value exists in app/sprite_lookup.rb."
end
# Sprite provided by Rogue Yun
diff --git a/samples/99_genre_rpg_roguelike/roguelike_starting_point/app/main.rb b/samples/99_genre_rpg_roguelike/roguelike_starting_point/app/main.rb
index 7ed8d60..bc4d7fd 100644
--- a/samples/99_genre_rpg_roguelike/roguelike_starting_point/app/main.rb
+++ b/samples/99_genre_rpg_roguelike/roguelike_starting_point/app/main.rb
@@ -338,7 +338,7 @@ class Game
state.enemies.find { |e| e.x == x && e.y == y && !e.is_dead }
end
- #M oves the user based on their keyboard input and sets values for target cell
+ # Moves the user based on their keyboard input and sets values for target cell
def input_target_cell
if inputs.keyboard.key_down.up # if "up" key is in "down" state
[state.x, state.y + 1, 0, 1] # user moves up
diff --git a/samples/99_genre_rpg_tactical/isometric_grid/app/main.rb b/samples/99_genre_rpg_tactical/isometric_grid/app/main.rb
index 28bea32..6c8368d 100644
--- a/samples/99_genre_rpg_tactical/isometric_grid/app/main.rb
+++ b/samples/99_genre_rpg_tactical/isometric_grid/app/main.rb
@@ -10,10 +10,10 @@ class Isometric
def defaults
state.quantity ||= 6 #Size of grid
- state.tileSize ||= [262 / 2, 194 / 2] #width and heigth of orange tiles
+ state.tileSize ||= [262 / 2, 194 / 2] #width and height of orange tiles
state.tileGrid ||= [] #Holds ordering of tiles
state.currentSpriteLocation ||= -1 #Current Sprite hovering location
- state.tileCords ||= [] #Physical, rendering cordinates
+ state.tileCords ||= [] #Physical, rendering coordinates
state.initCords ||= [640 - (state.quantity / 2 * state.tileSize[0]), 330] #Location of tile (0, 0)
state.sideSize ||= [state.tileSize[0] / 2, 242 / 2] #Purple & green cube face size
state.mode ||= :delete #Switches between :delete and :insert
@@ -50,7 +50,7 @@ class Isometric
end
end
- #Calculates physical cordinates for tiles
+ #Calculates physical coordinates for tiles
if state.tileCords == []
state.tileCords = state.tileGrid.map do
|val|
@@ -101,7 +101,7 @@ class Isometric
#Shows the tile itself. Important that it's rendered after the two above!
outputs.sprites << state.tileCords.map do
|val|
- if val[2] == true #Chcekcs if tile needs to be rendered
+ if val[2] == true #Checks if tile needs to be rendered
if val[5] == state.currentSpriteLocation
[val[0], val[1], state.tileSize[0], state.tileSize[1], 'sprites/selectedTile.png']
else