Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Eirea <geirea@gmail.com>2010-12-11 22:16:44 (GMT)
committer Gabriel Eirea <geirea@gmail.com>2010-12-11 22:16:44 (GMT)
commit5539bb744513f2b235b069eb5f9b14ab71a68c02 (patch)
treebf98fe78efb355fdd58c10121cdd11850ee7fee8
First commit
-rw-r--r--#Game.py#59
-rw-r--r--AnimatedSprite.py306
-rw-r--r--AnimatedSprite.pycbin0 -> 3385 bytes
-rw-r--r--AnimatedSprite.py~189
-rw-r--r--AnimatedSprite_0.py158
-rw-r--r--Game.py59
-rw-r--r--README1
-rw-r--r--images/boy.pngbin0 -> 8270 bytes
-rw-r--r--images/boy.svg597
-rw-r--r--images/boy2_800.pngbin0 -> 5375 bytes
-rw-r--r--images/boy_800.pngbin0 -> 5481 bytes
-rw-r--r--images/derechos-plaza-fondo.jpgbin0 -> 130921 bytes
-rw-r--r--images/derechos-plaza-laberinto.jpgbin0 -> 153480 bytes
-rw-r--r--images/derechos-tileset-elementos.pngbin0 -> 20983 bytes
-rw-r--r--images/derechos-tileset-fondos.pngbin0 -> 27325 bytes
-rw-r--r--images/main.pngbin0 -> 1696 bytes
-rw-r--r--images/main.xcfbin0 -> 7548 bytes
-rwxr-xr-ximages/xoxi-ninios-sprite-01.gifbin0 -> 16075 bytes
-rw-r--r--images/xoxi-ninios-sprite-01.pngbin0 -> 12290 bytes
-rw-r--r--images/xoxi-ninios-sprite-02.gifbin0 -> 15880 bytes
-rw-r--r--images/xoxi-ninios-sprite-03.gifbin0 -> 16049 bytes
21 files changed, 1369 insertions, 0 deletions
diff --git a/#Game.py# b/#Game.py#
new file mode 100644
index 0000000..0b2c4ea
--- /dev/null
+++ b/#Game.py#
@@ -0,0 +1,59 @@
+import pygame
+import os
+from AnimatedSprite import *
+
+class Game():
+
+ def __init__(self):
+ pygame.display.init()
+ self.screen = pygame.display.set_mode((800,600))
+ self.clock = pygame.time.Clock()
+
+ # load images
+ images_main = self.load_sprite_group(50,50,"main.png")
+ # load levels
+ # setup objects
+ self.me = AnimatedSprite(images_main,30)
+ # start
+ print("initializing...")
+
+ def load_sprite_group(self, w, h, filename):
+ '''
+ Specs :
+ Master can be any height.
+ Sprites frames width must be the same width
+ Master width must be len(frames)*frame.width
+ Assuming you ressources directory is named "ressources"
+ '''
+ images = []
+ master_image = pygame.image.load(os.path.join('images', filename)).convert_alpha()
+
+ master_width, master_height = master_image.get_size()
+ for i in xrange(int(master_width/w)):
+ images.append(master_image.subsurface((i*w,0,w,h)))
+ return images
+
+ def start (self):
+ print("starting...")
+ while True:
+ for event in pygame.event.get():
+ if event.type == pygame.QUIT:
+ return
+
+ if event.type == pygame.MOUSEBUTTONDOWN:
+ pass
+
+ self.screen.fill((0,0,0))
+ time_passed = self.clock.tick(30)
+
+ self.me.render(self.screen)
+
+ pygame.display.flip()
+
+
+def main():
+ game = Game()
+ game.start()
+
+if __name__ == "__main__":
+ main()
diff --git a/AnimatedSprite.py b/AnimatedSprite.py
new file mode 100644
index 0000000..084f03f
--- /dev/null
+++ b/AnimatedSprite.py
@@ -0,0 +1,306 @@
+import pygame
+import os
+import random
+
+LEFT = 1
+RIGHT = 2
+UP = 3
+DOWN =4
+
+class AnimatedSprite(pygame.sprite.Sprite):
+ """
+ AnimatedSprite is a custom Sprite class for animated objects
+
+ images: list with sprite images
+ sprites: list with image# for every frame
+ next_frames: list with next frame from current one
+ dxs: list with dx for current frame
+ dys: list with dy for current frame
+ xini: initial x position
+ yini: initial y position
+ fps: fps
+ """
+
+ def __init__(self, images, sprites, next_frames,
+ dxs, dys, xini, yini, fps = 10):
+ pygame.sprite.Sprite.__init__(self)
+ self._images = images
+
+ # Track the time we started, and the time between updates.
+ # Then we can figure out when we have to switch the image.
+ self._start = pygame.time.get_ticks()
+ self._delay = 1000 / fps
+ self._last_update = 0
+ self._frame = 0
+
+ self._sprites = sprites
+ self._next_frames = next_frames
+ self._dxs = dxs
+ self._dys = dys
+ self.x = xini
+ self.y = yini
+ self.move = 0
+
+ self.image = self._images[self._sprites[self._frame]]
+
+ # Call update to set our first image.
+ self.update(pygame.time.get_ticks())
+
+ def update(self, t):
+ # Note that this doesn't work if it's been more that self._delay
+ # time between calls to update(); we only update the image once
+ # then, but it really should be updated twice.
+
+# print t
+
+# if t - self._last_update > self._delay:
+# if self._frame >= 2: #len(self._images):
+# self._frame = 0
+ print self._frame
+ self.image = self._images[self._sprites[self._frame]]
+# self.x += self._dxs[self._frame]
+# if move == RIGHT:
+# self.x += 5
+# elif move == LEFT:
+# self.x -= 5
+# self.y += self._dys[self._frame]
+ self._last_update = t
+
+ def render(self, screen):
+# self.update(pygame.time.get_ticks())
+ screen.blit(self.image, (self.x, self.y))
+# pygame.draw.rect(screen,(0,0,0),(self.x+15, self.y+38, 38, 38),1)
+
+ def domove(self, grilla):
+ if self.move == RIGHT:
+ if self.x+62<1200:
+ if grilla[(self.y+78)/50][(self.x+62)/50] == 0 and \
+ grilla[(self.y+40)/50][(self.x+62)/50] == 0:
+ self.x += 8
+ self._frame = self._next_frames[self._frame]
+ else:
+ self.x += 8 - (self.x+62)%50 -1
+ else:
+ self.x = 1146
+ elif self.move == LEFT:
+ if self.x+8 > 0:
+ if grilla[(self.y+78)/50][(self.x+8)/50] == 0 and \
+ grilla[(self.y+40)/50][(self.x+8)/50] == 0:
+ self.x -= 8
+ self._frame = self._next_frames[self._frame]
+ else:
+ self.x += -8 + 50 - (self.x+8)%50 +1
+ else:
+ self.x = -16
+ elif self.move == UP:
+ if self.y+16 > 0:
+ if grilla[(self.y+34)/50][(self.x+16)/50] == 0 and \
+ grilla[(self.y+34)/50][(self.x+54)/50] == 0:
+ self.y -= 6
+ self._frame = self._next_frames[self._frame]
+ else:
+ self.y += -6 + 50 - (self.y+34)%50 +1
+ else:
+ self.y = -22
+ elif self.move == DOWN:
+ if self.y+84 < 900:
+ if grilla[(self.y+84)/50][(self.x+16)/50] == 0 and \
+ grilla[(self.y+84)/50][(self.x+54)/50] == 0:
+ self.y += 6
+ self._frame = self._next_frames[self._frame]
+ else:
+ self.y += 6 - (self.y+84)%50 -1
+ else:
+ self.y = 900-78
+
+ def ai(self, grilla):
+ if self.move == RIGHT:
+ if self.x+62<1200:
+ if grilla[(self.y+78)/50][(self.x+62)/50] == 0 and \
+ grilla[(self.y+40)/50][(self.x+62)/50] == 0:
+ self.x += 8
+ self._frame = self._next_frames[self._frame]
+ else:
+ self.x += 8 - (self.x+62)%50 -1
+ self.move = random.randint(1,4)
+ self.startupFrame()
+ else:
+ self.x = 1146
+ self.move = random.randint(1,4)
+ self.startupFrame()
+ elif self.move == LEFT:
+ if self.x+8 > 0:
+ if grilla[(self.y+78)/50][(self.x+8)/50] == 0 and \
+ grilla[(self.y+40)/50][(self.x+8)/50] == 0:
+ self.x -= 8
+ self._frame = self._next_frames[self._frame]
+ else:
+ self.x += -8 + 50 - (self.x+8)%50 +1
+ self.move = random.randint(1,4)
+ self.startupFrame()
+ else:
+ self.x = -16
+ self.move = random.randint(1,4)
+ self.startupFrame()
+ elif self.move == UP:
+ if self.y+16 > 0:
+ if grilla[(self.y+34)/50][(self.x+16)/50] == 0 and \
+ grilla[(self.y+34)/50][(self.x+54)/50] == 0:
+ self.y -= 6
+ self._frame = self._next_frames[self._frame]
+ else:
+ self.y += -6 + 50 - (self.y+34)%50 +1
+ self.move = random.randint(1,4)
+ self.startupFrame()
+ else:
+ self.y = -22
+ self.move = random.randint(1,4)
+ self.startupFrame()
+ elif self.move == DOWN:
+ if self.y+84 < 900:
+ if grilla[(self.y+84)/50][(self.x+16)/50] == 0 and \
+ grilla[(self.y+84)/50][(self.x+54)/50] == 0:
+ self.y += 6
+ self._frame = self._next_frames[self._frame]
+ else:
+ self.y += 6 - (self.y+84)%50 -1
+ self.move = random.randint(1,4)
+ self.startupFrame()
+ else:
+ self.y = 900-78
+ self.move = random.randint(1,4)
+ self.startupFrame()
+
+
+ def updateFrame(self, fr):
+ self._frame = fr
+
+ def startupFrame(self):
+ if self.move == UP:
+ self._frame = 0
+ elif self.move == DOWN:
+ self._frame = 8
+ elif self.move == LEFT:
+ self._frame = 16
+ elif self.move == RIGHT:
+ self._frame = 24
+
+
+ def updateMove(self,move):
+ self.move = move
+
+
+
+def dibujar_grilla(grilla,screen):
+ for yi in range(18):
+ for xi in range(24):
+ if grilla[yi][xi] == 1:
+ pygame.draw.rect(screen,(100,100,100),(xi*50,yi*50,50,50),2)
+
+
+
+if __name__ == "__main__":
+
+ pygame.display.init()
+ screen = pygame.display.set_mode((1200,900))
+ clock = pygame.time.Clock()
+
+ images = []
+ master_image = pygame.image.load(os.path.join('images', 'xoxi-ninios-sprite-01.png')).convert_alpha()
+ master_width, master_height = master_image.get_size()
+ w = int(master_width/4)
+ h = int(master_height/4)
+ for i in xrange(4):
+ images.append(master_image.subsurface((i*w,0,w,h)))
+ for i in xrange(4):
+ images.append(master_image.subsurface((i*w,h,w,h)))
+ for i in xrange(4):
+ images.append(master_image.subsurface((i*w,2*h,w,h)))
+ for i in xrange(4):
+ images.append(master_image.subsurface((i*w,3*h,w,h)))
+
+ bg_image = pygame.image.load(os.path.join('images', 'derechos-plaza-fondo.jpg')).convert_alpha()
+
+ sps = [0, 1, 0, 2, 0, 1, 0, 3, 4, 5, 4, 6, 4, 5, 4, 7, 8, 9, 8, 10,
+ 8, 9, 8, 11, 15, 13, 15, 14, 15, 13, 15, 12]
+ nf = [1, 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, 14, 15, 8, 17, 18, 19,
+ 20, 21, 22, 23, 16, 25, 26, 27, 28, 29, 30, 31, 24]
+ dxs = [5, 5, 5, 5, 5, -5, -5, -5, -5, -5]
+ dys = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+
+ sp = AnimatedSprite(images, sps, nf, dxs, dys, 50, 400, 10)
+ sp2 = AnimatedSprite(images, sps, nf, dxs, dys, 50, 400, 10)
+
+ grilla = [[0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],
+ [0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0],
+ [0,0,1,1,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,0,0],
+ [0,0,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1],
+ [0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1],
+ [0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,1,0,0,1,1],
+ [1,1,1,1,1,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1],
+ [0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1],
+ [0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
+ [0,0,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
+ [0,0,1,0,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,0,0,0],
+ [0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,0,0],
+ [0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,0,0],
+ [0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1],
+ [1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1],
+ [1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
+ [1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1],
+ [1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1]]
+
+
+ playing = True
+
+ sp.updateMove(0)
+ sp2.updateMove(random.randint(1,4))
+
+ while playing:
+ for event in pygame.event.get():
+ if event.type == pygame.QUIT:
+ playing = False
+ elif event.type == pygame.MOUSEBUTTONDOWN:
+ pass
+ elif event.type == pygame.KEYDOWN:
+ if event.key == pygame.K_UP:
+ sp.updateMove(UP)
+ sp.updateFrame(0)
+ if event.key == pygame.K_DOWN:
+ sp.updateMove(DOWN)
+ sp.updateFrame(8)
+ if event.key == pygame.K_LEFT:
+ sp.updateMove(LEFT)
+ sp.updateFrame(16)
+ if event.key == pygame.K_RIGHT:
+ sp.updateMove(RIGHT)
+ sp.updateFrame(24)
+ elif event.type == pygame.KEYUP:
+ if event.key == pygame.K_UP:
+ sp.updateMove(0)
+ sp.updateFrame(0)
+ if event.key == pygame.K_DOWN:
+ sp.updateMove(0)
+ sp.updateFrame(8)
+ if event.key == pygame.K_LEFT:
+ sp.updateMove(0)
+ sp.updateFrame(16)
+ if event.key == pygame.K_RIGHT:
+ sp.updateMove(0)
+ sp.updateFrame(24)
+
+ sp.domove(grilla)
+ sp2.ai(grilla)
+
+ screen.blit(bg_image, (0, 0))
+
+# dibujar_grilla(grilla,screen)
+
+ time_passed = clock.tick(20)
+ sp.update(time_passed)
+ sp2.update(time_passed)
+ sp.render(screen)
+ sp2.render(screen)
+
+ pygame.display.flip()
+
diff --git a/AnimatedSprite.pyc b/AnimatedSprite.pyc
new file mode 100644
index 0000000..30a0149
--- /dev/null
+++ b/AnimatedSprite.pyc
Binary files differ
diff --git a/AnimatedSprite.py~ b/AnimatedSprite.py~
new file mode 100644
index 0000000..968124d
--- /dev/null
+++ b/AnimatedSprite.py~
@@ -0,0 +1,189 @@
+import pygame
+import os
+
+LEFT = 1
+RIGHT = 2
+UP = 3
+DOWN =4
+
+class AnimatedSprite(pygame.sprite.Sprite):
+ """
+ AnimatedSprite is a custom Sprite class for animated objects
+
+ images: list with sprite images
+ sprites: list with image# for every frame
+ next_frames: list with next frame from current one
+ dxs: list with dx for current frame
+ dys: list with dy for current frame
+ xini: initial x position
+ yini: initial y position
+ fps: fps
+ """
+
+ def __init__(self, images, sprites, next_frames,
+ dxs, dys, xini, yini, fps = 10):
+ pygame.sprite.Sprite.__init__(self)
+ self._images = images
+
+ # Track the time we started, and the time between updates.
+ # Then we can figure out when we have to switch the image.
+ self._start = pygame.time.get_ticks()
+ self._delay = 1000 / fps
+ self._last_update = 0
+ self._frame = 0
+
+ self._sprites = sprites
+ self._next_frames = next_frames
+ self._dxs = dxs
+ self._dys = dys
+ self.x = xini
+ self.y = yini
+
+ self.image = self._images[self._sprites[self._frame]]
+
+ # Call update to set our first image.
+ self.update(pygame.time.get_ticks())
+
+ def update(self, t):
+ # Note that this doesn't work if it's been more that self._delay
+ # time between calls to update(); we only update the image once
+ # then, but it really should be updated twice.
+
+# print t
+
+# if t - self._last_update > self._delay:
+# if self._frame >= 2: #len(self._images):
+# self._frame = 0
+ print self._frame
+ self.image = self._images[self._sprites[self._frame]]
+# self.x += self._dxs[self._frame]
+# if move == RIGHT:
+# self.x += 5
+# elif move == LEFT:
+# self.x -= 5
+# self.y += self._dys[self._frame]
+ self._last_update = t
+
+ def render(self, screen):
+# self.update(pygame.time.get_ticks())
+ screen.blit(self.image, (self.x, self.y))
+
+ def move(self, move, grilla):
+ print "%d , %d" % (self.y/50,self.x/50)
+ if move == RIGHT:
+ if grilla[(self.y+50)/50][(self.x+70)/50] == 0: # arreglar
+ self.x += 8
+ self._frame = self._next_frames[self._frame]
+ elif move == LEFT:
+ if grilla[(self.y+50)/50][(self.x-20)/50] == 0: # arreglar
+ self.x -= 8
+ self._frame = self._next_frames[self._frame]
+ elif move == UP:
+ if grilla[(self.y)/50][(self.x+50)/50] == 0: # arreglar
+ self.y -= 6
+ self._frame = self._next_frames[self._frame]
+ elif move == DOWN:
+ if grilla[(self.y+80)/50][(self.x+50)/50] == 0: # arreglar
+ self.y += 6
+ self._frame = self._next_frames[self._frame]
+
+ def updateFrame(self, sprite):
+ self._frame = sprite
+
+if __name__ == "__main__":
+
+ pygame.display.init()
+ screen = pygame.display.set_mode((1200,900))
+ clock = pygame.time.Clock()
+
+ images = []
+ master_image = pygame.image.load(os.path.join('images', 'xoxi-ninios-sprite-01.png')).convert_alpha()
+ master_width, master_height = master_image.get_size()
+ w = int(master_width/4)
+ h = int(master_height/4)
+ for i in xrange(4):
+ images.append(master_image.subsurface((i*w,0,w,h)))
+ for i in xrange(4):
+ images.append(master_image.subsurface((i*w,h,w,h)))
+ for i in xrange(4):
+ images.append(master_image.subsurface((i*w,2*h,w,h)))
+ for i in xrange(4):
+ images.append(master_image.subsurface((i*w,3*h,w,h)))
+
+ bg_image = pygame.image.load(os.path.join('images', 'derechos-plaza-fondo.jpg')).convert_alpha()
+
+ sps = [0, 1, 0, 2, 0, 1, 0, 3, 4, 5, 4, 6, 4, 5, 4, 7, 8, 9, 8, 10,
+ 8, 9, 8, 11, 15, 13, 15, 14, 15, 13, 15, 12]
+ nf = [1, 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, 14, 15, 8, 17, 18, 19,
+ 20, 21, 22, 23, 16, 25, 26, 27, 28, 29, 30, 31, 24]
+ dxs = [5, 5, 5, 5, 5, -5, -5, -5, -5, -5]
+ dys = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+
+ sp = AnimatedSprite(images, sps, nf, dxs, dys, 50, 400, 10)
+
+ grilla = [[0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1],
+ [0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0],
+ [0,0,1,1,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,0,0],
+ [0,0,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1],
+ [0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,1,0,0,1,1],
+ [1,1,1,1,1,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1],
+ [0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1],
+ [0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1],# aca mal
+ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1],
+ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1],
+ [0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1],
+ [0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1],
+ [0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1],
+ [0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1],
+ [0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1],
+ [0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1],
+ [0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1],
+ [0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,0,0,1,1]]
+
+ playing = True
+
+ move = 0
+
+ while playing:
+# clock.tick(30)
+ for event in pygame.event.get():
+ if event.type == pygame.QUIT:
+ playing = False
+ elif event.type == pygame.MOUSEBUTTONDOWN:
+ pass
+ elif event.type == pygame.KEYDOWN:
+ if event.key == pygame.K_UP:
+ move = UP
+ sp.updateFrame(0)
+ if event.key == pygame.K_DOWN:
+ move = DOWN
+ sp.updateFrame(8)
+ if event.key == pygame.K_LEFT:
+ move = LEFT
+ sp.updateFrame(16)
+ if event.key == pygame.K_RIGHT:
+ move = RIGHT
+ sp.updateFrame(24)
+ elif event.type == pygame.KEYUP:
+ if event.key == pygame.K_UP:
+ move = 0
+ sp.updateFrame(0)
+ if event.key == pygame.K_DOWN:
+ move = 0
+ sp.updateFrame(8)
+ if event.key == pygame.K_LEFT:
+ move = 0
+ sp.updateFrame(16)
+ if event.key == pygame.K_RIGHT:
+ move = 0
+ sp.updateFrame(24)
+
+ sp.move(move, grilla)
+
+# screen.fill((100,100,100))
+ screen.blit(bg_image, (0, 0))
+ time_passed = clock.tick(15)
+ sp.update(time_passed)
+ sp.render(screen)
+
+ pygame.display.flip()
diff --git a/AnimatedSprite_0.py b/AnimatedSprite_0.py
new file mode 100644
index 0000000..bfe4e59
--- /dev/null
+++ b/AnimatedSprite_0.py
@@ -0,0 +1,158 @@
+import pygame
+import os
+
+LEFT = 1
+RIGHT = 2
+UP = 3
+DOWN =4
+
+class AnimatedSprite(pygame.sprite.Sprite):
+ """
+ AnimatedSprite is a custom Sprite class for animated objects
+
+ images: list with sprite images
+ sprites: list with image# for every frame
+ next_frames: list with next frame from current one
+ dxs: list with dx for current frame
+ dys: list with dy for current frame
+ xini: initial x position
+ yini: initial y position
+ fps: fps
+ """
+
+ def __init__(self, images, sprites, next_frames,
+ dxs, dys, xini, yini, fps = 10):
+ pygame.sprite.Sprite.__init__(self)
+ self._images = images
+
+ # Track the time we started, and the time between updates.
+ # Then we can figure out when we have to switch the image.
+ self._start = pygame.time.get_ticks()
+ self._delay = 1000 / fps
+ self._last_update = 0
+ self._frame = 0
+
+ self._sprites = sprites
+ self._next_frames = next_frames
+ self._dxs = dxs
+ self._dys = dys
+ self.x = xini
+ self.y = yini
+
+ self.image = self._images[self._sprites[self._frame]]
+
+ # Call update to set our first image.
+ self.update(pygame.time.get_ticks())
+
+ def update(self, t):
+ # Note that this doesn't work if it's been more that self._delay
+ # time between calls to update(); we only update the image once
+ # then, but it really should be updated twice.
+
+# print t
+
+# if t - self._last_update > self._delay:
+# if self._frame >= 2: #len(self._images):
+# self._frame = 0
+ self.image = self._images[self._sprites[self._frame]]
+# self.x += self._dxs[self._frame]
+# if move == RIGHT:
+# self.x += 5
+# elif move == LEFT:
+# self.x -= 5
+# self.y += self._dys[self._frame]
+ self._last_update = t
+
+ def render(self, screen):
+# self.update(pygame.time.get_ticks())
+ screen.blit(self.image, (self.x, self.y))
+
+ def move(self, move):
+ if move == RIGHT:
+ self.x += 5
+ self._frame = self._next_frames[self._frame]
+ elif move == LEFT:
+ self.x -= 5
+ self._frame = self._next_frames[self._frame]
+ elif move == UP:
+ self.y -= 5
+ self._frame = self._next_frames[self._frame]
+ elif move == DOWN:
+ self.y += 5
+ self._frame = self._next_frames[self._frame]
+
+
+
+ def updateFrame(self, sprite):
+ self._frame = sprite
+
+if __name__ == "__main__":
+
+ pygame.display.init()
+ screen = pygame.display.set_mode((800,600))
+ clock = pygame.time.Clock()
+
+ images = []
+ master_image = pygame.image.load(os.path.join('images', 'xoxi-ninios-sprite-01_800.png')).convert_alpha()
+ master_width, master_height = master_image.get_size()
+ w = int(master_width/4)
+ h = int(master_height/4)
+ for i in xrange(4):
+ images.append(master_image.subsurface((i*w,0,w,h)))
+ for i in xrange(4):
+ images.append(master_image.subsurface((i*w,h,w,h)))
+ for i in xrange(4):
+ images.append(master_image.subsurface((i*w,2*h,w,h)))
+ for i in xrange(4):
+ images.append(master_image.subsurface((i*w,3*h,w,h)))
+
+ sps = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ nf = [1, 2, 3, 0, 5, 6, 7, 4, 9, 10, 11, 8, 13, 14, 15, 12]
+ dxs = [5, 5, 5, 5, 5, -5, -5, -5, -5, -5]
+ dys = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+
+ sp = AnimatedSprite(images, sps, nf, dxs, dys, 50, 400, 10)
+
+ playing = True
+
+ move = 0
+
+ while playing:
+ clock.tick(30)
+ for event in pygame.event.get():
+ if event.type == pygame.QUIT:
+ playing = False
+ elif event.type == pygame.MOUSEBUTTONDOWN:
+ pass
+ elif event.type == pygame.KEYDOWN:
+ if event.key == pygame.K_UP:
+ move = UP
+ sp.updateFrame(0)
+ if event.key == pygame.K_DOWN:
+ move = DOWN
+ sp.updateFrame(4)
+ if event.key == pygame.K_LEFT:
+ move = LEFT
+ sp.updateFrame(8)
+ if event.key == pygame.K_RIGHT:
+ move = RIGHT
+ sp.updateFrame(15)
+ elif event.type == pygame.KEYUP:
+ if event.key == pygame.K_UP:
+ move = 0
+ if event.key == pygame.K_DOWN:
+ move = 0
+ if event.key == pygame.K_LEFT:
+ move = 0
+ if event.key == pygame.K_RIGHT:
+ move = 0
+
+ sp.move(move)
+
+ screen.fill((100,100,100))
+ time_passed = clock.tick(30)
+ print move
+ sp.update(time_passed)
+ sp.render(screen)
+
+ pygame.display.flip()
diff --git a/Game.py b/Game.py
new file mode 100644
index 0000000..63542d5
--- /dev/null
+++ b/Game.py
@@ -0,0 +1,59 @@
+import pygame
+import os
+from AnimatedSprite import *
+
+class Game():
+
+ def __init__(self):
+ pygame.display.init()
+ self.screen = pygame.display.set_mode((1200,900))
+ self.clock = pygame.time.Clock()
+
+ # load images
+ images_main = self.load_sprite_group(50,50,"main.png")
+ # load levels
+ # setup objects
+ self.me = AnimatedSprite(images_main,30)
+ # start
+ print("initializing...")
+
+ def load_sprite_group(self, w, h, filename):
+ '''
+ Specs :
+ Master can be any height.
+ Sprites frames width must be the same width
+ Master width must be len(frames)*frame.width
+ Assuming you ressources directory is named "ressources"
+ '''
+ images = []
+ master_image = pygame.image.load(os.path.join('images', filename)).convert_alpha()
+
+ master_width, master_height = master_image.get_size()
+ for i in xrange(int(master_width/w)):
+ images.append(master_image.subsurface((i*w,0,w,h)))
+ return images
+
+ def start (self):
+ print("starting...")
+ while True:
+ for event in pygame.event.get():
+ if event.type == pygame.QUIT:
+ return
+
+ if event.type == pygame.MOUSEBUTTONDOWN:
+ pass
+
+ self.screen.fill((0,0,0))
+ time_passed = self.clock.tick(30)
+
+ self.me.render(self.screen)
+
+ pygame.display.flip()
+
+
+def main():
+ game = Game()
+ game.start()
+
+if __name__ == "__main__":
+ main()
diff --git a/README b/README
new file mode 100644
index 0000000..9f8cc00
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+Main file so far: AnimatedSprite.py
diff --git a/images/boy.png b/images/boy.png
new file mode 100644
index 0000000..0565169
--- /dev/null
+++ b/images/boy.png
Binary files differ
diff --git a/images/boy.svg b/images/boy.svg
new file mode 100644
index 0000000..c549e9d
--- /dev/null
+++ b/images/boy.svg
@@ -0,0 +1,597 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="210mm"
+ height="297mm"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="Nuevo documento 1">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective2838"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective2866"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective2890"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3812"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3854"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3997"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4019"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.8"
+ inkscape:cx="213.32286"
+ inkscape:cy="925.73199"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer2"
+ showgrid="false"
+ showguides="false"
+ inkscape:window-width="1278"
+ inkscape:window-height="780"
+ inkscape:window-x="0"
+ inkscape:window-y="18"
+ inkscape:window-maximized="0" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Capa 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ style="display:inline">
+ <path
+ transform="matrix(0.26851851,0,0,0.26923075,228.2599,102.79288)"
+ sodipodi:type="arc"
+ style="fill:#e58800;fill-opacity:1;display:inline"
+ id="path3981-4"
+ sodipodi:cx="132.83505"
+ sodipodi:cy="105.84925"
+ sodipodi:rx="13.637059"
+ sodipodi:ry="13.131983"
+ d="m 146.47211,105.84925 a 13.637059,13.131983 0 1 1 -27.27412,0 13.637059,13.131983 0 1 1 27.27412,0 z"
+ inkscape:transform-center-x="-18.214286" />
+ <path
+ transform="matrix(0.26851851,0,0,0.26923075,182.54561,100.65002)"
+ sodipodi:type="arc"
+ style="fill:#e58800;fill-opacity:1;display:inline"
+ id="path3937-4"
+ sodipodi:cx="132.83505"
+ sodipodi:cy="105.84925"
+ sodipodi:rx="13.637059"
+ sodipodi:ry="13.131983"
+ d="m 146.47211,105.84925 a 13.637059,13.131983 0 1 1 -27.27412,0 13.637059,13.131983 0 1 1 27.27412,0 z" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#e58800;fill-opacity:1"
+ id="path2820"
+ sodipodi:cx="132.83505"
+ sodipodi:cy="105.84925"
+ sodipodi:rx="13.637059"
+ sodipodi:ry="13.131983"
+ d="m 146.47211,105.84925 a 13.637059,13.131983 0 1 1 -27.27412,0 13.637059,13.131983 0 1 1 27.27412,0 z" />
+ <rect
+ style="fill:#aa0000;fill-opacity:1"
+ id="rect2822"
+ width="25.253813"
+ height="18.182747"
+ x="120.20815"
+ y="117.97108" />
+ <rect
+ style="fill:#000080;fill-opacity:1"
+ id="rect2824"
+ width="25.253813"
+ height="11.111678"
+ x="120.20815"
+ y="136.19443" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1"
+ id="path2828"
+ sodipodi:cx="133.21428"
+ sodipodi:cy="105.21932"
+ sodipodi:rx="2.1428571"
+ sodipodi:ry="1.0714285"
+ d="m 135.35714,105.21932 a 2.1428571,1.0714285 0 1 1 -4.28572,0 2.1428571,1.0714285 0 1 1 4.28572,0 z" />
+ <path
+ transform="translate(10.462636,0.12515172)"
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1"
+ id="path2828-2"
+ sodipodi:cx="133.21428"
+ sodipodi:cy="105.21932"
+ sodipodi:rx="2.1428571"
+ sodipodi:ry="1.0714285"
+ d="m 135.35714,105.21932 a 2.1428571,1.0714285 0 1 1 -4.28572,0 2.1428571,1.0714285 0 1 1 4.28572,0 z" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 140.15867,106.35432 2.0203,2.27285 -2.27284,1.01015"
+ id="path2854" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 134.60283,112.41524 5.3033,2.02031 3.28299,-1.76777"
+ id="path2856"
+ sodipodi:nodetypes="ccc" />
+ <path
+ transform="matrix(0.26851851,0,0,0.26923075,89.316043,105.7582)"
+ sodipodi:type="arc"
+ style="fill:#e58800;fill-opacity:1"
+ id="path2820-5"
+ sodipodi:cx="132.83505"
+ sodipodi:cy="105.84925"
+ sodipodi:rx="13.637059"
+ sodipodi:ry="13.131983"
+ d="m 146.47211,105.84925 a 13.637059,13.131983 0 1 1 -27.27412,0 13.637059,13.131983 0 1 1 27.27412,0 z" />
+ <rect
+ style="fill:#000000;fill-opacity:1"
+ id="rect2880"
+ width="18.687822"
+ height="2.7779195"
+ x="120.20815"
+ y="147.01297" />
+ <rect
+ style="fill:#000000;fill-opacity:1"
+ id="rect2880-4"
+ width="18.687822"
+ height="2.7779195"
+ x="130.81476"
+ y="147.13922" />
+ <path
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.0226016px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 145.92031,98.782877 -16.3896,-0.252284 -4.75828,4.793407 -2.11478,11.35278 -2.90784,-0.25229 -0.79305,-18.921308 3.70089,-3.279694 20.35482,0.252284 3.70089,2.522842 -0.79305,3.784263 z"
+ id="path2904" />
+ <path
+ d="m 146.47211,105.84925 a 13.637059,13.131983 0 1 1 -27.27412,0 13.637059,13.131983 0 1 1 27.27412,0 z"
+ sodipodi:ry="13.131983"
+ sodipodi:rx="13.637059"
+ sodipodi:cy="105.84925"
+ sodipodi:cx="132.83505"
+ id="path3901"
+ style="fill:#e58800;fill-opacity:1"
+ sodipodi:type="arc"
+ transform="translate(36,0)" />
+ <rect
+ y="117.97108"
+ x="156.20816"
+ height="18.182747"
+ width="25.253813"
+ id="rect3903"
+ style="fill:#aa0000;fill-opacity:1" />
+ <rect
+ y="136.19443"
+ x="160.13673"
+ height="11.111678"
+ width="19.539526"
+ id="rect3905"
+ style="fill:#000080;fill-opacity:1" />
+ <path
+ d="m 135.35714,105.21932 a 2.1428571,1.0714285 0 1 1 -4.28572,0 2.1428571,1.0714285 0 1 1 4.28572,0 z"
+ sodipodi:ry="1.0714285"
+ sodipodi:rx="2.1428571"
+ sodipodi:cy="105.21932"
+ sodipodi:cx="133.21428"
+ id="path3907"
+ style="fill:#000000;fill-opacity:1"
+ sodipodi:type="arc"
+ transform="translate(36,0)" />
+ <path
+ d="m 135.35714,105.21932 a 2.1428571,1.0714285 0 1 1 -4.28572,0 2.1428571,1.0714285 0 1 1 4.28572,0 z"
+ sodipodi:ry="1.0714285"
+ sodipodi:rx="2.1428571"
+ sodipodi:cy="105.21932"
+ sodipodi:cx="133.21428"
+ id="path3909"
+ style="fill:#000000;fill-opacity:1"
+ sodipodi:type="arc"
+ transform="translate(46.462636,0.12515172)" />
+ <path
+ id="path3911"
+ d="m 176.15867,106.35432 2.0203,2.27285 -2.27284,1.01015"
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="ccc"
+ id="path3913"
+ d="m 170.60283,112.41524 5.3033,2.02031 3.28299,-1.76777"
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ d="m 146.47211,105.84925 a 13.637059,13.131983 0 1 1 -27.27412,0 13.637059,13.131983 0 1 1 27.27412,0 z"
+ sodipodi:ry="13.131983"
+ sodipodi:rx="13.637059"
+ sodipodi:cy="105.84925"
+ sodipodi:cx="132.83505"
+ id="path3915"
+ style="fill:#e58800;fill-opacity:1"
+ sodipodi:type="arc"
+ transform="matrix(0.26851851,0,0,0.26923075,120.9589,103.61534)" />
+ <rect
+ y="173.44975"
+ x="132.56345"
+ height="2.7779195"
+ width="18.687822"
+ id="rect3917"
+ style="fill:#000000;fill-opacity:1"
+ transform="matrix(0.98385192,-0.17898434,0.17898434,0.98385192,0,0)" />
+ <rect
+ y="147.13922"
+ x="160.81476"
+ height="2.7779195"
+ width="18.687822"
+ id="rect3919"
+ style="fill:#000000;fill-opacity:1" />
+ <path
+ id="path3921"
+ d="m 181.92031,98.782877 -16.3896,-0.252284 -4.75828,4.793407 -2.11478,11.35278 -2.90784,-0.25229 -0.79305,-18.921308 3.70089,-3.279694 20.35482,0.252284 3.70089,2.522842 -0.79305,3.784263 z"
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.0226016px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ transform="translate(72,0)"
+ sodipodi:type="arc"
+ style="fill:#e58800;fill-opacity:1"
+ id="path3923"
+ sodipodi:cx="132.83505"
+ sodipodi:cy="105.84925"
+ sodipodi:rx="13.637059"
+ sodipodi:ry="13.131983"
+ d="m 146.47211,105.84925 a 13.637059,13.131983 0 1 1 -27.27412,0 13.637059,13.131983 0 1 1 27.27412,0 z" />
+ <rect
+ style="fill:#aa0000;fill-opacity:1"
+ id="rect3925"
+ width="25.253813"
+ height="18.182747"
+ x="192.20816"
+ y="117.97108" />
+ <rect
+ style="fill:#000080;fill-opacity:1"
+ id="rect3927"
+ width="25.9681"
+ height="11.111678"
+ x="193.27959"
+ y="136.19443" />
+ <path
+ transform="translate(72,0)"
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1"
+ id="path3929"
+ sodipodi:cx="133.21428"
+ sodipodi:cy="105.21932"
+ sodipodi:rx="2.1428571"
+ sodipodi:ry="1.0714285"
+ d="m 135.35714,105.21932 a 2.1428571,1.0714285 0 1 1 -4.28572,0 2.1428571,1.0714285 0 1 1 4.28572,0 z" />
+ <path
+ transform="translate(82.462636,0.12515172)"
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1"
+ id="path3931"
+ sodipodi:cx="133.21428"
+ sodipodi:cy="105.21932"
+ sodipodi:rx="2.1428571"
+ sodipodi:ry="1.0714285"
+ d="m 135.35714,105.21932 a 2.1428571,1.0714285 0 1 1 -4.28572,0 2.1428571,1.0714285 0 1 1 4.28572,0 z" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 212.15867,106.35432 2.0203,2.27285 -2.27284,1.01015"
+ id="path3933" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 206.60283,112.41524 5.3033,2.02031 3.28299,-1.76777"
+ id="path3935"
+ sodipodi:nodetypes="ccc" />
+ <path
+ transform="matrix(0.26851851,0,0,0.26923075,154.17319,98.258197)"
+ sodipodi:type="arc"
+ style="fill:#e58800;fill-opacity:1"
+ id="path3937"
+ sodipodi:cx="132.83505"
+ sodipodi:cy="105.84925"
+ sodipodi:rx="13.637059"
+ sodipodi:ry="13.131983"
+ d="m 146.47211,105.84925 a 13.637059,13.131983 0 1 1 -27.27412,0 13.637059,13.131983 0 1 1 27.27412,0 z" />
+ <rect
+ style="fill:#000000;fill-opacity:1"
+ id="rect3939"
+ width="18.687822"
+ height="2.7779195"
+ x="132.55418"
+ y="217.33275"
+ transform="matrix(0.91923063,-0.3937195,0.3937195,0.91923063,0,0)" />
+ <rect
+ style="fill:#000000;fill-opacity:1"
+ id="rect3941"
+ width="18.687822"
+ height="2.7779195"
+ x="194.81476"
+ y="147.13922" />
+ <path
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.0226016px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 217.92031,98.782877 -16.3896,-0.252284 -4.75828,4.793407 -2.11478,11.35278 -2.90784,-0.25229 -0.79305,-18.921308 3.70089,-3.279694 20.35482,0.252284 3.70089,2.522842 -0.79305,3.784263 z"
+ id="path3943" />
+ <path
+ d="m 146.47211,105.84925 a 13.637059,13.131983 0 1 1 -27.27412,0 13.637059,13.131983 0 1 1 27.27412,0 z"
+ sodipodi:ry="13.131983"
+ sodipodi:rx="13.637059"
+ sodipodi:cy="105.84925"
+ sodipodi:cx="132.83505"
+ id="path3945"
+ style="fill:#e58800;fill-opacity:1"
+ sodipodi:type="arc"
+ transform="translate(108,0)" />
+ <rect
+ y="117.97108"
+ x="228.20816"
+ height="18.182747"
+ width="25.253813"
+ id="rect3947"
+ style="fill:#aa0000;fill-opacity:1" />
+ <rect
+ y="136.19443"
+ x="228.20816"
+ height="11.111678"
+ width="25.253813"
+ id="rect3949"
+ style="fill:#000080;fill-opacity:1" />
+ <path
+ d="m 135.35714,105.21932 a 2.1428571,1.0714285 0 1 1 -4.28572,0 2.1428571,1.0714285 0 1 1 4.28572,0 z"
+ sodipodi:ry="1.0714285"
+ sodipodi:rx="2.1428571"
+ sodipodi:cy="105.21932"
+ sodipodi:cx="133.21428"
+ id="path3951"
+ style="fill:#000000;fill-opacity:1"
+ sodipodi:type="arc"
+ transform="translate(108,0)" />
+ <path
+ d="m 135.35714,105.21932 a 2.1428571,1.0714285 0 1 1 -4.28572,0 2.1428571,1.0714285 0 1 1 4.28572,0 z"
+ sodipodi:ry="1.0714285"
+ sodipodi:rx="2.1428571"
+ sodipodi:cy="105.21932"
+ sodipodi:cx="133.21428"
+ id="path3953"
+ style="fill:#000000;fill-opacity:1"
+ sodipodi:type="arc"
+ transform="translate(118.46264,0.12515172)" />
+ <path
+ id="path3955"
+ d="m 248.15867,106.35432 2.0203,2.27285 -2.27284,1.01015"
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="ccc"
+ id="path3957"
+ d="m 242.60283,112.41524 5.3033,2.02031 3.28299,-1.76777"
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ d="m 146.47211,105.84925 a 13.637059,13.131983 0 1 1 -27.27412,0 13.637059,13.131983 0 1 1 27.27412,0 z"
+ sodipodi:ry="13.131983"
+ sodipodi:rx="13.637059"
+ sodipodi:cy="105.84925"
+ sodipodi:cx="132.83505"
+ id="path3959"
+ style="fill:#e58800;fill-opacity:1"
+ sodipodi:type="arc"
+ transform="matrix(0.26851851,0,0,0.26923075,207.67319,105.7582)" />
+ <rect
+ y="147.01297"
+ x="226.20816"
+ height="2.7779195"
+ width="18.687822"
+ id="rect3961"
+ style="fill:#000000;fill-opacity:1" />
+ <rect
+ y="172.81512"
+ x="220.37953"
+ height="2.7779195"
+ width="18.687822"
+ id="rect3963"
+ style="fill:#000000;fill-opacity:1"
+ transform="matrix(0.99396683,-0.1096811,0.1096811,0.99396683,0,0)" />
+ <path
+ id="path3965"
+ d="m 253.92031,98.782877 -16.3896,-0.252284 -4.75828,4.793407 -2.11478,11.35278 -2.90784,-0.25229 -0.79305,-18.921308 3.70089,-3.279694 20.35482,0.252284 3.70089,2.522842 -0.79305,3.784263 z"
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.0226016px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ transform="translate(144,0)"
+ sodipodi:type="arc"
+ style="fill:#e58800;fill-opacity:1"
+ id="path3967"
+ sodipodi:cx="132.83505"
+ sodipodi:cy="105.84925"
+ sodipodi:rx="13.637059"
+ sodipodi:ry="13.131983"
+ d="m 146.47211,105.84925 a 13.637059,13.131983 0 1 1 -27.27412,0 13.637059,13.131983 0 1 1 27.27412,0 z" />
+ <rect
+ style="fill:#aa0000;fill-opacity:1"
+ id="rect3969"
+ width="25.253813"
+ height="18.182747"
+ x="264.20816"
+ y="117.97108" />
+ <rect
+ style="fill:#000080;fill-opacity:1"
+ id="rect3971"
+ width="25.253813"
+ height="11.111678"
+ x="264.20816"
+ y="136.19443" />
+ <path
+ transform="translate(144,0)"
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1"
+ id="path3973"
+ sodipodi:cx="133.21428"
+ sodipodi:cy="105.21932"
+ sodipodi:rx="2.1428571"
+ sodipodi:ry="1.0714285"
+ d="m 135.35714,105.21932 a 2.1428571,1.0714285 0 1 1 -4.28572,0 2.1428571,1.0714285 0 1 1 4.28572,0 z" />
+ <path
+ transform="translate(154.46264,0.12515172)"
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1"
+ id="path3975"
+ sodipodi:cx="133.21428"
+ sodipodi:cy="105.21932"
+ sodipodi:rx="2.1428571"
+ sodipodi:ry="1.0714285"
+ d="m 135.35714,105.21932 a 2.1428571,1.0714285 0 1 1 -4.28572,0 2.1428571,1.0714285 0 1 1 4.28572,0 z" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 284.15867,106.35432 2.0203,2.27285 -2.27284,1.01015"
+ id="path3977" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 278.60283,112.41524 5.3033,2.02031 3.28299,-1.76777"
+ id="path3979"
+ sodipodi:nodetypes="ccc" />
+ <path
+ transform="matrix(0.26851851,0,0,0.26923075,253.67319,103.2582)"
+ sodipodi:type="arc"
+ style="fill:#e58800;fill-opacity:1"
+ id="path3981"
+ sodipodi:cx="132.83505"
+ sodipodi:cy="105.84925"
+ sodipodi:rx="13.637059"
+ sodipodi:ry="13.131983"
+ d="m 146.47211,105.84925 a 13.637059,13.131983 0 1 1 -27.27412,0 13.637059,13.131983 0 1 1 27.27412,0 z" />
+ <rect
+ style="fill:#000000;fill-opacity:1"
+ id="rect3983"
+ width="18.687822"
+ height="2.7779195"
+ x="289.51562"
+ y="71.868515"
+ transform="matrix(0.96700846,0.25474427,-0.25474427,0.96700846,0,0)" />
+ <rect
+ style="fill:#000000;fill-opacity:1"
+ id="rect3985"
+ width="18.687822"
+ height="2.7779195"
+ x="240.40225"
+ y="200.4037"
+ transform="matrix(0.97907185,-0.20351488,0.20351488,0.97907185,0,0)" />
+ <path
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.0226016px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 289.92031,98.782877 -16.3896,-0.252284 -4.75828,4.793407 -2.11478,11.35278 -2.90784,-0.25229 -0.79305,-18.921308 3.70089,-3.279694 20.35482,0.252284 3.70089,2.522842 -0.79305,3.784263 z"
+ id="path3987" />
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer2"
+ inkscape:label="lineasguia"
+ style="display:inline">
+ <path
+ style="fill:#333333;stroke:#747474;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 99.21571,91.451618 257.85715,0 0,0"
+ id="path3802" />
+ <path
+ style="fill:#333333;stroke:#747474;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 101.00142,149.6659 257.85716,0 0,0"
+ id="path3802-7" />
+ <path
+ style="fill:none;stroke:#707070;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 118.14428,88.951618 0,63.214282"
+ id="path3826" />
+ <path
+ id="path3828"
+ d="m 148.14428,88.951618 0,63.214282"
+ style="fill:none;stroke:#707070;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="path3830"
+ d="m 154.14428,88.951618 0,63.214282"
+ style="fill:none;stroke:#707070;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ style="fill:none;stroke:#707070;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 184.14428,88.951618 0,63.214282"
+ id="path3832" />
+ <path
+ style="fill:none;stroke:#707070;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 190.14428,88.951618 0,63.214282"
+ id="path3834" />
+ <path
+ id="path3836"
+ d="m 220.14428,88.951618 0,63.214282"
+ style="fill:none;stroke:#707070;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="path3838"
+ d="m 226.14428,88.951618 0,63.214282"
+ style="fill:none;stroke:#707070;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ style="fill:none;stroke:#707070;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 256.14428,88.951618 0,63.214282"
+ id="path3840" />
+ <path
+ style="fill:none;stroke:#707070;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 262.14428,88.951618 0,63.214282"
+ id="path3842" />
+ <path
+ id="path3844"
+ d="m 292.14428,88.951618 0,63.214282"
+ style="fill:none;stroke:#707070;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+</svg>
diff --git a/images/boy2_800.png b/images/boy2_800.png
new file mode 100644
index 0000000..a40604e
--- /dev/null
+++ b/images/boy2_800.png
Binary files differ
diff --git a/images/boy_800.png b/images/boy_800.png
new file mode 100644
index 0000000..116e3b6
--- /dev/null
+++ b/images/boy_800.png
Binary files differ
diff --git a/images/derechos-plaza-fondo.jpg b/images/derechos-plaza-fondo.jpg
new file mode 100644
index 0000000..2571eef
--- /dev/null
+++ b/images/derechos-plaza-fondo.jpg
Binary files differ
diff --git a/images/derechos-plaza-laberinto.jpg b/images/derechos-plaza-laberinto.jpg
new file mode 100644
index 0000000..f1fd0e5
--- /dev/null
+++ b/images/derechos-plaza-laberinto.jpg
Binary files differ
diff --git a/images/derechos-tileset-elementos.png b/images/derechos-tileset-elementos.png
new file mode 100644
index 0000000..55413e8
--- /dev/null
+++ b/images/derechos-tileset-elementos.png
Binary files differ
diff --git a/images/derechos-tileset-fondos.png b/images/derechos-tileset-fondos.png
new file mode 100644
index 0000000..6687051
--- /dev/null
+++ b/images/derechos-tileset-fondos.png
Binary files differ
diff --git a/images/main.png b/images/main.png
new file mode 100644
index 0000000..d5aaec6
--- /dev/null
+++ b/images/main.png
Binary files differ
diff --git a/images/main.xcf b/images/main.xcf
new file mode 100644
index 0000000..5eef5ec
--- /dev/null
+++ b/images/main.xcf
Binary files differ
diff --git a/images/xoxi-ninios-sprite-01.gif b/images/xoxi-ninios-sprite-01.gif
new file mode 100755
index 0000000..4e01f56
--- /dev/null
+++ b/images/xoxi-ninios-sprite-01.gif
Binary files differ
diff --git a/images/xoxi-ninios-sprite-01.png b/images/xoxi-ninios-sprite-01.png
new file mode 100644
index 0000000..fb53af5
--- /dev/null
+++ b/images/xoxi-ninios-sprite-01.png
Binary files differ
diff --git a/images/xoxi-ninios-sprite-02.gif b/images/xoxi-ninios-sprite-02.gif
new file mode 100644
index 0000000..0c104cf
--- /dev/null
+++ b/images/xoxi-ninios-sprite-02.gif
Binary files differ
diff --git a/images/xoxi-ninios-sprite-03.gif b/images/xoxi-ninios-sprite-03.gif
new file mode 100644
index 0000000..1c6f9fa
--- /dev/null
+++ b/images/xoxi-ninios-sprite-03.gif
Binary files differ