diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..1870410 Binary files /dev/null and b/.DS_Store differ diff --git a/im-bw b/im-bw new file mode 100755 index 0000000..f14b71d --- /dev/null +++ b/im-bw @@ -0,0 +1 @@ +magick $@ -alpha off -threshold 30% bw.$@ diff --git a/im-crop b/im-crop new file mode 100755 index 0000000..5316b0c --- /dev/null +++ b/im-crop @@ -0,0 +1,11 @@ +IMG=$1 +CELL=25 +DX=$6 +DY=$7 +DW=$8 +DH=$9 +X=$(($2 * $CELL + $DX)) +Y=$(($3 * $CELL + $DY)) +W=$(($4 * $CELL + $DW)) +H=$(($5 * $CELL + $DH)) +magick $IMG -crop ${W}x${H}+${X}+${Y} crop.$IMG diff --git a/im-mr b/im-mr new file mode 100755 index 0000000..0de5d82 --- /dev/null +++ b/im-mr @@ -0,0 +1,3 @@ +IMG1=$1 +IMG2=$2 +magick $IMG1 $IMG2 +append mr.$IMG1.$IMG2 diff --git a/im-sz b/im-sz new file mode 100755 index 0000000..70fe508 --- /dev/null +++ b/im-sz @@ -0,0 +1,5 @@ +IMG=$1 +CELL=25 +W=$(($2 * $CELL)) +H=$(($3 * $CELL)) +magick $IMG -resize ${W}x${H}\! sz.$IMG diff --git a/res/bw.src-02.png b/res/bw.src-02.png new file mode 100644 index 0000000..ca068e1 Binary files /dev/null and b/res/bw.src-02.png differ diff --git a/res/crop.bw.src-02.png b/res/crop.bw.src-02.png new file mode 100644 index 0000000..561ed3d Binary files /dev/null and b/res/crop.bw.src-02.png differ diff --git a/res/src-02.png b/res/src-02.png new file mode 100644 index 0000000..5d54409 Binary files /dev/null and b/res/src-02.png differ diff --git a/res/sz.crop.bw.src-02.png b/res/sz.crop.bw.src-02.png new file mode 100644 index 0000000..c9fef4b Binary files /dev/null and b/res/sz.crop.bw.src-02.png differ diff --git a/res/tiles_0.png b/res/tiles_0.png new file mode 100644 index 0000000..bfafcea Binary files /dev/null and b/res/tiles_0.png differ diff --git a/res/tiles_01.png b/res/tiles_01.png new file mode 100644 index 0000000..d8cb34a Binary files /dev/null and b/res/tiles_01.png differ diff --git a/res/tiles_02.png b/res/tiles_02.png new file mode 100644 index 0000000..b20012d Binary files /dev/null and b/res/tiles_02.png differ diff --git a/res/tiles_1.png b/res/tiles_1.png new file mode 100644 index 0000000..c9fef4b Binary files /dev/null and b/res/tiles_1.png differ diff --git a/v5/Window.py b/v5/Window.py index e2afca2..94f3c39 100644 --- a/v5/Window.py +++ b/v5/Window.py @@ -1,28 +1,68 @@ import arcade +CELL = 25 +HEIGHT = 600 +WIDTH = 900 + class Window(arcade.Window): def __init__(self): - super().__init__(900, 600, "OGS Memory") - arcade.set_background_color(arcade.color.GRAY) + super().__init__(WIDTH, HEIGHT, "OGS Memory") + #arcade.set_background_color(arcade.color.GRAY) + arcade.set_background_color(arcade.color.WHITE) self.all_sprites = arcade.SpriteList() - # Animated begin button. - player = arcade.AnimatedTimeBasedSprite() - for i in range(2): - tex = arcade.load_texture("res/buttons_begin.png", x = i*350, y = 0, width = 350, height = 100) - player.append_texture(tex) - player.color = arcade.color.BLUE - a = arcade.sprite.AnimationKeyframe(i, 700, tex) - player.frames.append(a) - player.center_x = 300 - player.center_y = 200 +# # Animated begin button. +# player = arcade.AnimatedTimeBasedSprite() +# for i in range(2): +# tex = arcade.load_texture("res/buttons_begin.png", x = i*350, y = 0, width = 350, height = 100) +# player.append_texture(tex) +# #player.color = arcade.color.BLUE +# a = arcade.sprite.AnimationKeyframe(i, 700, tex) +# player.frames.append(a) +# player.center_x = 300 +# player.center_y = 200 +# self.all_sprites.append(player) + + positions = [ + [9, 1], + [14, 1], + [19, 1], + [24, 1], + + [9, 7], + [14, 7], + [19, 7], + [24, 7], - self.all_sprites.append(player) + [9, 13], + [14, 13], + [19, 13], + [24, 13], + + [9, 19], + [14, 19], + [19, 19], + [24, 19], + ] + + add_tiles(self.all_sprites, positions) def on_draw(self): arcade.start_render() - arcade.draw_circle_filled(400, 300, 15, arcade.color.BLUE) + #arcade.draw_circle_filled(400, 300, 15, arcade.color.BLUE) self.all_sprites.draw() def on_update(self, delta): self.all_sprites.update_animation() + +def add_tiles(sprites, positions): + for p in positions: + tile = arcade.AnimatedTimeBasedSprite() + for i in range(2): + tex = arcade.load_texture("res/tiles_0.png", x = i*75, y = 0, width = 75, height = 100) + tile.append_texture(tex) + a = arcade.sprite.AnimationKeyframe(i, 700, tex) + tile.frames.append(a) + tile.center_x = CELL * 2 + p[0] * CELL + tile.center_y = HEIGHT - CELL * 2 - p[1] * CELL + sprites.append(tile)