Skip to content
Merged
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
2 changes: 1 addition & 1 deletion arcade/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def __init__(
LOG.warning("Skipping antialiasing due missing hardware/driver support")
config = None
antialiasing = False
# If we still don't have a config
# If we still don't have a config
if not config:
config = pyglet.gl.Config(
major_version=gl_version[0],
Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/array_backed_grid_buffered.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, width, height, title):
# array is simply a list of lists.
# This array can be altered later to contain 0 or 1
# to show a white or green cell.
#
#
# A 4 x 4 grid would look like this
#
# grid = [
Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/array_backed_grid_sprites_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, width, height, title):
# array is simply a list of lists.
# This array can be altered later to contain 0 or 1
# to show a white or green cell.
#
#
# A 4 x 4 grid would look like this
#
# grid = [
Expand Down
10 changes: 5 additions & 5 deletions arcade/examples/drawing_text_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(self, width, height, title):
start_x,
start_y,
arcade.color.BLACK,
DEFAULT_FONT_SIZE
DEFAULT_FONT_SIZE
)

# Show some built-in fonts
Expand Down Expand Up @@ -108,7 +108,7 @@ def __init__(self, width, height, title):
start_x, start_y,
arcade.color.BLACK,
DEFAULT_FONT_SIZE,
font_name="Kenney Mini Square",
font_name="Kenney Mini Square",
)

start_y -= DEFAULT_LINE_HEIGHT
Expand All @@ -135,7 +135,7 @@ def __init__(self, width, height, title):
start_x, start_y,
arcade.color.BLACK,
DEFAULT_FONT_SIZE,
font_name="Kenney Rocket",
font_name="Kenney Rocket",
)

start_y -= DEFAULT_LINE_HEIGHT
Expand Down Expand Up @@ -237,7 +237,7 @@ def __init__(self, width, height, title):
arcade.color.BLACK,
DEFAULT_FONT_SIZE,
anchor_x="left",
anchor_y="top",
anchor_y="top",
)

start_y -= DEFAULT_LINE_HEIGHT * 2
Expand Down Expand Up @@ -330,7 +330,7 @@ def on_draw(self):
self.bottom_left.x,
self.bottom_left.y,
arcade.color.BARN_RED,
5,
5,
)
self.bottom_left.draw()

Expand Down
10 changes: 5 additions & 5 deletions arcade/examples/drawing_text_objects_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self, width, height, title):
start_y,
arcade.color.BLACK,
DEFAULT_FONT_SIZE,
batch=self.batch,
batch=self.batch,
)

# Show some built-in fonts
Expand Down Expand Up @@ -124,7 +124,7 @@ def __init__(self, width, height, title):
arcade.color.BLACK,
DEFAULT_FONT_SIZE,
font_name="Kenney Mini Square",
batch=self.batch,
batch=self.batch,
)

start_y -= DEFAULT_LINE_HEIGHT
Expand Down Expand Up @@ -154,7 +154,7 @@ def __init__(self, width, height, title):
arcade.color.BLACK,
DEFAULT_FONT_SIZE,
font_name="Kenney Rocket",
batch=self.batch,
batch=self.batch,
)

start_y -= DEFAULT_LINE_HEIGHT
Expand Down Expand Up @@ -264,7 +264,7 @@ def __init__(self, width, height, title):
DEFAULT_FONT_SIZE,
anchor_x="left",
anchor_y="top",
batch=self.batch,
batch=self.batch,
)

start_y -= DEFAULT_LINE_HEIGHT * 2
Expand Down Expand Up @@ -344,7 +344,7 @@ def on_draw(self):
self.bottom_left.x,
self.bottom_left.y,
arcade.color.BARN_RED,
5,
5,
)

arcade.draw_point(
Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/gl/3d_sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(self, width, height, title):
if (l < 0.0) {
l = abs(l);
fragColor = vec4(0.75, 0.0, 0.0, 1.0) * (0.25 + abs(l) * 0.75);
} else {
} else {
fragColor = vec4(1.0) * (0.25 + abs(l) * 0.75);
}
}
Expand Down
4 changes: 2 additions & 2 deletions arcade/examples/gl/chip8_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
bits to represent what pixel is enabled/disabled so the byte size of
the buffer is 8 x 4 = 32 bytes.

References:
References:
http://mattmik.com/files/chip8/mastering/chip8.html
https://github.com/JohnEarnest/Octo

Expand Down Expand Up @@ -65,7 +65,7 @@ def __init__(self, width, height, title):
}
"""
)
# 8 x 4
# 8 x 4
self.program['projection'] = self.projection
self.program['screen'] = 0
b = 0 # border to test scale
Expand Down
4 changes: 2 additions & 2 deletions arcade/examples/gl/custom_sprite.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ def __init__(self):
size = in_size;
}
""",
geometry_shader="""
geometry_shader="""
#version 330

// Configure inputs and outputs for the geometry shader
// We are taking single points form the vertex shader per invocation
// and emitting 4 new vertices creating a quad/sprites
layout (points) in;
layout (triangle_strip, max_vertices = 4) out;
layout (triangle_strip, max_vertices = 4) out;

// A uniform buffer that will automagically contain pyglet's projection matrix
uniform WindowBlock {
Expand Down
8 changes: 4 additions & 4 deletions arcade/examples/gl/random_shader_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self):

in vec2 in_pos;

// This in the index of this specific vertex.
// This in the index of this specific vertex.
// Flat just specifies that the value shouldn't be interpolated between vertices.
flat out int vert_id;
out vec2 vert_pos;
Expand All @@ -50,7 +50,7 @@ def __init__(self):

vert_id = gl_VertexID;
vert_pos = in_pos;
}
}

""",
fragment_shader="""
Expand All @@ -61,7 +61,7 @@ def __init__(self):
// predefining the function which will be over written with the code injection.
// the random function takes in 1, 2, 3, or 4 floats and returns a new float between 0 and 1
float random(vec2 v);
float random(vec3 v);
float random(vec3 v);
float random(vec4 v);

// Both of these are used as seed values to make sure each call is unique
Expand All @@ -76,7 +76,7 @@ def __init__(self):
void main(){

float red = random(vec4(vert_pos.x, vert_pos.y, time_seed, vert_id));
float green = random(vec4(vert_id, time_seed, vert_pos.y, vert_pos.x));
float green = random(vec4(vert_id, time_seed, vert_pos.y, vert_pos.x));
float blue = random(vec4(vert_pos.y, vert_pos.x, time_seed, vert_id));
frag_colour = vec4(red, green, blue, 1.0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self):
# Player
self.player = arcade.Sprite(
":resources:images/animated_characters/female_person/femalePerson_idle.png",
scale=0.5,
scale=0.5,
)

# This program draws lines from the player/origin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

This builds on a previous example adding line of sight (LoS)
checks by using texture lookups. We our walls into a
texture and read the pixels in a line between the
texture and read the pixels in a line between the
player and the target sprite to check if the path is
colliding with something.

Expand All @@ -31,7 +31,7 @@ def __init__(self):
# Player
self.player = arcade.Sprite(
":resources:images/animated_characters/female_person/femalePerson_idle.png",
scale=0.25,
scale=0.25,
)

# Wall sprites we are checking collision against
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self):
# Player
self.player = arcade.Sprite(
":resources:images/animated_characters/female_person/femalePerson_idle.png",
scale=0.25,
scale=0.25,
)

# Wall sprites we are checking collision against
Expand Down
4 changes: 2 additions & 2 deletions arcade/examples/gl/transform_emit.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ def __init__(self):
self.draw_geometry_1 = self.ctx.geometry(
[
BufferDescription(self.buffer_pos_1, "2f", ("in_pos",)),
BufferDescription(self.buffer_colors, "3f", ("in_col",)),
BufferDescription(self.buffer_colors, "3f", ("in_col",)),
],
mode=self.ctx.POINTS,
)
self.draw_geometry_2 = self.ctx.geometry(
[
BufferDescription(self.buffer_pos_2, "2f", ("in_pos",)),
BufferDescription(self.buffer_colors, "3f", ("in_col",)),
BufferDescription(self.buffer_colors, "3f", ("in_col",)),
],
mode=self.ctx.POINTS,
)
Expand Down
8 changes: 4 additions & 4 deletions arcade/examples/gl/transform_point_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def gen_initial_data(window, width, height):
def gen_colors(width, height):
"""Generate some random colors"""
for _ in range(width * height):
yield random.uniform(0, 1)
yield random.uniform(0, 1)
yield random.uniform(0, 1)
yield random.uniform(0, 1)
yield random.uniform(0, 1)
yield random.uniform(0, 1)


class MyGame(arcade.Window):
Expand Down Expand Up @@ -152,7 +152,7 @@ def on_draw(self):

# Calculate delta time (not extremely accurate, but good enough)
now = time.time()
self.frame_time = now - self.last_time
self.frame_time = now - self.last_time
self.last_time = now

# Move points with transform
Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/net_process_animal_facts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Display random animal facts from
Display random animal facts from
* https://github.com/wh-iterabb-it/meowfacts
* https://kinduff.github.io/dog-api/

Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/platform_tutorial/03_scene_object.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Platformer Game

python -m arcade.examples.platform_tutorial.03_scene_object
python -m arcade.examples.platform_tutorial.03_scene_object
"""
import arcade

Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/platform_tutorial/05_add_gravity.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Platformer Game

python -m arcade.examples.platform_tutorial.05_add_gravity
python -m arcade.examples.platform_tutorial.05_add_gravity
"""
import arcade

Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/sound_speed_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
command line with:
python -m arcade.examples.sound_speed_demo

Left click a button to play a sound.
Left click a button to play a sound.

Each button plays the same sound sample in a slightly different way.

Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/sprite_rotate_around_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def rotate_around_point(self, point, degrees, change_angle=True):
if change_angle:
self.angle += degrees

# Move the sprite along a circle centered on the point by degrees
# Move the sprite along a circle centered on the point by degrees
self.position = rotate_point(
self.center_x, self.center_y,
point[0], point[1], degrees)
Expand Down
14 changes: 7 additions & 7 deletions arcade/examples/sprite_rotate_around_tank.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
tank with a barrel that follows the mouse. You can press P to switch
between two ways of rotating the barrel:
1. Correctly, with the barrel's rear against the tank's center
2. Incorrectly, around the barrel's center pinned to the tank's
2. Incorrectly, around the barrel's center pinned to the tank's

Artwork from https://kenney.nl

Expand All @@ -36,7 +36,7 @@

# This is half the length of the barrel sprite.
# We use it to ensure the barrel's rear sits in the middle of the tank
TANK_BARREL_LENGTH_HALF = 15
TANK_BARREL_LENGTH_HALF = 15


SCREEN_WIDTH = 800
Expand Down Expand Up @@ -93,7 +93,7 @@ def __init__(self):
self.barrel.position =\
SCREEN_MIDDLE[0], SCREEN_MIDDLE[1] - TANK_BARREL_LENGTH_HALF

self.tank_direction = 0.0 # Forward & backward throttle
self.tank_direction = 0.0 # Forward & backward throttle
self.tank_turning = 0.0 # Turning strength to the left or right

self.mouse_pos = 0, 0
Expand Down Expand Up @@ -124,7 +124,7 @@ def on_update(self, delta_time: float):

def move_tank(self, delta_time):
"""
Perform all calculations for moving the tank's body and barrel
Perform all calculations for moving the tank's body and barrel
"""

# Rotate the tank's body in place without changing position
Expand All @@ -142,12 +142,12 @@ def move_tank(self, delta_time):
self.tank.center_x + x_dir,\
self.tank.center_y + y_dir

# Move the barrel with the body
# Move the barrel with the body
self.barrel.position =\
self.barrel.center_x + x_dir,\
self.barrel.center_y + y_dir

# Begin rotating the barrel by finding the angle to the mouse
# Begin rotating the barrel by finding the angle to the mouse
mouse_angle = get_angle_degrees(
self.tank.center_x, self.tank.center_y,
self.mouse_pos[0], self.mouse_pos[1])
Expand All @@ -164,7 +164,7 @@ def move_tank(self, delta_time):

self.barrel.rotate_around_point(self.tank.position, angle_change)
else:
# Swivel the barrel with its center aligned with the body's
# Swivel the barrel with its center aligned with the body's
self.barrel.angle = mouse_angle

def on_key_press(self, symbol: int, modifiers: int):
Expand Down
2 changes: 1 addition & 1 deletion arcade/experimental/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"ShadertoyBase",
"CRTFilter",
"BloomFilter",
]
]
2 changes: 1 addition & 1 deletion arcade/experimental/actor_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def __init__(self, ctx, *, size: Tuple[int, int]):
":resources:images/tiles/dirtCenter.png",
]
self.textures = [
arcade.load_texture(path, hit_box_algorithm=hitbox.algo_bounding_box)
arcade.load_texture(path, hit_box_algorithm=hitbox.algo_bounding_box)
for path in texture_paths
]

Expand Down
2 changes: 1 addition & 1 deletion arcade/experimental/atlas_replace_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def on_draw(self):

def on_update(self, delta_time: float):
self.elapsed_time += delta_time
# Change textures
# Change textures
if self.elapsed_time > 1.0:
# Replace the internal images. They all have the same size (required)
self.sprite_1.texture.image = next(self.texture_cycle).image
Expand Down
Loading