-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpruebas.py
More file actions
68 lines (47 loc) · 1.33 KB
/
pruebas.py
File metadata and controls
68 lines (47 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Módulos
import pygame
# Constantes
WIDTH = 640
HEIGHT = 480
# Clases
# ---------------------------------------------------------------------
class Chara:
def __init__(self, x , y):
self.fil = 4
self.col = 4
self.name_chara = 4
self.chara = cut_charaset("resources/graphics/charasets/chara.png", self.fil, self.col)
self.image = self.chara[0][0]
self.x = x
self.y = y
def draw(self, screen):
screen.blit(self.image, (self.x, self.y))
# ---------------------------------------------------------------------
# Funciones
# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
def main():
screen = pygame.display.set_mode((WIDTH, HEIGHT))
tweener = pytweener.Tweener()
pygame.display.set_caption("Pruebas Pygame")
background_image = load_image('fondo.jpg');
chara = Chara(100, 100)
x= chara.x
tweener.addTween(chara, x= x+32)
clock = pygame.time.Clock()
while True:
time = clock.tick(60)
tweener.update(time / 1000.0)
salir()
screen.blit(background_image, (0, 0))
chara.draw(screen)
pygame.display.flip()
return 0
# ---------------------------------------------------------------------
def main():
pass
if __name__ == '__main__':
pygame.init()
main()