|
12345678910111213141516171819202122232425262728 |
- import arcade
-
- class Window(arcade.Window):
- def __init__(self):
- super().__init__(900, 600, "OGS Memory")
- arcade.set_background_color(arcade.color.GRAY)
- 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
-
- self.all_sprites.append(player)
-
- def on_draw(self):
- arcade.start_render()
- arcade.draw_circle_filled(400, 300, 15, arcade.color.BLUE)
- self.all_sprites.draw()
-
- def on_update(self, delta):
- self.all_sprites.update_animation()
|